@internetarchive/collection-browser 4.1.0-alpha-webdev8164.0 → 4.1.0-alpha-webdev8186.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.
Files changed (51) 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/.husky/pre-commit +4 -4
  7. package/.prettierignore +1 -1
  8. package/LICENSE +661 -661
  9. package/README.md +83 -83
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/src/collection-browser.js +3 -13
  13. package/dist/src/collection-browser.js.map +1 -1
  14. package/dist/src/collection-facets/facets-template.js +0 -5
  15. package/dist/src/collection-facets/facets-template.js.map +1 -1
  16. package/dist/src/collection-facets/more-facets-content.d.ts +8 -47
  17. package/dist/src/collection-facets/more-facets-content.js +83 -382
  18. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  19. package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -10
  20. package/dist/src/collection-facets/more-facets-pagination.js +1 -64
  21. package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
  22. package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +13 -172
  23. package/dist/src/sort-filter-bar/sort-filter-bar.js +37 -546
  24. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  25. package/dist/test/collection-browser.test.js +8 -13
  26. package/dist/test/collection-browser.test.js.map +1 -1
  27. package/dist/test/collection-facets/more-facets-content.test.js +3 -154
  28. package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
  29. package/dist/test/collection-facets/more-facets-pagination.test.js +0 -60
  30. package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -1
  31. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +86 -401
  32. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  33. package/eslint.config.mjs +53 -53
  34. package/index.html +24 -24
  35. package/index.ts +1 -0
  36. package/local.archive.org.cert +86 -86
  37. package/local.archive.org.key +27 -27
  38. package/package.json +121 -121
  39. package/renovate.json +6 -6
  40. package/src/collection-browser.ts +3 -13
  41. package/src/collection-facets/facets-template.ts +0 -5
  42. package/src/collection-facets/more-facets-content.ts +94 -411
  43. package/src/collection-facets/more-facets-pagination.ts +1 -73
  44. package/src/sort-filter-bar/sort-filter-bar.ts +42 -603
  45. package/test/collection-browser.test.ts +9 -20
  46. package/test/collection-facets/more-facets-content.test.ts +3 -218
  47. package/test/collection-facets/more-facets-pagination.test.ts +0 -84
  48. package/test/sort-filter-bar/sort-filter-bar.test.ts +110 -566
  49. package/tsconfig.json +25 -25
  50. package/web-dev-server.config.mjs +30 -30
  51. package/web-test-runner.config.mjs +52 -52
