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.
@@ -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
@@ -247,6 +247,12 @@ type ImageMapArea = {
247
247
  } | {
248
248
  shape: "polygon";
249
249
  coords: Array<number>;
250
+ } | {
251
+ shape: "point";
252
+ point: {
253
+ x: number;
254
+ y: number;
255
+ };
250
256
  }>;
251
257
  };
252
258
  /**
@@ -210,8 +210,9 @@ const XMLImageMapArea = v.object({
210
210
  shape: v.picklist([
211
211
  "rect",
212
212
  "circle",
213
- "poly"
214
- ], "XMLImageMapArea: shape is rect, circle, or poly"),
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({
@@ -167,7 +167,7 @@ type XMLImageMapArea = {
167
167
  type: string;
168
168
  title: string;
169
169
  slug?: string;
170
- shape: "rect" | "circle" | "poly";
170
+ shape: "rect" | "circle" | "poly" | "point";
171
171
  coords: string;
172
172
  };
173
173
  type XMLImageMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.0.45",
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.53.0",
81
+ "oxfmt": "^0.54.0",
82
82
  "tsdown": "^0.22.2",
83
83
  "typescript": "^6.0.3",
84
84
  "vitest": "^4.1.8"