@internetarchive/collection-browser 3.2.0 → 3.3.1-alpha1

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 (76) 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/src/collection-browser.d.ts +4 -0
  11. package/dist/src/collection-browser.js +702 -682
  12. package/dist/src/collection-browser.js.map +1 -1
  13. package/dist/src/collection-facets/more-facets-content.js +118 -118
  14. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  15. package/dist/src/collection-facets.js +266 -266
  16. package/dist/src/collection-facets.js.map +1 -1
  17. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  18. package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
  19. package/dist/src/data-source/models.js.map +1 -1
  20. package/dist/src/tiles/base-tile-component.d.ts +7 -0
  21. package/dist/src/tiles/base-tile-component.js +13 -0
  22. package/dist/src/tiles/base-tile-component.js.map +1 -1
  23. package/dist/src/tiles/grid/account-tile.js +37 -36
  24. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  25. package/dist/src/tiles/grid/collection-tile.js +78 -77
  26. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  27. package/dist/src/tiles/grid/item-tile.d.ts +1 -1
  28. package/dist/src/tiles/grid/item-tile.js +139 -140
  29. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  30. package/dist/src/tiles/list/tile-list-compact.js +100 -98
  31. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  32. package/dist/src/tiles/list/tile-list.js +300 -300
  33. package/dist/src/tiles/list/tile-list.js.map +1 -1
  34. package/dist/src/tiles/tile-dispatcher.js +204 -200
  35. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  36. package/dist/src/utils/format-date.d.ts +15 -1
  37. package/dist/src/utils/format-date.js +8 -3
  38. package/dist/src/utils/format-date.js.map +1 -1
  39. package/dist/test/collection-browser.test.js +189 -189
  40. package/dist/test/collection-browser.test.js.map +1 -1
  41. package/dist/test/tiles/grid/item-tile.test.js +115 -64
  42. package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
  43. package/dist/test/tiles/list/tile-list-compact.test.js +108 -57
  44. package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
  45. package/dist/test/tiles/list/tile-list.test.js +164 -113
  46. package/dist/test/tiles/list/tile-list.test.js.map +1 -1
  47. package/dist/test/utils/format-date.test.js +31 -1
  48. package/dist/test/utils/format-date.test.js.map +1 -1
  49. package/eslint.config.mjs +53 -53
  50. package/index.html +24 -24
  51. package/local.archive.org.cert +86 -86
  52. package/local.archive.org.key +27 -27
  53. package/package.json +117 -117
  54. package/renovate.json +6 -6
  55. package/src/collection-browser.ts +2829 -2804
  56. package/src/collection-facets/more-facets-content.ts +639 -639
  57. package/src/collection-facets.ts +995 -995
  58. package/src/data-source/collection-browser-data-source.ts +1401 -1401
  59. package/src/data-source/collection-browser-query-state.ts +65 -65
  60. package/src/data-source/models.ts +43 -43
  61. package/src/tiles/base-tile-component.ts +65 -53
  62. package/src/tiles/grid/account-tile.ts +113 -112
  63. package/src/tiles/grid/collection-tile.ts +163 -162
  64. package/src/tiles/grid/item-tile.ts +340 -339
  65. package/src/tiles/list/tile-list-compact.ts +239 -236
  66. package/src/tiles/list/tile-list.ts +700 -696
  67. package/src/tiles/tile-dispatcher.ts +490 -486
  68. package/src/utils/format-date.ts +62 -42
  69. package/test/collection-browser.test.ts +2403 -2403
  70. package/test/tiles/grid/item-tile.test.ts +520 -464
  71. package/test/tiles/list/tile-list-compact.test.ts +282 -228
  72. package/test/tiles/list/tile-list.test.ts +552 -497
  73. package/test/utils/format-date.test.ts +89 -39
  74. package/tsconfig.json +20 -20
  75. package/web-dev-server.config.mjs +30 -30
  76. package/web-test-runner.config.mjs +41 -41
