@genspectrum/dashboard-components 1.7.0 → 1.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.
@@ -110,6 +110,14 @@
110
110
  },
111
111
  "default": "{ ...Template, args: { lapis: 'https://url.to.lapis-definitely-not-a-valid-url', }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); await waitFor(async () => { await expect( canvas.getByText('Error in gs-app: Cannot fetch reference genome.', { exact: false }), ).toBeVisible(); }); }, }"
112
112
  },
113
+ {
114
+ "kind": "variable",
115
+ "name": "ProvidesMutationLinkTemplateToChildren",
116
+ "type": {
117
+ "text": "StoryObj<StoryProps>"
118
+ },
119
+ "default": "{ ...Template, play: async ({ canvasElement }) => { const canvas = within(canvasElement); await waitFor(async () => { await expect(canvas.getByText('http://foo.com/query?nucMut={{mutation}}', { exact: false })).toBeVisible(); await expect(canvas.getByText('http://foo.com/query?aaMut={{mutation}}', { exact: false })).toBeVisible(); }); }, }"
120
+ },
113
121
  {
114
122
  "kind": "class",
115
123
  "description": "",
@@ -138,6 +146,14 @@
138
146
  "text": "MutationAnnotations"
139
147
  },
140
148
  "default": "[]"
149
+ },
150
+ {
151
+ "kind": "field",
152
+ "name": "mutationLinkTemplate",
153
+ "type": {
154
+ "text": "MutationLinkTemplate"
155
+ },
156
+ "default": "{}"
141
157
  }
142
158
  ],
143
159
  "superclass": {
@@ -189,6 +205,14 @@
189
205
  "module": "src/web-components/gs-app.stories.ts"
190
206
  }
191
207
  },
208
+ {
209
+ "kind": "js",
210
+ "name": "ProvidesMutationLinkTemplateToChildren",
211
+ "declaration": {
212
+ "name": "ProvidesMutationLinkTemplateToChildren",
213
+ "module": "src/web-components/gs-app.stories.ts"
214
+ }
215
+ },
192
216
  {
193
217
  "kind": "custom-element-definition",
194
218
  "name": "gs-app-display",
@@ -227,6 +251,16 @@
227
251
  "default": "[]",
228
252
  "description": "Supply lists of mutations that are especially relevant for the current organism.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-mutation-annotations--docs for more information.",
229
253
  "attribute": "mutationAnnotations"
254
+ },
255
+ {
256
+ "kind": "field",
257
+ "name": "mutationLinkTemplate",
258
+ "type": {
259
+ "text": "{\n nucleotideMutation?: string;\n aminoAcidMutation?: string;\n }"
260
+ },
261
+ "default": "{ nucleotideMutation: undefined, aminoAcidMutation: undefined, }",
262
+ "description": "Supply a link template for nucleotide and amino acid mutations.\nThe template should include '{{mutation}}' where the mutation code will be inserted, for example:\n\n https://my-site.org/query?nucleotideMutation={{mutation}}",
263
+ "attribute": "mutationLinkTemplate"
230
264
  }
231
265
  ],
232
266
  "attributes": [
@@ -247,6 +281,15 @@
247
281
  "default": "[]",
248
282
  "description": "Supply lists of mutations that are especially relevant for the current organism.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-mutation-annotations--docs for more information.",
249
283
  "fieldName": "mutationAnnotations"
284
+ },
285
+ {
286
+ "name": "mutationLinkTemplate",
287
+ "type": {
288
+ "text": "{\n nucleotideMutation?: string;\n aminoAcidMutation?: string;\n }"
289
+ },
290
+ "default": "{ nucleotideMutation: undefined, aminoAcidMutation: undefined, }",
291
+ "description": "Supply a link template for nucleotide and amino acid mutations.\nThe template should include '{{mutation}}' where the mutation code will be inserted, for example:\n\n https://my-site.org/query?nucleotideMutation={{mutation}}",
292
+ "fieldName": "mutationLinkTemplate"
250
293
  }
