Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ia-activity-indicator and histogram #419

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: latest

- name: Install dependencies
run: yarn install
Expand All @@ -24,4 +24,4 @@ jobs:

- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage
53 changes: 53 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import html from 'eslint-plugin-html';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...compat.extends('plugin:@typescript-eslint/recommended'),
{
plugins: {
'@typescript-eslint': typescriptEslint,
html,
},

languageOptions: {
parser: tsParser,
},

settings: {
'import/resolver': {
node: {
extensions: ['.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src', 'demo'],
},
},
},

rules: {
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
{
ignores: ['**/*.js', '**/*.mjs', '**/*.d.ts'],
},
{
files: ['**/*.test.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
},
];
3 changes: 0 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
}
</style>

<script
src="https://polyfill.archive.org/v3/polyfill.min.js?features=scrollIntoView%2CElement.prototype.scrollIntoView"></script>

</head>
<body>
<app-root></app-root>
Expand Down
73 changes: 37 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"start": "yarn run prepare && tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
"prepare:ghpages": "rimraf ghpages && yarn run prepare && vite build",
"prepare": "rimraf dist && tsc && husky install",
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
"lint": "eslint . && prettier \"**/*.ts\" --check",
"format": "eslint . --fix && prettier \"**/*.ts\" --write",
"circular": "madge --circular --extensions ts .",
"test": "tsc && yarn run lint && yarn run circular && wtr --coverage",
"test:fast": "tsc && wtr --coverage",
Expand All @@ -23,48 +23,49 @@
},
"types": "dist/index.d.ts",
"dependencies": {
"@internetarchive/analytics-manager": "^0.1.2",
"@internetarchive/analytics-manager": "^0.1.4",
"@internetarchive/feature-feedback": "^0.1.4",
"@internetarchive/field-parsers": "^0.1.4",
"@internetarchive/histogram-date-range": "^1.2.0",
"@internetarchive/ia-activity-indicator": "^0.0.4",
"@internetarchive/ia-dropdown": "^1.3.8",
"@internetarchive/histogram-date-range": "^1.2.1",
"@internetarchive/ia-activity-indicator": "^0.0.6",
"@internetarchive/ia-dropdown": "^1.3.10",
"@internetarchive/infinite-scroller": "1.0.1",
"@internetarchive/modal-manager": "^0.2.8",
"@internetarchive/modal-manager": "^2.0.1",
"@internetarchive/search-service": "^1.4.1",
"@internetarchive/shared-resize-observer": "^0.2.0",
"@lit/localize": "^0.11.2",
"dompurify": "^3.1.7",
"eslint-plugin-lit": "^1.6.1",
"lit": "^2.2.2",
"typescript-cookie": "^1.0.3"
"@lit/localize": "^0.12.2",
"dompurify": "^3.2.3",
"lit": "^2.8.0",
"typescript-cookie": "^1.0.6"
},
"devDependencies": {
"@internetarchive/result-type": "^0.0.1",
"@open-wc/eslint-config": "^8.0.2",
"@open-wc/testing": "^3.0.3",
"@types/dompurify": "^3.0.5",
"@typescript-eslint/eslint-plugin": "^5.3.1",
"@typescript-eslint/parser": "^5.3.1",
"@web/dev-server": "^0.1.28",
"@web/test-runner": "^0.13.22",
"concurrently": "^6.3.0",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-lit-a11y": "^2.2.0",
"eslint-plugin-no-only-tests": "^3.0.0",
"eslint-plugin-wc": "^1.3.2",
"gh-pages": "^4.0.0",
"husky": "^7.0.0",
"madge": "^7.0.0",
"prettier": "^2.4.1",
"rimraf": "^3.0.2",
"sinon": "^12.0.1",
"tslib": "^2.3.1",
"typescript": "^4.4.4",
"vite": "^2.9.9"
"@open-wc/eslint-config": "^12.0.3",
"@open-wc/testing": "^4.0.0",
"@types/dompurify": "^3.2.0",
"@types/mocha": "^10.0.10",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"@web/dev-server": "^0.4.6",
"@web/test-runner": "^0.19.0",
"concurrently": "^9.1.2",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-html": "^8.1.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-lit": "^1.15.0",
"eslint-plugin-lit-a11y": "^4.1.4",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-wc": "^2.2.0",
"gh-pages": "^6.3.0",
"husky": "^9.1.7",
"madge": "^8.0.0",
"prettier": "^3.4.2",
"rimraf": "^6.0.1",
"sinon": "^19.0.2",
"tslib": "^2.8.1",
"typescript": "^5.7.3",
"vite": "^6.0.7"
},
"publishConfig": {
"access": "public"
Expand Down
41 changes: 20 additions & 21 deletions src/app-root.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
import {
AnalyticsEvent,
AnalyticsManager,
Expand Down Expand Up @@ -83,7 +82,7 @@ export class AppRoot extends LitElement {
includeCredentials: false,
baseUrl: params.get('search_base_url') ?? undefined,
servicePath: params.get('search_service_path') ?? undefined,
debuggingEnabled: !!params.get('debugging') ?? undefined,
debuggingEnabled: !!params.get('debugging'),
});
}

