ochre-sdk 1.0.44 → 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
@@ -280,7 +280,6 @@ function parseNestedStringItems(items, contentItem, options) {
280
280
  nextItem: rawIndex + 1 < index ? items[rawIndex + 1] : void 0
281
281
  });
282
282
  }
283
- if (rawMDXBlock !== "" && !rawMDXBlock.endsWith("\n") && item.whitespace?.split(" ").includes("newline") === true) rawMDXBlock += "\n";
284
283
  if (options.rendering === "rich" && options.rawMDXBlocks != null) {
285
284
  const placeholder = `${RAW_MDX_BLOCK_PLACEHOLDER_PREFIX}${options.rawMDXBlocks.length}${RAW_MDX_BLOCK_PLACEHOLDER_SUFFIX}`;
286
285
  options.rawMDXBlocks.push(rawMDXBlock);
@@ -971,6 +971,7 @@ function parseWebBlock(blockResource, options, context) {
971
971
  const blockProperties = blockResource.properties ? parseSimplifiedProperties(blockResource.properties, options) : [];
972
972
  const returnBlock = {
973
973
  uuid: blockResource.uuid,
974
+ language: blockResource.lang ?? null,
974
975
  type: "block",
975
976
  title: parseWebTitle(blockProperties, parseIdentification(blockResource.identification, options)),
976
977
  items: [],
@@ -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
  /**
@@ -477,6 +477,7 @@ type WebAccordionItem<T extends LanguageCodes = LanguageCodes> = {
477
477
  */
478
478
  type WebBlock<T extends LanguageCodes = LanguageCodes, U extends WebBlockLayout = WebBlockLayout> = {
479
479
  uuid: string;
480
+ language: string | null;
480
481
  type: "block";
481
482
  title: WebTitle<T>;
482
483
  items: U extends "accordion" ? Array<WebAccordionItem<T> | WebBlockItem<T>> : Array<WebBlockItem<T>>;
@@ -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.44",
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"