@digitalculture/ochre-sdk 0.13.5 → 0.13.7
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/dist/index.d.mts +16 -21
- package/dist/index.mjs +4 -0
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -530,6 +530,19 @@ type LevelContext = {
|
|
|
530
530
|
identification: Identification;
|
|
531
531
|
type: string;
|
|
532
532
|
};
|
|
533
|
+
/**
|
|
534
|
+
* Represents property contexts with its levels
|
|
535
|
+
*/
|
|
536
|
+
type PropertyContexts = {
|
|
537
|
+
flatten: Array<LevelContext>;
|
|
538
|
+
suppress: Array<LevelContext>;
|
|
539
|
+
filter: Array<LevelContext>;
|
|
540
|
+
sort: Array<LevelContext>;
|
|
541
|
+
detail: Array<LevelContext>;
|
|
542
|
+
download: Array<LevelContext>;
|
|
543
|
+
label: Array<LevelContext>;
|
|
544
|
+
prominent: Array<LevelContext>;
|
|
545
|
+
};
|
|
533
546
|
/**
|
|
534
547
|
* Represents a website with its properties and elements
|
|
535
548
|
*/
|
|
@@ -577,16 +590,7 @@ type Website = {
|
|
|
577
590
|
itemPage: {
|
|
578
591
|
iiifViewer: "universal-viewer" | "clover";
|
|
579
592
|
options: {
|
|
580
|
-
contexts:
|
|
581
|
-
flatten: Array<LevelContext>;
|
|
582
|
-
suppress: Array<LevelContext>;
|
|
583
|
-
filter: Array<LevelContext>;
|
|
584
|
-
sort: Array<LevelContext>;
|
|
585
|
-
detail: Array<LevelContext>;
|
|
586
|
-
download: Array<LevelContext>;
|
|
587
|
-
label: Array<LevelContext>;
|
|
588
|
-
prominent: Array<LevelContext>;
|
|
589
|
-
};
|
|
593
|
+
contexts: PropertyContexts;
|
|
590
594
|
};
|
|
591
595
|
};
|
|
592
596
|
};
|
|
@@ -714,16 +718,7 @@ type WebElementComponent = {
|
|
|
714
718
|
type: string;
|
|
715
719
|
identification: Identification;
|
|
716
720
|
}>;
|
|
717
|
-
contexts:
|
|
718
|
-
flatten: Array<LevelContext>;
|
|
719
|
-
suppress: Array<LevelContext>;
|
|
720
|
-
filter: Array<LevelContext>;
|
|
721
|
-
sort: Array<LevelContext>;
|
|
722
|
-
detail: Array<LevelContext>;
|
|
723
|
-
download: Array<LevelContext>;
|
|
724
|
-
label: Array<LevelContext>;
|
|
725
|
-
prominent: Array<LevelContext>;
|
|
726
|
-
};
|
|
721
|
+
contexts: PropertyContexts;
|
|
727
722
|
};
|
|
728
723
|
} | {
|
|
729
724
|
component: "empty-space";
|
|
@@ -1236,4 +1231,4 @@ declare function filterProperties(property: Property, filter: {
|
|
|
1236
1231
|
value: string | number | boolean | Date;
|
|
1237
1232
|
}, options?: PropertyOptions): boolean;
|
|
1238
1233
|
//#endregion
|
|
1239
|
-
export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinate, Data, DataCategory, Event, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyQueryItem, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, UuidMetadata, WebBlock, WebBlockLayout, WebElement, WebElementComponent, WebImage, WebTitle, Webpage, Website, fetchByUuidMetadata, fetchGallery, fetchItem, fetchPropertyQuery, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
|
|
1234
|
+
export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinate, Data, DataCategory, Event, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyContexts, PropertyQueryItem, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, UuidMetadata, WebBlock, WebBlockLayout, WebElement, WebElementComponent, WebImage, WebTitle, Webpage, Website, fetchByUuidMetadata, fetchGallery, fetchItem, fetchPropertyQuery, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
|
package/dist/index.mjs
CHANGED
|
@@ -589,6 +589,10 @@ function parseStringDocumentItem(item) {
|
|
|
589
589
|
case "webpage": return `<ExternalLink href="${linkResource.href}" ${linkContent !== null ? `content="${linkContent}"` : ""}>${itemString}</ExternalLink>`;
|
|
590
590
|
default: return "";
|
|
591
591
|
}
|
|
592
|
+
} else if ("spatialUnit" in link) {
|
|
593
|
+
const linkSpatialUnit = Array.isArray(link.spatialUnit) ? link.spatialUnit[0] : link.spatialUnit;
|
|
594
|
+
if (linkSpatialUnit.publicationDateTime != null) return `<InternalLink uuid="${linkSpatialUnit.uuid}">${itemString}</InternalLink>`;
|
|
595
|
+
else return `<TooltipSpan>${itemString}</TooltipSpan>`;
|
|
592
596
|
} else if ("concept" in link) {
|
|
593
597
|
const linkConcept = Array.isArray(link.concept) ? link.concept[0] : link.concept;
|
|
594
598
|
if (linkConcept.publicationDateTime != null) return `<InternalLink uuid="${linkConcept.uuid}">${itemString}</InternalLink>`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalculture/ochre-sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Node.js library for working with OCHRE (Online Cultural and Historical Research Environment) data",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"zod": "^4.1.13"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@antfu/eslint-config": "^6.
|
|
47
|
-
"@types/node": "^24.10.
|
|
46
|
+
"@antfu/eslint-config": "^6.5.1",
|
|
47
|
+
"@types/node": "^24.10.2",
|
|
48
48
|
"bumpp": "^10.3.2",
|
|
49
49
|
"eslint": "^9.39.1",
|
|
50
50
|
"prettier": "^3.7.4",
|
|
51
51
|
"terser": "^5.44.1",
|
|
52
|
-
"tsdown": "^0.
|
|
52
|
+
"tsdown": "^0.17.2",
|
|
53
53
|
"typescript": "^5.9.3",
|
|
54
54
|
"vitest": "^4.0.15"
|
|
55
55
|
},
|