@ts4nfdi/terminology-service-suite 7.4.1 → 7.4.3

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.
@@ -701,6 +701,13 @@ export type EntityProviderWidgetProps = ForcedIriObj & OptionalOntologyIdObj & {
701
701
  * OLS endpoint, as the provider information is specific to the gateway.
702
702
  */
703
703
  api?: string;
704
+ /**
705
+ * Additional parameters in URL format, e.g.
706
+ * `collectionId=dc45621d-7e40-47ce-9616-4133f0b54edf`, passed on to the
707
+ * API. With a `collectionId`, the TS4NFDI API Gateway only returns
708
+ * providers of the terminologies configured in that collection.
709
+ */
710
+ parameter?: string;
704
711
  /**
705
712
  * If false, no request is made and the result stays empty. Useful to defer
706
713
  * fetching until an IRI is known. Default is true.
@@ -31,6 +31,12 @@ export declare function getFrontEndApi(api: string): string;
31
31
  */
32
32
  export declare function getEntityInOntologySuffix(ontologyId: string, entityTypeArray: string[] | string, iri?: string, useLegacy?: boolean): string;
33
33
  export declare function pluralizeType(typeArray: string[] | string, useLegacy?: boolean): "terms" | "classes" | "properties" | "individuals" | "ontologies";
34
+ /**
35
+ * Like {@link pluralizeType}, but returns undefined instead of throwing if no thingType
36
+ * is contained in {@link typeArray}. Use in render paths, where a throw would unmount the
37
+ * whole React tree.
38
+ */
39
+ export declare function tryPluralizeType(typeArray: string[] | string, useLegacy?: boolean): "terms" | "classes" | "properties" | "individuals" | "ontologies" | undefined;
34
40
  export declare function singularizeType(typeArray: string[] | string, useLegacy?: boolean): ThingTypeName;
35
41
  /**
36
42
  * Returns a random string used mainly for component keys.
@@ -42,6 +48,11 @@ export declare function isEuiLinkColor(str: string): str is EuiLinkColor;
42
48
  export declare function withAlpha(color: string, alpha: number): string;
43
49
  export declare function isEuiButtonColor(str: string): str is EuiLinkColor;
44
50
  export declare function getErrorMessageToDisplay(error: any, messagePlaceholder?: string): string;
45
- export declare function inferTypeFromTypeArray(types: string[]): "class" | "term" | "individual" | "property" | "annotationProperty" | "dataProperty" | "objectProperty" | "ontology";
51
+ export declare function inferTypeFromTypeArray(types: string[]): "class" | "term" | "skos:Concept" | "http://www.w3.org/2004/02/skos/core#Concept" | "individual" | "property" | "annotationProperty" | "dataProperty" | "objectProperty" | "ontology";
52
+ /**
53
+ * Like {@link inferTypeFromTypeArray}, but returns undefined instead of throwing if the type
54
+ * cannot be inferred. Use in render paths, where a throw would unmount the whole React tree.
55
+ */
56
+ export declare function tryInferTypeFromTypeArray(types: string[]): ThingTypeName | undefined;
46
57
  export declare function manuallyEmbedOnNavigate(code: string, storyContext: StoryContext): string;
47
58
  export declare function dictFromParamString(parameter?: string): any;
@@ -0,0 +1,27 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ type ErrorBoundaryProps = {
3
+ children?: ReactNode;
4
+ /**
5
+ * Rendered instead of {@link children} if rendering them threw. If omitted, a neutral
6
+ * message is displayed.
7
+ */
8
+ fallback?: ReactNode | ((error: Error) => ReactNode);
9
+ };
10
+ type ErrorBoundaryState = {
11
+ error?: Error;
12
+ };
13
+ /**
14
+ * Catches errors thrown while rendering {@link ErrorBoundaryProps.children} and renders
15
+ * {@link ErrorBoundaryProps.fallback} instead, so a single broken subtree does not unmount
16
+ * the whole application.
17
+ *
18
+ * The boundary keeps showing the fallback until it is remounted. Pass a `key` that changes
19
+ * with the rendered content (e.g. the entities' iri) to reset it.
20
+ */
21
+ export default class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
22
+ constructor(props: ErrorBoundaryProps);
23
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
24
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
25
+ render(): ReactNode;
26
+ }
27
+ export {};
@@ -18,7 +18,19 @@ declare const meta: {
18
18
  };
19
19
  };