251
294
  ],
252
295
  "superclass": {
@@ -1798,12 +1841,50 @@
1798
1841
  }
1799
1842
  ]
1800
1843
  },
1844
+ {
1845
+ "kind": "javascript-module",
1846
+ "path": "src/web-components/mutation-link-template-context.ts",
1847
+ "declarations": [
1848
+ {
1849
+ "kind": "variable",
1850
+ "name": "mutationLinkTemplateSchema"
1851
+ },
1852
+ {
1853
+ "kind": "variable",
1854
+ "name": "mutationLinkTemplateContext"
1855
+ }
1856
+ ],
1857
+ "exports": [
1858
+ {
1859
+ "kind": "js",
1860
+ "name": "mutationLinkTemplateSchema",
1861
+ "declaration": {
1862
+ "name": "mutationLinkTemplateSchema",
1863
+ "module": "src/web-components/mutation-link-template-context.ts"
1864
+ }
1865
+ },
1866
+ {
1867
+ "kind": "js",
1868
+ "name": "mutationLinkTemplateContext",
1869
+ "declaration": {
1870
+ "name": "mutationLinkTemplateContext",
1871
+ "module": "src/web-components/mutation-link-template-context.ts"
1872
+ }
1873
+ }
1874
+ ]
1875
+ },
1801
1876
  {
1802
1877
  "kind": "javascript-module",
1803
1878
  "path": "src/web-components/mutationAnnotations.mdx",
1804
1879
  "declarations": [],
1805
1880
  "exports": []
1806
1881
  },
1882
+ {
1883
+ "kind": "javascript-module",
1884
+ "path": "src/web-components/mutationLinks.mdx",
1885
+ "declarations": [],
1886
+ "exports": []
1887
+ },
1807
1888
  {
1808
1889
  "kind": "javascript-module",
1809
1890
  "path": "src/web-components/reference-genome-context.ts",
@@ -130,6 +130,16 @@ export declare class AppComponent extends LitElement {
130
130
  aminoAcidMutations?: string[];
131
131
  aminoAcidPositions?: string[];
132
132
  }[];
133
+ /**
134
+ * Supply a link template for nucleotide and amino acid mutations.
135
+ * The template should include '{{mutation}}' where the mutation code will be inserted, for example:
136
+ *
137
+ * https://my-site.org/query?nucleotideMutation={{mutation}}
138
+ */
139
+ mutationLinkTemplate: {
140
+ nucleotideMutation?: string;
141
+ aminoAcidMutation?: string;
142
+ };
133
143
  /* Excluded from this release type: referenceGenome */
134
144
  /* Excluded from this release type: updateReferenceGenome */
135
145
  render(): TemplateResult<1> | undefined;
@@ -499,6 +509,7 @@ export declare class MutationComparisonComponent extends PreactLitAdapterWithGri
499
509
  */
500
510
  pageSize: boolean | number;
501
511
  /* Excluded from this release type: mutationAnnotations */
512
+ /* Excluded from this release type: mutationLinkTemplate */
502
513
  render(): JSX_2.Element;
503
514
  }
504
515
 
@@ -585,6 +596,19 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
585
596
  render(): JSX_2.Element;
586
597
  }
587
598
 
599
+ declare type MutationLinkTemplate = default_2.infer<typeof mutationLinkTemplateSchema>;
600
+
601
+ declare const mutationLinkTemplateSchema: default_2.ZodObject<{
602
+ nucleotideMutation: default_2.ZodOptional<default_2.ZodString>;
603
+ aminoAcidMutation: default_2.ZodOptional<default_2.ZodString>;
604
+ }, "strip", default_2.ZodTypeAny, {
605
+ nucleotideMutation?: string | undefined;
606
+ aminoAcidMutation?: string | undefined;
607
+ }, {
608
+ nucleotideMutation?: string | undefined;
609
+ aminoAcidMutation?: string | undefined;
610
+ }>;
611
+
588
612
  /**
589
613
  * ## Context
590
614
  *
@@ -687,6 +711,7 @@ export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles
687
711
  */