package/README.md CHANGED
@@ -1,84 +1,84 @@
1
- ![Build Status](https://github.com/internetarchive/iaux-collection-browser/actions/workflows/ci.yml/badge.svg) [![codecov](https://codecov.io/gh/internetarchive/iaux-collection-browser/branch/main/graph/badge.svg?token=CLWEGO4RMQ)](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 &lt;abbr title=&#34;test driven development&#34;&gt;TDD&lt;/abbr&gt;, 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
+ ![Build Status](https://github.com/internetarchive/iaux-collection-browser/actions/workflows/ci.yml/badge.svg) [![codecov](https://codecov.io/gh/internetarchive/iaux-collection-browser/branch/main/graph/badge.svg?token=CLWEGO4RMQ)](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 &lt;abbr title=&#34;test driven development&#34;&gt;TDD&lt;/abbr&gt;, 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>`
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export { ItemTile } from './src/tiles/grid/item-tile';
11
11
  export { TileList } from './src/tiles/list/tile-list';
12
12
  export { TileListCompact } from './src/tiles/list/tile-list-compact';
13
13
  export { TileDispatcher } from './src/tiles/tile-dispatcher';
14
+ export { LayoutType } from './src/tiles/models';
14
15
  export { SmartQueryHeuristic, KeywordFacetMap, SmartFacet, } from './src/collection-facets/smart-facets/models';
15
16
  export * from './src/collection-facets/smart-facets/heuristics/index';
16
17
  export { SmartQueryHeuristicGroup } from './src/collection-facets/smart-facets/smart-facet-heuristics';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAEL,SAAS,EACT,SAAS,EAGT,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAM7D,cAAc,uDAAuD,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC","sourcesContent":["export { CollectionBrowser } from './src/collection-browser';\nexport { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';\nexport { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';\nexport { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';\nexport { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';\nexport {\n CollectionDisplayMode,\n SortField,\n TileModel,\n FacetOption,\n SelectedFacets,\n getDefaultSelectedFacets,\n} from './src/models';\nexport { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';\nexport { CollectionTile } from './src/tiles/grid/collection-tile';\nexport { AccountTile } from './src/tiles/grid/account-tile';\nexport { ItemTile } from './src/tiles/grid/item-tile';\nexport { TileList } from './src/tiles/list/tile-list';\nexport { TileListCompact } from './src/tiles/list/tile-list-compact';\nexport { TileDispatcher } from './src/tiles/tile-dispatcher';\nexport {\n SmartQueryHeuristic,\n KeywordFacetMap,\n SmartFacet,\n} from './src/collection-facets/smart-facets/models';\nexport * from './src/collection-facets/smart-facets/heuristics/index';\nexport { SmartQueryHeuristicGroup } from './src/collection-facets/smart-facets/smart-facet-heuristics';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAEL,SAAS,EACT,SAAS,EAGT,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAO7D,cAAc,uDAAuD,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC","sourcesContent":["export { CollectionBrowser } from './src/collection-browser';\nexport { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';\nexport { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';\nexport { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';\nexport { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';\nexport {\n CollectionDisplayMode,\n SortField,\n TileModel,\n FacetOption,\n SelectedFacets,\n getDefaultSelectedFacets,\n} from './src/models';\nexport { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';\nexport { CollectionTile } from './src/tiles/grid/collection-tile';\nexport { AccountTile } from './src/tiles/grid/account-tile';\nexport { ItemTile } from './src/tiles/grid/item-tile';\nexport { TileList } from './src/tiles/list/tile-list';\nexport { TileListCompact } from './src/tiles/list/tile-list-compact';\nexport { TileDispatcher } from './src/tiles/tile-dispatcher';\nexport { LayoutType } from './src/tiles/models';\nexport {\n SmartQueryHeuristic,\n KeywordFacetMap,\n SmartFacet,\n} from './src/collection-facets/smart-facets/models';\nexport * from './src/collection-facets/smart-facets/heuristics/index';\nexport { SmartQueryHeuristicGroup } from './src/collection-facets/smart-facets/smart-facet-heuristics';\n"]}
@@ -612,21 +612,14 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
612
612
  if (this.suppressSortBar)
613
613
  return nothing;
614
614
  // Determine the set of sortable fields that should be shown in the sort bar
615
- let defaultViewSort = SortField.weeklyview;
616
- let defaultDateSort = SortField.date;
617
615
  let sortFieldAvailability = defaultSortAvailability;
618
- // We adjust the sort options for a couple of special cases...
616
+ // We adjust the available sort options for a couple of special cases...
619
617
  if (this.withinCollection?.startsWith('fav-')) {
620
- // When viewing a fav- collection, we include the Date Favorited option and show
621
- // it as the default in the date dropdown.
622
- defaultDateSort = SortField.datefavorited;
618
+ // When viewing a fav- collection, we include the Date Favorited option as the default
623
619
  sortFieldAvailability = favoritesSortAvailability;
624
620
  }
625
621
  else if (!this.withinCollection && this.searchType === SearchType.TV) {
626
- // When viewing TV search results, we default the views dropdown to All-time Views
627
- // and exclude several of the usual date sort options.
628
- defaultViewSort = SortField.alltimeview;
629
- defaultDateSort = SortField.datearchived;
622
+ // When viewing TV search results, we exclude several of the usual date sort options.
630
623
  sortFieldAvailability = tvSortAvailability;
631
624
  }
632
625
  // We only show relevance sort if a search query is currently defined
@@ -635,8 +628,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
635
628
  <sort-filter-bar
636
629
  .defaultSortField=${this.defaultSortField}
637
630
  .defaultSortDirection=${this.defaultSortDirection}
638
- .defaultViewSort=${defaultViewSort}
639
- .defaultDateSort=${defaultDateSort}
640
631
  .selectedSort=${this.selectedSort}
641
632
  .sortDirection=${this.sortDirection}
642
633
  .sortFieldAvailability=${sortFieldAvailability}
@@ -644,7 +635,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
644
635
  .selectedTitleFilter=${this.selectedTitleFilter}
645
636
  .selectedCreatorFilter=${this.selectedCreatorFilter}
646
637
  .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}
647
- .resizeObserver=${this.resizeObserver}
648
638
  .enableSortOptionsSlot=${this.enableSortOptionsSlot}
649
639
  .suppressDisplayModes=${this.suppressDisplayModes}
650
640
  @sortChanged=${this.userChangedSort}