@ts4nfdi/terminology-service-suite 6.11.2 → 6.12.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.
- package/README.md +1 -0
- 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 +1 -1
- package/dist/components/widgets/MetadataWidget/MetadataWidgetStories.d.ts +1 -1
- 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 +3289 -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/server/index.es.js +6 -3
- package/dist/server/index.es.js.map +1 -1
- package/package.json +1 -1
- 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
|
@@ -51,6 +51,7 @@ const queryClient = new QueryClient();
|
|
|
51
51
|
|
|
52
52
|
- The TSS is a client library - in a Next.js app, the 'use client'-directive is needed
|
|
53
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
|
+
- 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
55
|
|
|
55
56
|
# Usage of older versions
|
|
56
57
|
|
|
@@ -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: "efo";
|
|
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 emptyInDefiningOntology: Story;
|
|
58
57
|
export declare const v2ApiONS: Story;
|
|
59
58
|
export declare const legacyApi: Story;
|
|
59
|
+
export declare const emptyInDefiningOntology: Story;
|
|
@@ -85,9 +85,9 @@ export declare const MetadataWidgetStoryArgs: {
|
|
|
85
85
|
readonly onNavigateToOntology: "Console message";
|
|
86
86
|
readonly onNavigateToDisambiguate: "Console message";
|
|
87
87
|
readonly hierarchyWrap: false;
|
|
88
|
+
readonly className: "ts4nfdi-metadata-style";
|
|
88
89
|
readonly parameter: "";
|
|
89
90
|
readonly showHeader: true;
|
|
90
|
-
readonly className: "ts4nfdi-metadata-style";
|
|
91
91
|
};
|
|
92
92
|
export declare const MetadataWidget1Args: {
|
|
93
93
|
readonly api: "https://semanticlookup.zbmed.de/ols/api/";
|
|
@@ -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>;
|