protvista-uniprot 4.7.2 → 4.8.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 (65) hide show
  1. package/README.md +68 -5
  2. package/dist/protvista-uniprot.mjs +137386 -94741
  3. package/dist/protvista-uniprot.mjs.map +1 -1
  4. package/dist/types/adapters/alphafold-confidence-adapter.d.ts +1 -1
  5. package/dist/types/adapters/alphamissense-heatmap-adapter.d.ts +6 -1
  6. package/dist/types/adapters/alphamissense-pathogenicity-adapter.d.ts +1 -1
  7. package/dist/types/adapters/feature-adapter.d.ts +3 -1
  8. package/dist/types/adapters/proteomics-adapter.d.ts +31 -1
  9. package/dist/types/adapters/ptm-exchange-adapter.d.ts +1 -1
  10. package/dist/types/adapters/rna-editing-graph-adapter.d.ts +1 -1
  11. package/dist/types/adapters/structure-adapter.d.ts +27 -3
  12. package/dist/types/adapters/types/interpro.d.ts +1 -1
  13. package/dist/types/adapters/variation-adapter.d.ts +2 -2
  14. package/dist/types/adapters/variation-graph-adapter.d.ts +3 -2
  15. package/dist/types/config.d.ts +1 -1
  16. package/dist/types/filter-config.d.ts +7 -7
  17. package/dist/types/protvista-uniprot-datatable.d.ts +39 -0
  18. package/dist/types/protvista-uniprot-structure.d.ts +9 -10
  19. package/dist/types/protvista-uniprot.d.ts +9 -4
  20. package/dist/types/tooltips/feature-tooltip.d.ts +47 -3
  21. package/dist/types/tooltips/structure-tooltip.d.ts +2 -1
  22. package/dist/types/tooltips/variation-tooltip.d.ts +1 -1
  23. package/dist/types/utils/__spec__/protvista-uniprot-datatable.spec.d.ts +1 -0
  24. package/dist/types/utils/__spec__/security.spec.d.ts +1 -0
  25. package/dist/types/{utils.d.ts → utils/index.d.ts} +7 -1
  26. package/dist/types/utils/protvista-uniprot-datatable.d.ts +16 -0
  27. package/dist/types/utils/security.d.ts +19 -0
  28. package/package.json +36 -35
  29. package/src/.vscode/settings.json +3 -0
  30. package/src/__spec__/filter-config.spec.ts +54 -86
  31. package/src/adapters/.DS_Store +0 -0
  32. package/src/adapters/__tests__/__snapshots__/structure-adapter.spec.ts.snap +3 -3
  33. package/src/adapters/__tests__/structure-adapter.spec.ts +2 -0
  34. package/src/adapters/alphafold-confidence-adapter.ts +2 -1
  35. package/src/adapters/alphamissense-heatmap-adapter.ts +16 -8
  36. package/src/adapters/alphamissense-pathogenicity-adapter.ts +11 -6
  37. package/src/adapters/feature-adapter.ts +2 -2
  38. package/src/adapters/proteomics-adapter.ts +17 -7
  39. package/src/adapters/ptm-exchange-adapter.ts +5 -2
  40. package/src/adapters/rna-editing-adapter.ts +1 -1
  41. package/src/adapters/structure-adapter.ts +38 -12
  42. package/src/adapters/types/.DS_Store +0 -0
  43. package/src/adapters/types/interpro.ts +1 -1
  44. package/src/adapters/variation-adapter.ts +4 -4
  45. package/src/adapters/variation-graph-adapter.ts +6 -4
  46. package/src/config.ts +3 -3
  47. package/src/filter-config.ts +12 -12
  48. package/src/icons/download.svg +2 -3
  49. package/src/icons/external-link.svg +4 -0
  50. package/src/protvista-uniprot-datatable.ts +489 -0
  51. package/src/protvista-uniprot-structure.ts +236 -245
  52. package/src/protvista-uniprot.ts +170 -66
  53. package/src/tooltips/feature-tooltip.ts +92 -44
  54. package/src/tooltips/interpro-tooltip.ts +8 -7
  55. package/src/tooltips/ptm-tooltip.ts +7 -5
  56. package/src/tooltips/rna-editing-tooltip.ts +9 -8
  57. package/src/tooltips/structure-tooltip.ts +15 -6
  58. package/src/tooltips/variation-tooltip.ts +16 -15
  59. package/src/types/custom.d.ts +1 -1
  60. package/src/utils/__spec__/protvista-uniprot-datatable.spec.ts +214 -0
  61. package/src/utils/__spec__/security.spec.ts +145 -0
  62. package/src/{utils.ts → utils/index.ts} +1 -1
  63. package/src/utils/protvista-uniprot-datatable.ts +96 -0
  64. package/src/utils/security.ts +53 -0
  65. package/src/types/protvista-datatable.d.ts +0 -15
package/README.md CHANGED
@@ -1,10 +1,19 @@
1
- # protvista-uniprot
1
+ # ProtVista
2
2
 