688
712
  pageSize: boolean | number;
689
713
  /* Excluded from this release type: mutationAnnotations */
714
+ /* Excluded from this release type: mutationLinkTemplate */
690
715
  render(): JSX_2.Element;
691
716
  }
692
717
 
@@ -796,6 +821,7 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
796
821
  */
797
822
  pageSizes: number[] | number;
798
823
  /* Excluded from this release type: mutationAnnotations */
824
+ /* Excluded from this release type: mutationLinkTemplate */
799
825
  render(): JSX_2.Element;
800
826
  }
801
827
 
@@ -1595,6 +1621,7 @@ export declare class WastewaterMutationsOverTimeComponent extends PreactLitAdapt
1595
1621
  */
1596
1622
  pageSizes: number[] | number;
1597
1623
  /* Excluded from this release type: mutationAnnotations */
1624
+ /* Excluded from this release type: mutationLinkTemplate */
1598
1625
  render(): JSX_2.Element;
1599
1626
  }
1600
1627
 
@@ -1674,7 +1701,7 @@ declare global {
1674
1701
 
1675
1702
  declare global {
1676
1703
  interface HTMLElementTagNameMap {
1677
- 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1704
+ 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1678
1705
  }
1679
1706
  }
1680
1707
 
@@ -1682,7 +1709,7 @@ declare global {
1682
1709
  declare global {
1683
1710
  namespace JSX {
1684
1711
  interface IntrinsicElements {
1685
- 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1712
+ 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1686
1713
  }
1687
1714
  }
1688
1715
  }
@@ -1690,7 +1717,7 @@ declare global {
1690
1717
 
1691
1718
  declare global {
1692
1719
  interface HTMLElementTagNameMap {
1693
- 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1720
+ 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1694
1721
  }
1695
1722
  }
1696
1723
 
@@ -1698,7 +1725,7 @@ declare global {
1698
1725
  declare global {
1699
1726
  namespace JSX {
1700
1727
  interface IntrinsicElements {
1701
- 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1728
+ 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1702
1729
  }
1703
1730
  }
1704
1731
  }
@@ -1786,11 +1813,7 @@ declare global {
1786
1813
 
1787
1814
  declare global {
1788
1815
  interface HTMLElementTagNameMap {
1789
- 'gs-date-range-filter': DateRangeFilterComponent;
1790
- }
1791
- interface HTMLElementEventMap {
1792
- [gsEventNames.dateRangeFilterChanged]: CustomEvent<Record<string, string>>;
1793
- [gsEventNames.dateRangeOptionChanged]: DateRangeOptionChangedEvent;
1816
+ 'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
1794
1817
  }
1795
1818
  }
1796
1819
 
@@ -1798,7 +1821,7 @@ declare global {
1798
1821
  declare global {
1799
1822
  namespace JSX {
1800
1823
  interface IntrinsicElements {
1801
- 'gs-date-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1824
+ 'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1802
1825
  }
1803
1826
  }
1804
1827
  }
@@ -1806,10 +1829,11 @@ declare global {
1806
1829
 
1807
1830
  declare global {
1808
1831
  interface HTMLElementTagNameMap {
1809
- 'gs-location-filter': LocationFilterComponent;
1832
+ 'gs-date-range-filter': DateRangeFilterComponent;
1810
1833
  }
1811
1834
  interface HTMLElementEventMap {
1812
- [gsEventNames.locationChanged]: LocationChangedEvent;
1835
+ [gsEventNames.dateRangeFilterChanged]: CustomEvent<Record<string, string>>;
1836
+ [gsEventNames.dateRangeOptionChanged]: DateRangeOptionChangedEvent;
1813
1837
  }
1814
1838
  }
1815
1839
 
@@ -1817,7 +1841,7 @@ declare global {
1817
1841
  declare global {
1818
1842
  namespace JSX {
1819
1843
  interface IntrinsicElements {
1820
- 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1844
+ 'gs-date-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1821
1845
  }
1822
1846
  }
1823
1847
  }
@@ -1844,10 +1868,10 @@ declare global {
1844
1868
 
1845
1869
  declare global {
1846
1870
  interface HTMLElementTagNameMap {
1847
- 'gs-mutation-filter': MutationFilterComponent;
1871
+ 'gs-location-filter': LocationFilterComponent;
1848
1872
  }
1849
1873
  interface HTMLElementEventMap {
1850
- [gsEventNames.mutationFilterChanged]: CustomEvent<MutationsFilter>;
1874
+ [gsEventNames.locationChanged]: LocationChangedEvent;
1851
1875
  }
1852
1876
  }
1853
1877
 
@@ -1855,7 +1879,7 @@ declare global {
1855
1879
  declare global {
1856
1880
  namespace JSX {
1857
1881
  interface IntrinsicElements {
1858
- 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1882
+ 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1859
1883
  }
1860
1884
  }
1861
1885
  }
@@ -1863,10 +1887,10 @@ declare global {
1863
1887
 
1864
1888
  declare global {
1865
1889
  interface HTMLElementTagNameMap {
1866
- 'gs-lineage-filter': LineageFilterComponent;
1890
+ 'gs-mutation-filter': MutationFilterComponent;
1867
1891
  }
1868
1892
  interface HTMLElementEventMap {
1869
- [gsEventNames.lineageFilterChanged]: LineageFilterChangedEvent;
1893
+ [gsEventNames.mutationFilterChanged]: CustomEvent<MutationsFilter>;
1870
1894
  }
1871
1895
  }
1872
1896
 
@@ -1874,7 +1898,7 @@ declare global {
1874
1898
  declare global {
1875
1899
  namespace JSX {
1876
1900
  interface IntrinsicElements {
1877
- 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1901
+ 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1878
1902
  }
1879
1903
  }
1880
1904
  }
@@ -1882,11 +1906,10 @@ declare global {
1882
1906
 
1883
1907
  declare global {
1884
1908
  interface HTMLElementTagNameMap {
1885
- 'gs-number-range-filter': NumberRangeFilterComponent;
1909
+ 'gs-lineage-filter': LineageFilterComponent;
1886
1910
  }
1887
1911
  interface HTMLElementEventMap {
1888
- [gsEventNames.numberRangeFilterChanged]: NumberRangeFilterChangedEvent;
1889
- [gsEventNames.numberRangeValueChanged]: NumberRangeValueChangedEvent;
1912
+ [gsEventNames.lineageFilterChanged]: LineageFilterChangedEvent;
1890
1913
  }
1891
1914
  }
1892
1915
 
@@ -1894,7 +1917,7 @@ declare global {
1894
1917
  declare global {
1895
1918
  namespace JSX {
1896
1919
  interface IntrinsicElements {
1897
- 'gs-number-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1920
+ 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1898
1921
  }
1899
1922
  }
1900
1923
  }
@@ -1902,7 +1925,11 @@ declare global {
1902
1925
 
1903
1926
  declare global {
1904
1927
  interface HTMLElementTagNameMap {
1905
- 'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
1928
+ 'gs-number-range-filter': NumberRangeFilterComponent;
1929
+ }
1930
+ interface HTMLElementEventMap {
1931
+ [gsEventNames.numberRangeFilterChanged]: NumberRangeFilterChangedEvent;
1932
+ [gsEventNames.numberRangeValueChanged]: NumberRangeValueChangedEvent;
1906
1933
  }
1907
1934
  }
1908
1935
 
@@ -1910,7 +1937,7 @@ declare global {
1910
1937
  declare global {
1911
1938
  namespace JSX {
1912
1939
  interface IntrinsicElements {
1913
- 'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1940
+ 'gs-number-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1914
1941
  }
1915
1942
  }
1916
1943
  }