@ts4nfdi/terminology-service-suite 7.4.2 → 7.5.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.
@@ -659,6 +659,14 @@ export type EntityListWidgetProps = {
659
659
  export type MappingListWidgetProps = {
660
660
  api: string;
661
661
  source: string;
662
+ rowColor?: string;
663
+ MappingDetailBackgroundColor?: string;
664
+ };
665
+ export type MappingDetailWidgetProps = {
666
+ api: string;
667
+ source: string;
668
+ target: string;
669
+ MappingDetailBackgroundColor?: string;
662
670
  };
663
671
  /**
664
672
  * Information about the terminology backend that actually served an entity.
@@ -701,6 +709,13 @@ export type EntityProviderWidgetProps = ForcedIriObj & OptionalOntologyIdObj & {
701
709
  * OLS endpoint, as the provider information is specific to the gateway.
702
710
  */
703
711
  api?: string;
712
+ /**
713
+ * Additional parameters in URL format, e.g.
714
+ * `collectionId=dc45621d-7e40-47ce-9616-4133f0b54edf`, passed on to the
715
+ * API. With a `collectionId`, the TS4NFDI API Gateway only returns
716
+ * providers of the terminologies configured in that collection.
717
+ */
718
+ parameter?: string;
704
719
  /**
705
720
  * If false, no request is made and the result stays empty. Useful to defer
706
721
  * fetching until an IRI is known. Default is true.
@@ -48,7 +48,7 @@ export declare function isEuiLinkColor(str: string): str is EuiLinkColor;
48
48
  export declare function withAlpha(color: string, alpha: number): string;
49
49
  export declare function isEuiButtonColor(str: string): str is EuiLinkColor;
50
50
  export declare function getErrorMessageToDisplay(error: any, messagePlaceholder?: string): string;
51
- export declare function inferTypeFromTypeArray(types: string[]): "class" | "term" | "skos:Concept" | "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
52
  /**
53
53
  * Like {@link inferTypeFromTypeArray}, but returns undefined instead of throwing if the type
54
54
  * cannot be inferred. Use in render paths, where a throw would unmount the whole React tree.
@@ -24,4 +24,5 @@ export declare const SearchResultsListDescription: string;
24
24
  export declare const TermDepictionDescription: string;
25
25
  export declare const EntityListDescription: string;
26
26
  export declare const MappingListDetailDescription: string;
27
+ export declare const MappingDetailDescription: string;
27
28
  export declare const EntityProviderDescription: string;
@@ -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
@@ -0,0 +1,35 @@
1
+ /**
2
+ * One mapping, flattened to the strings the card shows and downloads.
3
+ * MappingDetailWidget builds it from what it fetches, MappingListWidget from
4
+ * the row the user expanded.
5
+ */
6
+ export type MappingDetail = {
7
+ type?: string;
8
+ from?: string;
9
+ fromUri?: string;
10
+ fromScheme?: string;
11
+ to?: string;
12
+ toUri?: string;
13
+ toScheme?: string;
14
+ creator?: string;
15
+ created?: string;
16
+ modified?: string;
17
+ identifier?: string;
18
+ partOf?: string;
19
+ uri?: string;
20
+ };
21
+ type MappingDetailPresentationProps = {
22
+ mapping: MappingDetail;
23
+ MappingDetailBackgroundColor?: string;
24
+ /**
25
+ * Puts a close button in the top corner of the card.
26
+ * MappingListWidget uses it to collapse the row again.
27
+ */
28
+ onClose?: () => void;
29
+ };
30
+ /**
31
+ * The card itself: its fields, downloads and layout. It renders the mapping it
32
+ * is handed and fetches nothing, so both mapping widgets can show it.
33
+ */
34
+ export default function MappingDetailPresentation(props: MappingDetailPresentationProps): import("react").JSX.Element;
35
+ export {};
@@ -0,0 +1,5 @@
1
+ import { MappingDetailWidgetProps } from '../../../app';
2
+ declare function MappingDetailWidget(props: MappingDetailWidgetProps): import("react").JSX.Element;
3
+ export declare function WrappedMappingDetailWidget(props: MappingDetailWidgetProps): import("react").JSX.Element;
4
+ export { MappingDetailWidget };
5
+ export default WrappedMappingDetailWidget;
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj<typeof meta>;
5
+ export declare const Rec_B_2000: Story;
@@ -0,0 +1,13 @@
1
+ export declare const MappingDetailWidgetStoryArgTypes: {
2
+ [x: string]: import('storybook/internal/csf').InputType;
3
+ };
4
+ /**
5
+ * One mapping of the NSK-BK concordance, picked by its source and target. It
6
+ * belongs to a concordance, so every field of the card has a value.
7
+ */
8
+ export declare const MappingDetailWidgetStoryArgs_Rec_B_2000: {
9
+ readonly api: "https://coli-conc.gbv.de/api/";
10
+ readonly source: "http://uri.gbv.de/terminology/nsk/Rec%20B%202000";
11
+ readonly target: "http://uri.gbv.de/terminology/bk/86.26";
12
+ readonly MappingDetailBackgroundColor: "#ebedef";
13
+ };
@@ -0,0 +1,11 @@
1
+ import { MappingDetail } from '../MappingDetailPresentation';
2
+ /**
3
+ * Turns a JSKOS timestamp into "11 May 2026, 12:48", or a dash when it cannot
4
+ * be read. MappingListWidget formats its table dates with it too.
5
+ */
6
+ export declare function formatMappingDate(value?: string): string;
7
+ /**
8
+ * Reads the values the card needs out of one JSKOS mapping, with a dash for
9
+ * whatever the server left out.
10
+ */
11
+ export declare function toMappingDetail(mapping: any): MappingDetail;
@@ -0,0 +1 @@
1
+ export { MappingDetailWidget, WrappedMappingDetailWidget, } from './MappingDetailWidget';
@@ -0,0 +1,50 @@
1
+ import { EuiSearchBarProps } from '@elastic/eui';
2
+ import { Dispatch, SetStateAction } from 'react';
3
+ export type MappingRow = {
4
+ /** Stable id the table uses to track which rows are expanded. */
5
+ id: string;
6
+ from: string;
7
+ fromUri: string;
8
+ to: string;
9
+ toUri: string;
10
+ creator: string;
11
+ type: string;
12
+ created: string;
13
+ createdLabel: string;
14
+ targetFromColiConc: string;
15
+ fromScheme: string;
16
+ toScheme: string;
17
+ identifier: string;
18
+ modified: string;
19
+ uri: string;
20
+ partOf: string;
21
+ };
22
+ type MetadataTarget = {
23
+ iri: string;
24
+ ontologyId: string;
25
+ } | null;
26
+ /** Everything the list shows or changes, passed down by MappingListWidget. */
27
+ type MappingListPresentationProps = {
28
+ fromLabel: string;
29
+ rowColor: string;
30
+ MappingDetailBackgroundColor?: string;
31
+ labels: Record<string, string>;
32
+ filteredRows: MappingRow[];
33
+ search: EuiSearchBarProps;
34
+ expandedRowIds: string[];
35
+ toggleRowExpansion: (row: MappingRow) => void;
36
+ metadataTarget: MetadataTarget;
37
+ setMetadataTarget: Dispatch<SetStateAction<MetadataTarget>>;
38
+ isTypeFilterOpen: boolean;
39
+ setIsTypeFilterOpen: Dispatch<SetStateAction<boolean>>;
40
+ selectedTypeFilters: string[];
41
+ setSelectedTypeFilters: Dispatch<SetStateAction<string[]>>;
42
+ setAppliedTypeFilters: Dispatch<SetStateAction<string[]>>;
43
+ toggleTypeFilter: (type: string) => void;
44
+ isPopoverOpen: boolean;
45
+ onButtonClick: () => void;
46
+ closePopover: () => void;
47
+ };
48
+ /** UI of the mapping list; all state and data come from MappingListWidget. */
49
+ export default function MappingListPresentation(props: MappingListPresentationProps): import("react").JSX.Element;
50
+ export {};
@@ -1,23 +1,35 @@
1
- export declare const MappingListWidgetStoryArgTypes: {};
1
+ export declare const MappingListWidgetStoryArgTypes: {
2
+ [x: string]: import('storybook/internal/csf').InputType;
3
+ };
2
4
  export declare const MappingListWidgetStoryArgs_OEO_00000150: {
3
5
  readonly api: "https://coli-conc.gbv.de/api/";
4
6
  readonly source: "https://openenergyplatform.org/ontology/oeo/OEO_00000150";
7
+ readonly rowColor: "#fff5fa";
8
+ readonly MappingDetailBackgroundColor: "#efebee";
5
9
  };
6
10
  export declare const MappingListWidgetStoryArgs_Q259745: {
7
11
  readonly api: "https://coli-conc.gbv.de/api/";
8
12
  readonly source: "http://www.wikidata.org/entity/Q259745";
13
+ readonly rowColor: "#ebe3f8";
14
+ readonly MappingDetailBackgroundColor: "#ebedef";
9
15
  };
10
16
  export declare const MappingListWidgetStoryArgs_Energy: {
11
17
  readonly api: "https://coli-conc.gbv.de/api/";
12
18
  readonly source: "https://schema.org/Energy";
19
+ readonly rowColor: "#faf8e0";
20
+ readonly MappingDetailBackgroundColor: "#ecebef";
13
21
  };
14
22
  export declare const MappingListWidgetStoryArgs_Rec_B_2000: {
15
23
  readonly api: "https://coli-conc.gbv.de/api/";
16
24
  readonly source: "http://uri.gbv.de/terminology/nsk/Rec%20B%202000";
25
+ readonly rowColor: "#ffe9dc";
26
+ readonly MappingDetailBackgroundColor: "#ebedef";
17
27
  };
18
28
  export declare const MappingListWidgetStoryArgs_Ges_C_2700: {
19
29
  readonly api: "https://coli-conc.gbv.de/api/";
20
30
  readonly source: "http://uri.gbv.de/terminology/nsk/Ges%20C%202700";
31
+ readonly rowColor: "#ffd5d5";
32
+ readonly MappingDetailBackgroundColor: "#f1f3f3";
21
33
  };
22
34
  export declare const MappingListWidgetStoryArgs_B14C4A: {
23
35
  readonly api: "https://coli-conc.gbv.de/api/";