ochre-sdk 1.0.76 → 1.0.77
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { componentSchema } from "../../schemas.mjs";
|
|
2
2
|
import { parseXMLContent } from "../string.mjs";
|
|
3
|
-
import { cleanObject, parseLicense, parseStringContent } from "../helpers.mjs";
|
|
3
|
+
import { cleanObject, parseContentLike, parseLicense, parseStringContent } from "../helpers.mjs";
|
|
4
4
|
import { parseBibliographyList, parseIdentification, parseLinks, parseMetadata, parseMetadataLanguages, parseNotes, parsePersonList, parseSimplifiedProperties, resolveDefaultLanguage, resolveLanguages } from "../index.mjs";
|
|
5
5
|
import { websitePresentationReader } from "./reader.mjs";
|
|
6
6
|
import * as v from "valibot";
|
|
@@ -1317,7 +1317,8 @@ function parseContextItem(contextItemToParse, options) {
|
|
|
1317
1317
|
return {
|
|
1318
1318
|
context: levels,
|
|
1319
1319
|
type,
|
|
1320
|
-
identification: parseIdentification(contextItemToParse.identification, options)
|
|
1320
|
+
identification: parseIdentification(contextItemToParse.identification, options),
|
|
1321
|
+
description: parseContentLike(contextItemToParse.description, options)
|
|
1321
1322
|
};
|
|
1322
1323
|
}
|
|
1323
1324
|
function parseFilterContextDisplay(filterOption) {
|
package/dist/types/website.d.mts
CHANGED
|
@@ -14,6 +14,7 @@ type ContextTreeLevelItem = {
|
|
|
14
14
|
type ContextTreeLevel<T extends LanguageCodes = LanguageCodes> = {
|
|
15
15
|
context: Array<ContextTreeLevelItem>;
|
|
16
16
|
identification: Identification<T>;
|
|
17
|
+
description: MultilingualString<T> | null;
|
|
17
18
|
type: string;
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
@@ -23,16 +24,13 @@ type ContextTreeFilterVariant = "checkbox" | "chip" | "range" | "tile" | "toggle
|
|
|
23
24
|
/**
|
|
24
25
|
* Represents a filter context tree level with a context item
|
|
25
26
|
*/
|
|
26
|
-
type ContextTreeFilterLevel<T extends LanguageCodes = LanguageCodes> = {
|
|
27
|
-
context: Array<ContextTreeLevelItem>;
|
|
28
|
-
identification: Identification<T>;
|
|
29
|
-
type: string;
|
|
27
|
+
type ContextTreeFilterLevel<T extends LanguageCodes = LanguageCodes> = Prettify<ContextTreeLevel<T> & {
|
|
30
28
|
filterType: "property" | "coordinates" | "bibliography" | "period";
|
|
31
29
|
filterVariant: ContextTreeFilterVariant | null;
|
|
32
30
|
isInlineDisplayed: boolean;
|
|
33
31
|
isSidebarDisplayed: boolean;
|
|
34
32
|
isSidebarOpen: boolean;
|
|
35
|
-
}
|
|
33
|
+
}>;
|
|
36
34
|
/**
|
|
37
35
|
* Represents a context tree with levels grouped by behavior
|
|
38
36
|
*/
|
package/dist/xml/schemas.mjs
CHANGED
|
@@ -717,13 +717,14 @@ const XMLWebsiteContextLevel = v.intersect([XMLString, v.object({
|
|
|
717
717
|
payload: v.string("XMLWebsiteContextLevel: payload is required"),
|
|
718
718
|
dataType: v.optional(v.string("XMLWebsiteContextLevel: dataType is optional string"))
|
|
719
719
|
}, "XMLWebsiteContextLevel: Shape error")]);
|
|
720
|
-
const
|
|
720
|
+
const XMLWebsiteContextItemEntries = {
|
|
721
721
|
identification: XMLIdentification,
|
|
722
|
+
description: v.optional(XMLContent),
|
|
722
723
|
levels: v.optional(v.object({ level: v.array(XMLWebsiteContextLevel) }, "XMLWebsiteContextItem: levels is object with level"))
|
|
723
|
-
}
|
|
724
|
+
};
|
|
725
|
+
const XMLWebsiteContextItem = v.object(XMLWebsiteContextItemEntries, "XMLWebsiteContextItem: Shape error");
|
|
724
726
|
const XMLWebsiteFilterContextItem = v.object({
|
|
725
|
-
|
|
726
|
-
levels: v.optional(v.object({ level: v.array(XMLWebsiteContextLevel) }, "XMLWebsiteFilterContextItem: levels is object with level")),
|
|
727
|
+
...XMLWebsiteContextItemEntries,
|
|
727
728
|
filterType: v.optional(v.picklist([
|
|
728
729
|
"property",
|
|
729
730
|
"coordinates",
|
package/dist/xml/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ochre-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.77",
|
|
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",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"eslint": "^10.8.1",
|
|
58
58
|
"eslint-plugin-erasable-syntax-only": "^0.4.2",
|
|
59
59
|
"knip": "^6.32.2",
|
|
60
|
-
"oxfmt": "^0.
|
|
60
|
+
"oxfmt": "^0.64.0",
|
|
61
61
|
"tsdown": "^0.22.14",
|
|
62
62
|
"typescript": "^6.0.3",
|
|
63
|
-
"vitest": "^4.1.
|
|
63
|
+
"vitest": "^4.1.11"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"dev": "tsdown src/index.ts --watch",
|