Expand Down Expand Up @@ -210,7 +209,7 @@ export class AppRoot extends LitElement {
<button
@click=${() => {
const details = this.shadowRoot?.getElementById(
'latest-event-details'
'latest-event-details',
);
details?.classList.toggle('hidden');
}}
Expand Down Expand Up @@ -506,7 +505,7 @@ export class AppRoot extends LitElement {
`;
}

private async setPlaceholderType(type: String) {
private async setPlaceholderType(type: string) {
switch (type) {
case 'loading-placeholder':
this.collectionBrowser.baseQuery = '';
Expand Down Expand Up @@ -550,11 +549,11 @@ export class AppRoot extends LitElement {
if (target.checked) {
this.collectionBrowser.style.setProperty(
'--infiniteScrollerCellOutline',
'1px solid #33D1FF'
'1px solid #33D1FF',
);
} else {
this.collectionBrowser.style.removeProperty(
'--infiniteScrollerCellOutline'
'--infiniteScrollerCellOutline',
);
}
}
Expand All @@ -577,7 +576,7 @@ export class AppRoot extends LitElement {
path: pageUrl.toString(),
},
'',
pageUrl.toString()
pageUrl.toString(),
);
}
}
Expand All @@ -602,7 +601,7 @@ export class AppRoot extends LitElement {
async search(params, searchType) {
const searchResponse = await SearchService.default.search(
params,
searchType
searchType,
);
searchResponse.success?.response.results.forEach(result => {
Object.defineProperty(result, 'highlight', {
Expand Down Expand Up @@ -640,7 +639,7 @@ export class AppRoot extends LitElement {
async search(params, searchType) {
const searchResponse = await SearchService.default.search(
params,
searchType
searchType,
);
searchResponse.success?.response.results.forEach((result, i) => {
Object.defineProperty(result, 'review', {
Expand Down Expand Up @@ -702,7 +701,7 @@ export class AppRoot extends LitElement {
*/
private manageModeChanged(e: CustomEvent<boolean>): void {
const manageCheckbox = this.shadowRoot?.querySelector(
'#enable-management'
'#enable-management',
) as HTMLInputElement;
if (manageCheckbox) manageCheckbox.checked = e.detail;
}
Expand Down Expand Up @@ -752,7 +751,7 @@ export class AppRoot extends LitElement {
this.collectionBrowser.appendChild(p);
} else {
this.collectionBrowser.removeChild(
this.collectionBrowser.lastElementChild as Element
this.collectionBrowser.lastElementChild as Element,
);
}
}
Expand All @@ -776,7 +775,7 @@ export class AppRoot extends LitElement {
this.collectionBrowser.appendChild(div);
} else {
this.collectionBrowser.removeChild(
this.collectionBrowser.lastElementChild as Element
this.collectionBrowser.lastElementChild as Element,
);
}
}
Expand All @@ -798,7 +797,7 @@ export class AppRoot extends LitElement {
this.collectionBrowser.appendChild(p);
} else {
this.collectionBrowser.removeChild(
this.collectionBrowser.lastElementChild as Element
this.collectionBrowser.lastElementChild as Element,
);
}
}
Expand All @@ -820,7 +819,7 @@ export class AppRoot extends LitElement {
this.collectionBrowser.appendChild(div);
} else {
const slottedEl = this.collectionBrowser.querySelector(
'[slot="sort-options-left"]'
'[slot="sort-options-left"]',
);
if (slottedEl) this.collectionBrowser.removeChild(slottedEl);
}
Expand All @@ -843,7 +842,7 @@ export class AppRoot extends LitElement {
this.collectionBrowser.appendChild(div);
} else {
const slottedEl = this.collectionBrowser.querySelector(
'[slot="sort-options-right"]'
'[slot="sort-options-right"]',
);
if (slottedEl) this.collectionBrowser.removeChild(slottedEl);
}
Expand All @@ -854,7 +853,7 @@ export class AppRoot extends LitElement {
this.rowGap = parseFloat(input.value);
this.collectionBrowser.style.setProperty(
'--collectionBrowserRowGap',
`${input.value}rem`
`${input.value}rem`,
);
}

Expand All @@ -863,7 +862,7 @@ export class AppRoot extends LitElement {
this.colGap = parseFloat(input.value);
this.collectionBrowser.style.setProperty(
'--collectionBrowserColGap',
`${input.value}rem`
`${input.value}rem`,
);
}

Expand All @@ -872,7 +871,7 @@ export class AppRoot extends LitElement {
this.cellWidth = parseFloat(input.value);
this.collectionBrowser.style.setProperty(
'--collectionBrowserCellMinWidth',
`${input.value}rem`
`${input.value}rem`,
);
}

Expand All @@ -881,11 +880,11 @@ export class AppRoot extends LitElement {
this.cellHeight = parseFloat(input.value);
this.collectionBrowser.style.setProperty(
'--collectionBrowserCellMinHeight',
`${input.value}rem`
`${input.value}rem`,
);
this.collectionBrowser.style.setProperty(
'--collectionBrowserCellMaxHeight',
`${input.value}rem`
`${input.value}rem`,
);
}

Expand All @@ -912,7 +911,7 @@ export class AppRoot extends LitElement {
this.collectionBrowser.enableSortOptionsSlot = true;
} else {
const slottedEl = this.collectionBrowser.querySelector(
'[slot="sort-options"]'
'[slot="sort-options"]',
);
if (slottedEl) this.collectionBrowser.removeChild(slottedEl);
this.collectionBrowser.enableSortOptionsSlot = false;
Expand Down
Loading
Loading