package/.editorconfig CHANGED
@@ -1,29 +1,29 @@
1
- # EditorConfig helps developers define and maintain consistent
2
- # coding styles between different editors and IDEs
3
- # editorconfig.org
4
-
5
- root = true
6
-
7
-
8
- [*]
9
-
10
- # Change these settings to your own preference
11
- indent_style = space
12
- indent_size = 2
13
-
14
- # We recommend you to keep these unchanged
15
- end_of_line = lf
16
- charset = utf-8
17
- trim_trailing_whitespace = true
18
- insert_final_newline = true
19
-
20
- [*.md]
21
- trim_trailing_whitespace = false
22
-
23
- [*.json]
24
- indent_size = 2
25
-
26
- [*.{html,js,md}]
27
- block_comment_start = /**
28
- block_comment = *
29
- block_comment_end = */
1
+ # EditorConfig helps developers define and maintain consistent
2
+ # coding styles between different editors and IDEs
3
+ # editorconfig.org
4
+
5
+ root = true
6
+
7
+
8
+ [*]
9
+
10
+ # Change these settings to your own preference
11
+ indent_style = space
12
+ indent_size = 2
13
+
14
+ # We recommend you to keep these unchanged
15
+ end_of_line = lf
16
+ charset = utf-8
17
+ trim_trailing_whitespace = true
18
+ insert_final_newline = true
19
+
20
+ [*.md]
21
+ trim_trailing_whitespace = false
22
+
23
+ [*.json]
24
+ indent_size = 2
25
+
26
+ [*.{html,js,md}]
27
+ block_comment_start = /**
28
+ block_comment = *
29
+ block_comment_end = */
@@ -1,27 +1,27 @@
1
- name: App CI
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- pull_request:
7
- branches: [ main ]
8
-
9
- jobs:
10
- build:
11
- runs-on: ubuntu-latest
12
-
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: actions/setup-node@v4
16
- with:
17
- node-version: latest
18
-
19
- - name: Install dependencies
20
- run: yarn install
21
-
22
- - name: Run tests
23
- run: yarn run test
24
-
25
- - uses: codecov/codecov-action@v4
26
- with:
27
- token: ${{ secrets.CODECOV_TOKEN }}
1
+ name: App CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-node@v4
16
+ with:
17
+ node-version: latest
18
+
19
+ - name: Install dependencies
20
+ run: yarn install
21
+
22
+ - name: Run tests
23
+ run: yarn run test
24
+
25
+ - uses: codecov/codecov-action@v4
26
+ with:
27
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -1,39 +1,39 @@
1
- # This workflow will generate the static page under `main` subdirectory inside the `gh-pages` branch
2
-
3
- # This workflow will run every time new changes were pushed to the `main` branch
4
-
5
- name: App build CI/CD to main branch
6
-
7
- on:
8
- push:
9
- branches: [ main ]
10
-
11
- jobs:
12
- build:
13
- runs-on: ubuntu-latest
14
-
15
- steps:
16
- - uses: actions/checkout@v4
17
- with:
18
- persist-credentials: false
19
-
20
- - uses: actions/setup-node@v4
21
- with:
22
- node-version: latest
23
-
24
- - name: Install dependencies
25
- run: yarn install
26
-
27
- - name: Create build files for gh-pages deploy
28
- run: yarn prepare:ghpages
29
-
30
- # Reference: https://github.com/JamesIves/github-pages-deploy-action
31
- - name: Deploy 🚀
32
- uses: JamesIves/github-pages-deploy-action@v4.4.3
33
- with:
34
- branch: gh-pages
35
- folder: ghpages
36
- clean-exclude: pr/
37
- force: false
38
- target-folder: main
39
- token: ${{ secrets.GH_TOKEN }}
1
+ # This workflow will generate the static page under `main` subdirectory inside the `gh-pages` branch
2
+
3
+ # This workflow will run every time new changes were pushed to the `main` branch
4
+
5
+ name: App build CI/CD to main branch
6
+
7
+ on:
8
+ push:
9
+ branches: [ main ]
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ persist-credentials: false
19
+
20
+ - uses: actions/setup-node@v4
21
+ with:
22
+ node-version: latest
23
+
24
+ - name: Install dependencies
25
+ run: yarn install
26
+
27
+ - name: Create build files for gh-pages deploy
28
+ run: yarn prepare:ghpages
29
+
30
+ # Reference: https://github.com/JamesIves/github-pages-deploy-action
31
+ - name: Deploy 🚀
32
+ uses: JamesIves/github-pages-deploy-action@v4.4.3
33
+ with:
34
+ branch: gh-pages
35
+ folder: ghpages
36
+ clean-exclude: pr/
37
+ force: false
38
+ target-folder: main
39
+ token: ${{ secrets.GH_TOKEN }}
@@ -1,39 +1,39 @@
1
- # This workflow will be triggered if there's a new release tag created/pushed in Github repo
2
-
3
- # This workflow will do the following:
4
- # - run tests using node
5
- # - publish a package to GitHub Packages when a release is created
6
-
7
- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
8
-
9
- name: Node.js Package
10
-
11
- on:
12
- release:
13
- types: [created]
14
-
15
- jobs:
16
- build:
17
- runs-on: ubuntu-latest
18
- steps:
19
- - uses: actions/checkout@v4
20
- - uses: actions/setup-node@v3
21
- with:
22
- node-version: 16
23
- - run: npm ci
24
- - run: npm prepare
25
- - run: npm test
26
-
27
- publish-npm:
28
- needs: build
29
- runs-on: ubuntu-latest
30
- steps:
31
- - uses: actions/checkout@v4
32
- - uses: actions/setup-node@v3
33
- with:
34
- node-version: 16
35
- registry-url: https://registry.npmjs.org/
36
- - run: npm ci
37
- - run: npm publish --tag next
38
- env:
39
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
1
+ # This workflow will be triggered if there's a new release tag created/pushed in Github repo
2
+
3
+ # This workflow will do the following:
4
+ # - run tests using node
5
+ # - publish a package to GitHub Packages when a release is created
6
+
7
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
8
+
9
+ name: Node.js Package
10
+
11
+ on:
12
+ release:
13
+ types: [created]
14
+
15
+ jobs:
16
+ build:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-node@v3
21
+ with:
22
+ node-version: 16
23
+ - run: npm ci
24
+ - run: npm prepare
25
+ - run: npm test
26
+
27
+ publish-npm:
28
+ needs: build
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - uses: actions/setup-node@v3
33
+ with:
34
+ node-version: 16
35
+ registry-url: https://registry.npmjs.org/
36
+ - run: npm ci
37
+ - run: npm publish --tag next
38
+ env:
39
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
@@ -1,38 +1,38 @@
1
- # This workflow will generate the static page under `pr` subdirectory inside the `gh-pages` branch
2
-
3
- # This workflow will run every time there's a PR opened, reopened, synchronize, or closed
4
-
5
- name: Deploy PR previews
6
-
7
- on:
8
- pull_request:
9
- types:
10
- - opened
11
- - reopened
12
- - synchronize
13
- - closed
14
-
15
- concurrency: preview-${{ github.ref }}
16
-
17
- jobs:
18
- deploy-preview:
19
- runs-on: ubuntu-latest
20
- steps:
21
- - name: Checkout
22
- uses: actions/checkout@v4
23
-
24
- - uses: actions/setup-node@v4
25
- with:
26
- node-version: latest
27
-
28
- - name: Install and Build
29
- run: |
30
- yarn install
31
- yarn prepare:ghpages
32
-
33
- # Reference: https://github.com/rossjrw/pr-preview-action
34
- - name: Deploy preview
35
- uses: rossjrw/pr-preview-action@v1
36
- with:
37
- source-dir: ./ghpages/
38
- umbrella-dir: pr
1
+ # This workflow will generate the static page under `pr` subdirectory inside the `gh-pages` branch
2
+
3
+ # This workflow will run every time there's a PR opened, reopened, synchronize, or closed
4
+
5
+ name: Deploy PR previews
6
+
7
+ on:
8
+ pull_request:
9
+ types:
10
+ - opened
11
+ - reopened
12
+ - synchronize
13
+ - closed
14
+
15
+ concurrency: preview-${{ github.ref }}
16
+
17
+ jobs:
18
+ deploy-preview:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - uses: actions/setup-node@v4
25
+ with:
26
+ node-version: latest
27
+
28
+ - name: Install and Build
29
+ run: |
30
+ yarn install
31
+ yarn prepare:ghpages
32
+
33
+ # Reference: https://github.com/rossjrw/pr-preview-action
34
+ - name: Deploy preview
35
+ uses: rossjrw/pr-preview-action@v1
36
+ with:
37
+ source-dir: ./ghpages/
38
+ umbrella-dir: pr
package/.husky/pre-commit CHANGED
@@ -1,4 +1,4 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx lint-staged
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
package/.prettierignore CHANGED
@@ -1 +1 @@
1
- coverage
1
+ coverage