ochre-sdk 1.0.45 → 1.0.46
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/parsers/index.mjs +7 -1
- package/dist/types/index.d.mts +6 -0
- package/dist/xml/schemas.mjs +3 -2
- package/dist/xml/types.d.mts +1 -1
- package/package.json +2 -2
package/dist/parsers/index.mjs
CHANGED
|
@@ -392,7 +392,7 @@ function parseImageMapArea(area) {
|
|
|
392
392
|
const parsedCoord = Number(coord.trim());
|
|
393
393
|
coords.push(Number.isNaN(parsedCoord) ? 0 : parsedCoord);
|
|
394
394
|
}
|
|
395
|
-
const shape = area.shape === "rect" ? "rectangle" : area.shape === "circle" ? "circle" : "polygon";
|
|
395
|
+
const shape = area.shape === "rect" ? "rectangle" : area.shape === "circle" ? "circle" : area.shape === "point" ? "point" : "polygon";
|
|
396
396
|
return {
|
|
397
397
|
uuid: area.uuid,
|
|
398
398
|
publicationDateTime: area.publicationDateTime ?? null,
|
|
@@ -414,6 +414,12 @@ function parseImageMapArea(area) {
|
|
|
414
414
|
y: coords[1] ?? 0
|
|
415
415
|
},
|
|
416
416
|
radius: coords[2] ?? 0
|
|
417
|
+
}] : shape === "point" ? [{
|
|
418
|
+
shape,
|
|
419
|
+
point: {
|
|
420
|
+
x: coords[0] ?? 0,
|
|
421
|
+
y: coords[1] ?? 0
|
|
422
|
+
}
|
|
417
423
|
}] : [{
|
|
418
424
|
shape,
|
|
419
425
|
coords
|
package/dist/types/index.d.mts
CHANGED
package/dist/xml/schemas.mjs
CHANGED
|
@@ -210,8 +210,9 @@ const XMLImageMapArea = v.object({
|
|
|
210
210
|
shape: v.picklist([
|
|
211
211
|
"rect",
|
|
212
212
|
"circle",
|
|
213
|
-
"poly"
|
|
214
|
-
|
|
213
|
+
"poly",
|
|
214
|
+
"point"
|
|
215
|
+
], "XMLImageMapArea: shape is rect, circle, poly, or point"),
|
|
215
216
|
coords: v.string("XMLImageMapArea: coords is string and required")
|
|
216
217
|
}, "XMLImageMapArea: Shape error");
|
|
217
218
|
const XMLImageMap = v.object({
|
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.46",
|
|
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",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"bumpp": "^11.1.0",
|
|
79
79
|
"eslint": "^10.4.1",
|
|
80
80
|
"knip": "^6.16.1",
|
|
81
|
-
"oxfmt": "^0.
|
|
81
|
+
"oxfmt": "^0.54.0",
|
|
82
82
|
"tsdown": "^0.22.2",
|
|
83
83
|
"typescript": "^6.0.3",
|
|
84
84
|
"vitest": "^4.1.8"
|