3
3
  A Web Component which uses [Nightingale](https://github.com/ebi-webcomponents/nightingale) components to display protein sequence information.
4
4
 
5
- ![Image of protvista-uniprot](protvista.png)
5
+ **Branching model and v5**
6
6
 
7
- ## 📣 Monthly Office Hours
7
+ > - **`main` (this branch)** is the current-major **4.x** production line. Published on npm as `protvista-uniprot`; custom element `<protvista-uniprot>`. Receives non-breaking changes (security, performance, dependencies, CI). Use this for production.
8
+ > - **[`next`](../../tree/next)** is the **v5** development line. It carries any breaking changes that come out of the [SSI RSMF](ROADMAP.md) work: a configuration-driven loader, a published JSON-Schema for viewer configurations, a declarative tooltip resolver.`v5` will rename the package and element to `protvista`. GitHub has already been renamed and the old URL auto-redirects, and `protvista-uniprot` will remain on npm as a deprecated alias once v5 ships. **Schemas and APIs on `next` are still evolving — do not depend on them in production yet.** Targeted production release: early 2027.
9
+
10
+ ![Image of ProtVista](protvista.png)
11
+
12
+ ## Roadmap & Future Plans
13
+
14
+ Check out our **[3-Year Roadmap & Sustainability Plan (DRAFT)](ROADMAP.md)** to see our upcoming improvements, including moving towards a configuration-driven architecture, and how you can get involved!
15
+
16
+ ## Monthly Office Hours
8
17
 
9
18
  Have questions about using or contributing to ProtVista?
10
19
 
@@ -25,6 +34,19 @@ We welcome contributions!
25
34
  - [protvista-uniprot v3](https://github.com/ebi-webcomponents/protvista-uniprot) is compatible with [nightingale v5](https://github.com/ebi-webcomponents/nightingale)
26
35
  - [protvista-uniprot v2](https://github.com/ebi-webcomponents/protvista-uniprot/tree/v2) is compatible with [nightingale v3](https://github.com/ebi-webcomponents/nightingale/tree/v3)
27
36
 
37
+ ## Browser Support
38
+
39
+ This component requires a modern browser with support for [ES2021](https://caniuse.com/?search=ES2021) and [Web Components (Custom Elements v1)](https://caniuse.com/custom-elementsv1).
40
+
41
+ | Browser | Minimum version |
42
+ | ------- | --------------- |
43
+ | Chrome | 92+ |
44
+ | Edge | 92+ |
45
+ | Firefox | 90+ |
46
+ | Safari | 15+ |
47
+
48
+ Older browsers are not supported.
49
+
28
50
  ## Usage
29
51
 
30
52
  ### Use within an HTML file
@@ -72,6 +94,47 @@ yarn start
72
94
 
73
95
  to install dependencies and start the local development server.
74
96
 
97
+ ## Testing
98
+
99
+ Tests run under [Vitest](https://vitest.dev/) with a `jsdom` DOM environment. All APIs (`describe`, `it`, `expect`, `vi`, …) must be imported explicitly from `'vitest'` — `globals` is off.
100
+
101
+ ```bash
102
+ # Run the full pipeline (lint + types + unit)
103
+ yarn test
104
+
105
+ # Unit tests only (CI-friendly, non-zero exit on failure)
106
+ yarn test:unit
107
+
108
+ # Watch mode
109
+ yarn test:watch
110
+
111
+ # Coverage (writes text + html + lcov to ./coverage/)
112
+ yarn test:coverage
113
+ ```
114
+
115
+ Coverage output is for local use only and is not committed. Open `coverage/index.html` after `yarn test:coverage` to inspect.
116
+
117
+ ### Continuous integration
118
+
119
+ Every push and pull request runs the same three steps as `yarn test` via [`.github/workflows/test-and-deploy.yml`](./.github/workflows/test-and-deploy.yml): `yarn test:lint`, `yarn test:types`, and `yarn test:unit`, under Node 24 on `ubuntu-latest`. A separate `build` job runs `yarn build` (and, on `main`, `yarn build:demo`) and deploys the demo to GitHub Pages. Coverage is not collected in CI today — run `yarn test:coverage` locally when you need a coverage signal.
120
+
121
+ ### Coverage
122
+
123
+ Captured 2026-04-20 via `yarn test:coverage` (v8 instrumentation, 29 tests across 3 spec files):
124
+
125
+ | Metric | Coverage |
126
+ | ---------- | -------- |
127
+ | Statements | 10.33% |
128
+ | Branches | 5.99% |
129
+ | Functions | 13.19% |
130
+ | Lines | 9.66% |
131
+
132
+ ## Performance benchmarks
133
+
134
+ A `bench/` workflow captures repeatable performance baselines for the demo across three layers: library bundle size, Lighthouse CI against a fixed set of UniProt scenarios, and DOM-observed custom milestones (`fetch-and-parse`, `render`, `total`). Run `yarn bench` to produce `bench/results/summary.md`. Reference snapshots live under `bench/baselines/` and are committed; per-run output is gitignored.
135
+
136
+ See [`bench/README.md`](./bench/README.md) for scenarios, capture procedure, and methodology notes.
137
+
75
138
  ## Configuration
76
139
 
77
140
  You can pass your own configuration to the component using the `config` attribute/property.
@@ -82,7 +145,7 @@ You can pass your own configuration to the component using the `config` attribut
82
145
  {
83
146
  "name": "string",
84
147
  "label": "string",
85
- "trackType": "nightingale-track-canvas|nightingale-linegraph-track|nightingale-variation",
148
+ "trackType": "nightingale-track-canvas|nightingale-linegraph-track|nightingale-variation-canvas,
86
149
  "adapter": "feature-adapter|structure-adapter|proteomics-adapter|variation-adapter",
87
150
  "url": "string",
88
151
  "tracks": [
@@ -90,7 +153,7 @@ You can pass your own configuration to the component using the `config` attribut
90
153
  "name": "string",
91
154
  "label": "string",
92
155
  "filter": "string",
93
- "trackType": "nightingale-track-canvas|nightingale-linegraph-track|nightingale-variation",
156
+ "trackType": "nightingale-track-canvas|nightingale-linegraph-track|nightingale-variation-canvas,
94
157
  "tooltip": "string"
95
158
  }
96
159
  ]