@ts4nfdi/terminology-service-suite 6.11.2 → 6.12.1
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/README.md +6 -3
- package/dist/api/ols/OlsEntityApi.d.ts +4 -0
- package/dist/api/ols/OlsSearchApi.d.ts +2 -0
- package/dist/app/types.d.ts +16 -1
- package/dist/app/widgetDescriptions.d.ts +1 -0
- package/dist/components/widgets/EntityListWidget/EntityListWidget.d.ts +5 -0
- package/dist/components/widgets/EntityListWidget/EntityListWidget.stories.d.ts +6 -0
- package/dist/components/widgets/EntityListWidget/EntityListWidgetStories.d.ts +45 -0
- package/dist/components/widgets/EntityListWidget/Utils/searchUtils.d.ts +31 -0
- package/dist/components/widgets/EntityListWidget/index.d.ts +1 -0
- package/dist/components/widgets/MetadataWidget/EntityDefinedByWidget/EntityDefinedByWidget.stories.d.ts +2 -2
- package/dist/components/widgets/MetadataWidget/EntityDefinedByWidget/EntityDefinedByWidgetStories.d.ts +8 -8
- package/dist/components/widgets/MetadataWidget/EntityOntoListWidget/EntityOntoListWidget.stories.d.ts +2 -2
- package/dist/components/widgets/MetadataWidget/EntityOntoListWidget/EntityOntoListWidgetStories.d.ts +9 -9
- package/dist/components/widgets/MetadataWidget/MetadataWidget.stories.d.ts +15 -0
- package/dist/components/widgets/MetadataWidget/TabWidget/HierarchyWidget/HierarchyWidgetStories.d.ts +3 -3
- package/dist/components/widgets/OntologyInfoWidget/OntologyInfoWidget.stories.d.ts +2 -0
- package/dist/components/widgets/OntologyInfoWidget/OntologyInfoWidgetStories.d.ts +12 -0
- package/dist/components/widgets/index.d.ts +1 -0
- package/dist/esm/index.es.js +3285 -2897
- package/dist/esm/index.es.js.map +1 -1
- package/dist/esm/terminology-service-suite.css +1 -1
- package/dist/model/ModelTypeCheck.d.ts +1 -0
- package/dist/model/ts4nfdi-model/Ts4nfdiSearchResult.d.ts +1 -0
- package/dist/server/index.es.js +6 -3
- package/dist/server/index.es.js.map +1 -1
- package/package.json +3 -5
- package/dist/components/widgets/MetadataWidget/BreadcrumbWidget/BreadcrumbPresentation/BreadcrumbPresentation.stories.d.ts +0 -55
- package/dist/components/widgets/MetadataWidget/BreadcrumbWidget/BreadcrumbPresentation/BreadcrumbPresentationStories.d.ts +0 -66
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ npm install @ts4nfdi/terminology-service-suite
|
|
|
19
19
|
2. Install peer dependencies
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
npm install @elastic/eui@
|
|
22
|
+
npm install @elastic/eui@113.3.0 @elastic/eui-theme-borealis @emotion/react @emotion/css moment @elastic/datemath react@18.3 react-dom@18.3 react-query@3.39.2 axios@1.1.2
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
3. In the 'Docs' tab of the widgets in the React Storybook, a code snippet is provided in the `Show code` drop-down below the sample widget. Copy the snippet, add into your app and replace with your parameters. See example below:
|
|
@@ -47,10 +47,13 @@ const queryClient = new QueryClient();
|
|
|
47
47
|
</QueryClientProvider>
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
### If you encounter any installation or integration errors, please open an issue to let us know!
|
|
51
|
+
|
|
50
52
|
## Hints:
|
|
51
53
|
|
|
52
|
-
-
|
|
53
|
-
- We can provide server functions at user request, e.g. `getBreadcrumbData()` to allow server side data fetching. [Pull request](https://github.com/ts4nfdi/terminology-service-suite/pull/269)
|
|
54
|
+
- **Vite:** There is an [Elastic UI issue](https://github.com/elastic/eui/issues/5463) using Vite and EUI versions <113.0.0. We recommend using TSS versions >6.12.0 and EUI versions >113.0.0. For TSS versions >6.0.0 and <6.12.0 we integrated a [workaround](https://github.com/ts4nfdi/terminology-service-suite/wiki/Why-patch%E2%80%90package-and-the-prepare-script%3F).
|
|
55
|
+
- **Next.js:** The TSS is a client library - in a Next.js app, the 'use client'-directive is needed. We can provide server functions at user request, e.g. `getBreadcrumbData()` to allow server side data fetching. [Pull request](https://github.com/ts4nfdi/terminology-service-suite/pull/269)
|
|
56
|
+
- **Next.js:** In Next.js apps, it may be necessary to explicitly import widget stylesheets. We tested this in a Next.js app and found that missing stylesheet imports can cause UI issues. The styles are available in [`packages/react/src/style/ts4nfdiStyles`](https://github.com/ts4nfdi/terminology-service-suite/tree/main/packages/react/src/style/ts4nfdiStyles). Copy the relevant stylesheet for the widget you use into your project and import it there. For example, when using `SearchResultsListWidget`, you may need to add and import `SearchResultStyle.css`.
|
|
54
57
|
|
|
55
58
|
# Usage of older versions
|
|
56
59
|
|
|
@@ -80,3 +80,7 @@ export declare class OlsEntityApi extends OlsBaseApi {
|
|
|
80
80
|
*/
|
|
81
81
|
getTermTree: (contentParams: ContentParams, treeParams: JsTreeParams, parameter?: string) => Promise<any>;
|
|
82
82
|
}
|
|
83
|
+
export declare function getEntitiesWithEntityTypeProvided(entityApi: OlsEntityApi, entityType: EntityTypeName, ontologyId?: string, parameter?: string, useLegacy?: boolean, paginationParams?: {
|
|
84
|
+
page: string;
|
|
85
|
+
size: string;
|
|
86
|
+
}, signal?: AbortSignal): Promise<any>;
|
|
@@ -15,3 +15,5 @@ export declare class OlsSearchApi extends OlsBaseApi {
|
|
|
15
15
|
getSelectData(queryParams: SelectQueryParams, paginationParams?: PaginationParams, contentParams?: ContentParams, parameter?: string, ts4nfdiGateway?: boolean): Promise<Select>;
|
|
16
16
|
suggest: (queryParams: SuggestQueryParams, paginationParams?: PaginationParams, contentParams?: ContentParams, parameter?: string) => Promise<any>;
|
|
17
17
|
}
|
|
18
|
+
export declare function splitAndApplyParams(url: URL, raw: string): void;
|
|
19
|
+
export declare function normalizeBaseApi(api: string): string;
|
package/dist/app/types.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Action } from '@elastic/eui/src/components/basic_table/action_types';
|
|
|
3
3
|
import { EuiComboBoxProps } from '@elastic/eui/src/components/combo_box/combo_box';
|
|
4
4
|
import { EuiLinkColor } from '@elastic/eui/src/components/link/link';
|
|
5
5
|
import { EuiTextProps } from '@elastic/eui/src/components/text/text';
|
|
6
|
+
import { OlsEntityApi } from '../api/ols/OlsEntityApi';
|
|
7
|
+
import { OlsOntologyApi } from '../api/ols/OlsOntologyApi';
|
|
6
8
|
import { Thing } from '../model/interfaces';
|
|
7
9
|
import { BuildHierarchyProps, HierarchyIriProp } from '../model/interfaces/HierarchyBuilder';
|
|
8
10
|
import { EntityTypeName, ThingTypeName } from '../model/ModelTypeCheck';
|
|
@@ -612,7 +614,7 @@ export type GraphViewWidgetProps = ApiObj & ForcedIriObj & ForcedOntologyIdObj &
|
|
|
612
614
|
*/
|
|
613
615
|
edgeLabel?: string;
|
|
614
616
|
/**
|
|
615
|
-
* Callback function for double
|
|
617
|
+
* Callback function for double-clicking on a node in graph. The default behaviour is to expand the node.
|
|
616
618
|
* */
|
|
617
619
|
onNodeClick?: (iri: string) => void;
|
|
618
620
|
/**
|
|
@@ -623,6 +625,10 @@ export type GraphViewWidgetProps = ApiObj & ForcedIriObj & ForcedOntologyIdObj &
|
|
|
623
625
|
* Hide the graph legend. Default is false/undefined
|
|
624
626
|
*/
|
|
625
627
|
hideLegend?: boolean;
|
|
628
|
+
/**
|
|
629
|
+
* This function is called if navigation should be handled externally.
|
|
630
|
+
*/
|
|
631
|
+
onNavigateTo?: (target: string) => void;
|
|
626
632
|
};
|
|
627
633
|
export type OlsGraphNode = {
|
|
628
634
|
/**
|
|
@@ -647,4 +653,13 @@ export type ComparisonInputProps = {
|
|
|
647
653
|
initialTargetIri?: string;
|
|
648
654
|
className?: string;
|
|
649
655
|
};
|
|
656
|
+
export type EntityListWidgetProps = {
|
|
657
|
+
api: {
|
|
658
|
+
entityApi: OlsEntityApi;
|
|
659
|
+
ontologyApi: OlsOntologyApi;
|
|
660
|
+
};
|
|
661
|
+
ontologyId: string;
|
|
662
|
+
entityType: EntityTypeName;
|
|
663
|
+
parameter?: string;
|
|
664
|
+
};
|
|
650
665
|
export {};
|
|
@@ -21,3 +21,4 @@ export declare const ResourcesDescription: string;
|
|
|
21
21
|
export declare const SearchBarDescription: string;
|
|
22
22
|
export declare const SearchResultsListDescription: string;
|
|
23
23
|
export declare const TermDepictionDescription: string;
|
|
24
|
+
export declare const EntityListDescription: string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EntityListWidgetProps } from '../../../app';
|
|
2
|
+
declare function EntityListWidget(props: EntityListWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function WrappedEntityListWidget(props: EntityListWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { EntityListWidget };
|
|
5
|
+
export default WrappedEntityListWidget;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const EntityListWidgetStoryArgTypes: {
|
|
2
|
+
entityType: {
|
|
3
|
+
required: boolean;
|
|
4
|
+
description: string;
|
|
5
|
+
control: {
|
|
6
|
+
readonly type: "radio";
|
|
7
|
+
};
|
|
8
|
+
table: {
|
|
9
|
+
type: {
|
|
10
|
+
summary: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
options: string[];
|
|
14
|
+
};
|
|
15
|
+
ontologyId: {
|
|
16
|
+
required: boolean;
|
|
17
|
+
description: string;
|
|
18
|
+
table: {
|
|
19
|
+
defaultValue: {
|
|
20
|
+
summary: string;
|
|
21
|
+
};
|
|
22
|
+
type: {
|
|
23
|
+
summary: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const EntityListWidgetStoryArgs: {
|
|
29
|
+
readonly api: "https://www.ebi.ac.uk/ols4/api/";
|
|
30
|
+
readonly ontologyId: "uberon";
|
|
31
|
+
readonly entityType: "class";
|
|
32
|
+
readonly parameter: "";
|
|
33
|
+
};
|
|
34
|
+
export declare const EntityListWidgetIndividualsArgs: {
|
|
35
|
+
readonly api: "https://www.ebi.ac.uk/ols4/api/";
|
|
36
|
+
readonly ontologyId: "iao";
|
|
37
|
+
readonly entityType: "individual";
|
|
38
|
+
readonly parameter: "";
|
|
39
|
+
};
|
|
40
|
+
export declare const EntityListWidgetMeshTermsArgs: {
|
|
41
|
+
readonly api: "https://semanticlookup.zbmed.de/ols/api/";
|
|
42
|
+
readonly ontologyId: "mesh";
|
|
43
|
+
readonly entityType: "term";
|
|
44
|
+
readonly parameter: "";
|
|
45
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape Solr special characters in a search token before building a query
|
|
3
|
+
*/
|
|
4
|
+
export declare function escapeSolrSpecialChars(input: string): string;
|
|
5
|
+
export declare function normalizeSearchText(raw: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Build a Solr prefix query from the normalized search text
|
|
8
|
+
*
|
|
9
|
+
* Each token is escaped before it is added to the query.
|
|
10
|
+
* Tokens with at least two characters are converted to prefix matches.
|
|
11
|
+
* Multiple tokens are joined with AND.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildSolrPrefixQuery(raw: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Compare two values as case-insensitive strings with numeric-aware ordering
|
|
16
|
+
*
|
|
17
|
+
* heart = Heart = HEART = HeaRt =...
|
|
18
|
+
*/
|
|
19
|
+
export declare function compareValues(a: unknown, b: unknown): number;
|
|
20
|
+
/**
|
|
21
|
+
* Return the preferred identifier from a search result document
|
|
22
|
+
* The identifier is selected from the first available field in the fallback chain.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getPreferredIdFromSearchDoc(d: any): string;
|
|
25
|
+
/**
|
|
26
|
+
* Return the preferred display label from a search result document
|
|
27
|
+
*
|
|
28
|
+
* The label is selected from the first available field in the fallback chain.
|
|
29
|
+
* If the selected value is an array, the first item is used.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getPreferredLabelFromSearchDoc(d: any): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EntityListWidget, WrappedEntityListWidget } from './EntityListWidget';
|
|
@@ -54,6 +54,6 @@ declare const meta: {
|
|
|
54
54
|
};
|
|
55
55
|
export default meta;
|
|
56
56
|
type Story = StoryObj<typeof meta>;
|
|
57
|
-
export declare const
|
|
58
|
-
export declare const v2ApiONS: Story;
|
|
57
|
+
export declare const v2ApiFOODON: Story;
|
|
59
58
|
export declare const legacyApi: Story;
|
|
59
|
+
export declare const emptyInDefiningOntology: Story;
|
|
@@ -35,21 +35,21 @@ export declare const EntityDefinedByWidgetStoryArgs: {
|
|
|
35
35
|
readonly onNavigateToOntology: "Console message";
|
|
36
36
|
};
|
|
37
37
|
export declare const emptyInDefiningOntologyArgs: {
|
|
38
|
-
readonly iri: "http://
|
|
38
|
+
readonly iri: "http://purl.obolibrary.org/obo/MONDO_0005015";
|
|
39
39
|
readonly api: "https://www.ebi.ac.uk/ols4/api/";
|
|
40
40
|
readonly entityType: "term";
|
|
41
41
|
readonly ontologyId: "efo";
|
|
42
42
|
};
|
|
43
|
-
export declare const
|
|
44
|
-
readonly iri: "http://
|
|
45
|
-
readonly api: "https://
|
|
46
|
-
readonly ontologyId: "
|
|
43
|
+
export declare const v2ApiFOODONArgs: {
|
|
44
|
+
readonly iri: "http://purl.obolibrary.org/obo/NCBITaxon_10090";
|
|
45
|
+
readonly api: "https://semanticlookup.zbmed.de/ols/api/";
|
|
46
|
+
readonly ontologyId: "foodon";
|
|
47
47
|
};
|
|
48
48
|
export declare const legacyApiArgs: {
|
|
49
|
-
readonly iri: "http://
|
|
50
|
-
readonly api: "https://
|
|
49
|
+
readonly iri: "http://purl.obolibrary.org/obo/NCBITaxon_10090";
|
|
50
|
+
readonly api: "https://semanticlookup.zbmed.de/ols/api/";
|
|
51
51
|
readonly entityType: "term";
|
|
52
|
-
readonly ontologyId: "
|
|
52
|
+
readonly ontologyId: "foodon";
|
|
53
53
|
readonly useLegacy: true;
|
|
54
54
|
};
|
|
55
55
|
export declare const commonEntityDefinedByWidgetPlay: ({ canvasElement, }: {
|
|
@@ -54,7 +54,7 @@ declare const meta: {
|
|
|
54
54
|
};
|
|
55
55
|
export default meta;
|
|
56
56
|
type Story = StoryObj<typeof meta>;
|
|
57
|
-
export declare const
|
|
58
|
-
export declare const
|
|
57
|
+
export declare const v2ApiNCBITaxon: Story;
|
|
58
|
+
export declare const v2ApiFOODON: Story;
|
|
59
59
|
export declare const legacyApi: Story;
|
|
60
60
|
export declare const exceedsMaxDisplay: Story;
|
package/dist/components/widgets/MetadataWidget/EntityOntoListWidget/EntityOntoListWidgetStories.d.ts
CHANGED
|
@@ -34,19 +34,19 @@ export declare const EntityOntoListWidgetStoryArgs: {
|
|
|
34
34
|
readonly parameter: "";
|
|
35
35
|
readonly onNavigateToOntology: "Console message";
|
|
36
36
|
};
|
|
37
|
-
export declare const
|
|
38
|
-
readonly iri: "http://
|
|
39
|
-
readonly api: "https://
|
|
37
|
+
export declare const v2ApiNCBITaxonArgs: {
|
|
38
|
+
readonly iri: "http://purl.obolibrary.org/obo/NCBITaxon_10090";
|
|
39
|
+
readonly api: "https://semanticlookup.zbmed.de/ols/api/";
|
|
40
40
|
readonly entityType: "term";
|
|
41
|
-
readonly ontologyId: "
|
|
41
|
+
readonly ontologyId: "ncbitaxon";
|
|
42
42
|
};
|
|
43
|
-
export declare const
|
|
44
|
-
readonly iri: "http://
|
|
45
|
-
readonly api: "https://
|
|
46
|
-
readonly ontologyId: "
|
|
43
|
+
export declare const v2ApiFOODONArgs: {
|
|
44
|
+
readonly iri: "http://purl.obolibrary.org/obo/NCBITaxon_10090";
|
|
45
|
+
readonly api: "https://semanticlookup.zbmed.de/ols/api/";
|
|
46
|
+
readonly ontologyId: "foodon";
|
|
47
47
|
};
|
|
48
48
|
export declare const legacyApiArgs: {
|
|
49
|
-
readonly iri: "http://
|
|
49
|
+
readonly iri: "http://purl.obolibrary.org/obo/MONDO_0005015";
|
|
50
50
|
readonly api: "https://www.ebi.ac.uk/ols4/api/";
|
|
51
51
|
readonly entityType: "term";
|
|
52
52
|
readonly ontologyId: "efo";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { MetadataWidget } from './MetadataWidget';
|
|
3
|
+
declare const meta: Meta<typeof MetadataWidget>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const MetadataWidget1: Story;
|
|
7
|
+
export declare const OLS3: Story;
|
|
8
|
+
export declare const OLS4V1: Story;
|
|
9
|
+
export declare const OLS4V2: Story;
|
|
10
|
+
export declare const SelectingDefiningOntology: Story;
|
|
11
|
+
export declare const DefiningOntologyUnavailable: Story;
|
|
12
|
+
export declare const DefinedByAlsoAppearsInWidgets: Story;
|
|
13
|
+
export declare const HiddenTabs: Story;
|
|
14
|
+
export declare const TermAsLink: Story;
|
|
15
|
+
export declare const ShowComparisonInputField: Story;
|
package/dist/components/widgets/MetadataWidget/TabWidget/HierarchyWidget/HierarchyWidgetStories.d.ts
CHANGED
|
@@ -161,7 +161,7 @@ export declare const HierarchyWidgetStoryArgs: {
|
|
|
161
161
|
export declare const ClassHierarchyArgs: {
|
|
162
162
|
readonly apiUrl: "https://www.ebi.ac.uk/ols4/api/";
|
|
163
163
|
readonly backendType: "ols";
|
|
164
|
-
readonly iri: "http://
|
|
164
|
+
readonly iri: "http://purl.obolibrary.org/obo/MONDO_0005015";
|
|
165
165
|
readonly entityType: "class";
|
|
166
166
|
readonly ontologyId: "efo";
|
|
167
167
|
readonly apiKey: "";
|
|
@@ -361,9 +361,9 @@ export declare const OntoportalHierarchyArgs: {
|
|
|
361
361
|
export declare const OLS3HierarchyArgs: {
|
|
362
362
|
readonly apiUrl: "https://ols3-semanticlookup.zbmed.de/ols/api/";
|
|
363
363
|
readonly backendType: "ols";
|
|
364
|
-
readonly iri: "http://
|
|
364
|
+
readonly iri: "http://purl.obolibrary.org/obo/NCIT_C2984";
|
|
365
365
|
readonly entityType: "class";
|
|
366
|
-
readonly ontologyId: "
|
|
366
|
+
readonly ontologyId: "ncit";
|
|
367
367
|
readonly useLegacy: true;
|
|
368
368
|
readonly apiKey: "";
|
|
369
369
|
readonly onNavigateToEntity: "Console message";
|
|
@@ -36,3 +36,5 @@ export declare const OntologyInfoWidget1: Story;
|
|
|
36
36
|
export declare const OntologyInfoWidget2: Story;
|
|
37
37
|
export declare const OntologyInfoWidgetOLS4API: Story;
|
|
38
38
|
export declare const NavigateToEBIPage: Story;
|
|
39
|
+
export declare const OntologyInfoUberon: Story;
|
|
40
|
+
export declare const OntologyInfoOhdab: Story;
|
|
@@ -33,6 +33,18 @@ export declare const NavigateToEBIPageArgs: {
|
|
|
33
33
|
onNavigateToOntology: string;
|
|
34
34
|
onNavigateToDisambiguate: string;
|
|
35
35
|
};
|
|
36
|
+
export declare const OntologyInfoWidgetUberon: {
|
|
37
|
+
api: string;
|
|
38
|
+
useLegacy: boolean;
|
|
39
|
+
ontologyId: string;
|
|
40
|
+
hasTitle: boolean;
|
|
41
|
+
showBadges: boolean;
|
|
42
|
+
};
|
|
43
|
+
export declare const OntologyInfoWidgetOhdab: {
|
|
44
|
+
api: string;
|
|
45
|
+
useLegacy: boolean;
|
|
46
|
+
ontologyId: string;
|
|
47
|
+
};
|
|
36
48
|
export declare const commonOntologyInfoWidgetPlay: ({ canvasElement, }: {
|
|
37
49
|
canvasElement: HTMLElement;
|
|
38
50
|
}) => Promise<void>;
|