@internetarchive/collection-browser 4.1.1 → 4.1.2-alpha10
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/src/app-root.js +4 -1
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.js +11 -2
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/models.js +1 -0
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.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 +121 -120
- package/renovate.json +6 -6
- package/src/app-root.ts +4 -1
- package/src/collection-browser.ts +12 -2
- package/src/data-source/collection-browser-data-source.ts +1 -1
- package/src/models.ts +1 -0
- package/src/restoration-state-handler.ts +550 -550
- package/tsconfig.json +25 -25
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +52 -52
package/package.json
CHANGED
|
@@ -1,120 +1,121 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@internetarchive/collection-browser",
|
|
3
|
-
"description": "The Internet Archive Collection Browser.",
|
|
4
|
-
"license": "AGPL-3.0-only",
|
|
5
|
-
"author": "Internet Archive",
|
|
6
|
-
"version": "4.1.
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"start": "vite",
|
|
11
|
-
"prepare:ghpages": "rimraf ghpages && yarn run prepare && vite build",
|
|
12
|
-
"prepare": "rimraf dist && tsc && husky install",
|
|
13
|
-
"lint": "eslint . && prettier \"**/*.ts\" --check",
|
|
14
|
-
"format": "eslint . --fix && prettier \"**/*.ts\" --write",
|
|
15
|
-
"circular": "madge --circular --extensions ts .",
|
|
16
|
-
"test": "tsc && yarn run lint && yarn run circular && wtr --coverage",
|
|
17
|
-
"test:fast": "tsc && wtr --coverage",
|
|
18
|
-
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"",
|
|
19
|
-
"deploy": "yarn run deploy:run -e $(git branch --show-current)",
|
|
20
|
-
"deploy:run": "yarn run prepare:ghpages && touch ghpages/.nojekyll && yarn run deploy:gh",
|
|
21
|
-
"deploy:gh": "gh-pages -t -d ghpages -m \"Build for $(git log --pretty=format:\"%h %an %ai %s\" -n1) [skip ci]\"",
|
|
22
|
-
"typecheck": "yarn tsc --noEmit"
|
|
23
|
-
},
|
|
24
|
-
"types": "dist/index.d.ts",
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@a11y/focus-trap": "^1.0.5",
|
|
27
|
-
"@internetarchive/analytics-manager": "^0.1.4",
|
|
28
|
-
"@internetarchive/elements": "^0.2.2",
|
|
29
|
-
"@internetarchive/feature-feedback": "^1.0.0",
|
|
30
|
-
"@internetarchive/field-parsers": "^1.0.0",
|
|
31
|
-
"@internetarchive/histogram-date-range": "^1.4.1",
|
|
32
|
-
"@internetarchive/ia-dropdown": "^2.0.0",
|
|
33
|
-
"@internetarchive/
|
|
34
|
-
"@internetarchive/
|
|
35
|
-
"@internetarchive/
|
|
36
|
-
"@internetarchive/
|
|
37
|
-
"@internetarchive/
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@
|
|
46
|
-
"@open-wc/
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@types/
|
|
50
|
-
"@
|
|
51
|
-
"@typescript-eslint/
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@web/dev-server
|
|
55
|
-
"@web/
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"eslint
|
|
59
|
-
"eslint-
|
|
60
|
-
"eslint-plugin-
|
|
61
|
-
"eslint-plugin-
|
|
62
|
-
"eslint-plugin-lit
|
|
63
|
-
"eslint-plugin-
|
|
64
|
-
"eslint-plugin-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
"import/
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@internetarchive/collection-browser",
|
|
3
|
+
"description": "The Internet Archive Collection Browser.",
|
|
4
|
+
"license": "AGPL-3.0-only",
|
|
5
|
+
"author": "Internet Archive",
|
|
6
|
+
"version": "4.1.2-alpha10",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "vite",
|
|
11
|
+
"prepare:ghpages": "rimraf ghpages && yarn run prepare && vite build",
|
|
12
|
+
"prepare": "rimraf dist && tsc && husky install",
|
|
13
|
+
"lint": "eslint . && prettier \"**/*.ts\" --check",
|
|
14
|
+
"format": "eslint . --fix && prettier \"**/*.ts\" --write",
|
|
15
|
+
"circular": "madge --circular --extensions ts .",
|
|
16
|
+
"test": "tsc && yarn run lint && yarn run circular && wtr --coverage",
|
|
17
|
+
"test:fast": "tsc && wtr --coverage",
|
|
18
|
+
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"",
|
|
19
|
+
"deploy": "yarn run deploy:run -e $(git branch --show-current)",
|
|
20
|
+
"deploy:run": "yarn run prepare:ghpages && touch ghpages/.nojekyll && yarn run deploy:gh",
|
|
21
|
+
"deploy:gh": "gh-pages -t -d ghpages -m \"Build for $(git log --pretty=format:\"%h %an %ai %s\" -n1) [skip ci]\"",
|
|
22
|
+
"typecheck": "yarn tsc --noEmit"
|
|
23
|
+
},
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@a11y/focus-trap": "^1.0.5",
|
|
27
|
+
"@internetarchive/analytics-manager": "^0.1.4",
|
|
28
|
+
"@internetarchive/elements": "^0.2.2",
|
|
29
|
+
"@internetarchive/feature-feedback": "^1.0.0",
|
|
30
|
+
"@internetarchive/field-parsers": "^1.0.0",
|
|
31
|
+
"@internetarchive/histogram-date-range": "^1.4.1",
|
|
32
|
+
"@internetarchive/ia-dropdown": "^2.0.0",
|
|
33
|
+
"@internetarchive/ia-userlist-settings": "^1.1.3-alpha3",
|
|
34
|
+
"@internetarchive/iaux-item-metadata": "^1.0.5",
|
|
35
|
+
"@internetarchive/infinite-scroller": "^1.0.1",
|
|
36
|
+
"@internetarchive/modal-manager": "^2.0.5",
|
|
37
|
+
"@internetarchive/search-service": "^2.7.1-alpha3",
|
|
38
|
+
"@internetarchive/shared-resize-observer": "^0.2.0",
|
|
39
|
+
"@lit/localize": "^0.12.2",
|
|
40
|
+
"dompurify": "^3.2.4",
|
|
41
|
+
"lit": "^2.8.0 || ^3.3.2",
|
|
42
|
+
"typescript-cookie": "^1.0.6"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@internetarchive/result-type": "^0.0.1",
|
|
46
|
+
"@open-wc/eslint-config": "^12.0.3",
|
|
47
|
+
"@open-wc/testing": "^4.0.0",
|
|
48
|
+
"@rollup/plugin-image": "^3.0.3",
|
|
49
|
+
"@types/dompurify": "^3.2.0",
|
|
50
|
+
"@types/mocha": "^10.0.10",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
|
52
|
+
"@typescript-eslint/parser": "^8.27.0",
|
|
53
|
+
"@vitejs/plugin-basic-ssl": "^2.1.4",
|
|
54
|
+
"@web/dev-server": "^0.4.6",
|
|
55
|
+
"@web/dev-server-rollup": "^0.6.4",
|
|
56
|
+
"@web/test-runner": "^0.20.0",
|
|
57
|
+
"concurrently": "^9.1.2",
|
|
58
|
+
"eslint": "^9.22.0",
|
|
59
|
+
"eslint-config-prettier": "^10.1.1",
|
|
60
|
+
"eslint-plugin-html": "^8.1.2",
|
|
61
|
+
"eslint-plugin-import": "^2.31.0",
|
|
62
|
+
"eslint-plugin-lit": "^2.0.0",
|
|
63
|
+
"eslint-plugin-lit-a11y": "^4.1.4",
|
|
64
|
+
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
65
|
+
"eslint-plugin-wc": "^3.0.0",
|
|
66
|
+
"gh-pages": "^6.3.0",
|
|
67
|
+
"husky": "^9.1.7",
|
|
68
|
+
"madge": "^8.0.0",
|
|
69
|
+
"prettier": "^3.5.3",
|
|
70
|
+
"rimraf": "^6.0.1",
|
|
71
|
+
"sinon": "^19.0.4",
|
|
72
|
+
"tslib": "^2.8.1",
|
|
73
|
+
"typescript": "^5.8.2",
|
|
74
|
+
"vite": "^6.2.2"
|
|
75
|
+
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "public"
|
|
78
|
+
},
|
|
79
|
+
"eslintConfig": {
|
|
80
|
+
"parser": "@typescript-eslint/parser",
|
|
81
|
+
"extends": [
|
|
82
|
+
"@open-wc",
|
|
83
|
+
"prettier"
|
|
84
|
+
],
|
|
85
|
+
"plugins": [
|
|
86
|
+
"@typescript-eslint"
|
|
87
|
+
],
|
|
88
|
+
"rules": {
|
|
89
|
+
"no-unused-vars": "off",
|
|
90
|
+
"@typescript-eslint/no-unused-vars": [
|
|
91
|
+
"error"
|
|
92
|
+
],
|
|
93
|
+
"no-shadow": "off",
|
|
94
|
+
"@typescript-eslint/no-shadow": [
|
|
95
|
+
"error"
|
|
96
|
+
],
|
|
97
|
+
"class-methods-use-this": "off",
|
|
98
|
+
"import/no-unresolved": "off",
|
|
99
|
+
"import/extensions": [
|
|
100
|
+
"off",
|
|
101
|
+
"ignorePackages",
|
|
102
|
+
{
|
|
103
|
+
"js": "never",
|
|
104
|
+
"ts": "never"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"no-unsafe-optional-chaining": "warn",
|
|
108
|
+
"default-param-last": "warn"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"prettier": {
|
|
112
|
+
"singleQuote": true,
|
|
113
|
+
"arrowParens": "avoid"
|
|
114
|
+
},
|
|
115
|
+
"lint-staged": {
|
|
116
|
+
"*.ts": [
|
|
117
|
+
"eslint --fix",
|
|
118
|
+
"prettier --write"
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
}
|
package/renovate.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"config:base",
|
|
4
|
-
":preserveSemverRanges"
|
|
5
|
-
]
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"config:base",
|
|
4
|
+
":preserveSemverRanges"
|
|
5
|
+
]
|
|
6
|
+
}
|
package/src/app-root.ts
CHANGED
|
@@ -510,7 +510,10 @@ export class AppRoot extends LitElement {
|
|
|
510
510
|
.loggedIn=${this.loggedIn}
|
|
511
511
|
.modalManager=${this.modalManager}
|
|
512
512
|
.analyticsHandler=${this.analyticsHandler}
|
|
513
|
-
.pageContext=${'
|
|
513
|
+
.pageContext=${'profile'}
|
|
514
|
+
.pageType=${'account_details'}
|
|
515
|
+
.pageTarget=${'fav-neeraj_archive341'}
|
|
516
|
+
.profileElement=${'favorites'}
|
|
514
517
|
@visiblePageChanged=${this.visiblePageChanged}
|
|
515
518
|
@baseQueryChanged=${this.baseQueryChanged}
|
|
516
519
|
@searchTypeChanged=${this.searchTypeChanged}
|
|
@@ -860,8 +860,9 @@ export class CollectionBrowser
|
|
|
860
860
|
let sortFieldAvailability = defaultSortAvailability;
|
|
861
861
|
|
|
862
862
|
// We adjust the available sort options for a couple of special cases...
|
|
863
|
-
if (this.withinCollection?.startsWith('fav-')) {
|
|
864
|
-
// When viewing a fav- collection
|
|
863
|
+
if (this.withinCollection?.startsWith('fav-') || this.profileElement === 'favorites') {
|
|
864
|
+
// When viewing a fav- collection or the favorites profile tab,
|
|
865
|
+
// we include the Date Favorited option as the default
|
|
865
866
|
sortFieldAvailability = favoritesSortAvailability;
|
|
866
867
|
} else if (!this.withinCollection && this.searchType === SearchType.TV) {
|
|
867
868
|
// When viewing TV search results, we exclude several of the usual date sort options.
|
|
@@ -1637,6 +1638,7 @@ export class CollectionBrowser
|
|
|
1637
1638
|
this.addController(this.dataSource);
|
|
1638
1639
|
|
|
1639
1640
|
this.baseQuery = queryState.baseQuery;
|
|
1641
|
+
this.withinProfile = queryState.withinProfile;
|
|
1640
1642
|
this.profileElement = queryState.profileElement;
|
|
1641
1643
|
this.searchType = queryState.searchType;
|
|
1642
1644
|
this.selectedFacets =
|
|
@@ -1649,6 +1651,14 @@ export class CollectionBrowser
|
|
|
1649
1651
|
this.selectedTitleFilter = queryState.selectedTitleFilter;
|
|
1650
1652
|
this.selectedCreatorFilter = queryState.selectedCreatorFilter;
|
|
1651
1653
|
|
|
1654
|
+
// Apply the correct default sort for the new profile element immediately,
|
|
1655
|
+
// so it is in place before hostUpdate() fires on the data source.
|
|
1656
|
+
// Without this, a stale defaultSortField from a previously-active tab
|
|
1657
|
+
// could be used in the first fetch for the incoming tab.
|
|
1658
|
+
if (this.profileElement) {
|
|
1659
|
+
this.applyDefaultProfileSort();
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1652
1662
|
this.pagesToRender = this.initialPageNumber;
|
|
1653
1663
|
|
|
1654
1664
|
// We set this flag during the update to prevent the URL state persistence
|
|
@@ -1127,7 +1127,7 @@ export class CollectionBrowserDataSource
|
|
|
1127
1127
|
this.host.defaultSortField
|
|
1128
1128
|
) {
|
|
1129
1129
|
const sortOption = SORT_OPTIONS[this.host.defaultSortField];
|
|
1130
|
-
if (sortOption.searchServiceKey) {
|
|
1130
|
+
if (sortOption.searchServiceKey && sortOption.handledBySearchService) {
|
|
1131
1131
|
sortParams = [
|
|
1132
1132
|
{
|
|
1133
1133
|
field: sortOption.searchServiceKey,
|
package/src/models.ts
CHANGED
|
@@ -588,6 +588,7 @@ export const defaultProfileElementSorts: Record<
|
|
|
588
588
|
reviews: SortField.datereviewed,
|
|
589
589
|
collections: SortField.datearchived,
|
|
590
590
|
web_archives: SortField.datearchived,
|
|
591
|
+
favorites: SortField.datefavorited,
|
|
591
592
|
};
|
|
592
593
|
|
|
593
594
|
/** A union of the fields that permit prefix filtering (e.g., alphabetical filtering) */
|