20
20
  argTypes: {
21
- api: any;
21
+ api: {
22
+ api: string;
23
+ required: boolean;
24
+ description: string;
25
+ table: {
26
+ defaultValue: {
27
+ summary: string;
28
+ };
29
+ type: {
30
+ summary: string;
31
+ };
32
+ };
33
+ };
22
34
  enabled: {
23
35
  required: boolean;
24
36
  description: string;
@@ -34,6 +46,15 @@ declare const meta: {
34
46
  };
35
47
  };
36
48
  };
49
+ parameter: {
50
+ required: boolean;
51
+ description: string;
52
+ table: {
53
+ type: {
54
+ summary: string;
55
+ };
56
+ };
57
+ };
37
58
  ontologyId: {
38
59
  required: boolean;
39
60
  description: string;
@@ -52,6 +73,7 @@ declare const meta: {
52
73
  readonly iri: "";
53
74
  readonly ontologyId: "";
54
75
  readonly enabled: true;
76
+ readonly parameter: "";
55
77
  };
56
78
  };
57
79
  export default meta;
@@ -1,5 +1,17 @@
1
1
  export declare const EntityProviderWidgetStoryArgTypes: {
2
- api: any;
2
+ api: {
3
+ api: string;
4
+ required: boolean;
5
+ description: string;
6
+ table: {
7
+ defaultValue: {
8
+ summary: string;
9
+ };
10
+ type: {
11
+ summary: string;
12
+ };
13
+ };
14
+ };
3
15
  enabled: {
4
16
  required: boolean;
5
17
  description: string;
@@ -15,6 +27,15 @@ export declare const EntityProviderWidgetStoryArgTypes: {
15
27
  };
16
28
  };
17
29
  };
30
+ parameter: {
31
+ required: boolean;
32
+ description: string;
33
+ table: {
34
+ type: {
35
+ summary: string;
36
+ };
37
+ };
38
+ };
18
39
  ontologyId: {
19
40
  required: boolean;
20
41
  description: string;
@@ -33,6 +54,7 @@ export declare const EntityProviderWidgetStoryArgs: {
33
54
  readonly iri: "";
34
55
  readonly ontologyId: "";
35
56
  readonly enabled: true;
57
+ readonly parameter: "";
36
58
  };
37
59
  /**
38
60
  * An entity that resolves in voc4cat via the TS4NFDI API Gateway. At the time of writing
@@ -42,8 +64,9 @@ export declare const EntityProviderWidgetStoryArgs: {
42
64
  */
43
65
  export declare const withOntologyIdArgs: {
44
66
  readonly api: "https://terminology.services.base4nfdi.de/api-gateway/ols4/api/";
45
- readonly ontologyId: "voc4cat";
46
- readonly iri: "https://w3id.org/nfdi4cat/voc4cat_0000151";
67
+ readonly ontologyId: "agrovoc";
68
+ readonly iri: "http://aims.fao.org/aos/agrovoc/c_12332";
69
+ readonly parameter: "collectionId=ff5491d1-d0a9-481e-ac90-0fad065fa097";
47
70
  };
48
71
  /**
49
72
  * An IRI that does not exist in the requested ontology. The API answers with an
@@ -30,7 +30,8 @@ export default meta;
30
30
  type Story = StoryObj<typeof meta>;
31
31
  export declare const Default: Story;
32
32
  export declare const ApiGateway: Story;
33
- export declare const ApiGatewayWithCollection: Story;
33
+ export declare const ApiGatewayWithFAIRAgroCollection: Story;
34
+ export declare const ApiGatewayWithNFDI4HealthCollection: Story;
34
35
  export declare const NavigateToSearchResult: Story;
35
36
  export declare const NFDI4Health: Story;
36
37
  export declare const TibNFDI4CHEM: Story;
@@ -26,7 +26,14 @@ export declare const ApiGatewayArgs: {
26
26
  targetLink: string;
27
27
  useLegacy: boolean;
28
28
  };
29
- export declare const ApiGatewayWithCollectionArgs: {
29
+ export declare const ApiGatewayWithFAIRAgroCollectionArgs: {
30
+ api: string;
31
+ query: string;
32
+ targetLink: string;
33
+ parameter: string;
34
+ useLegacy: boolean;
35
+ };
36
+ export declare const ApiGatewayWithNFDI4HealthCollectionArgs: {
30
37
  api: string;
31
38
  query: string;
32
39
  targetLink: string;