ochre-sdk 1.0.52 → 1.0.53

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.
@@ -406,6 +406,14 @@ function parseWebElementProperties(componentProperty, elementResource, options,
406
406
  description: imageLink.description,
407
407
  quality: "high"
408
408
  };
409
+ const childResources = elementResource.resource ? normalizeWebsiteResources(elementResource.resource) : [];
410
+ const elements = [];
411
+ for (const childResource of childResources) {
412
+ const childReader = websitePresentationReader(childResource.properties ? parseSimplifiedProperties(childResource.properties, options) : []);
413
+ if (childReader.value("presentation") !== "element") continue;
414
+ if (childReader.nestedByValue("presentation", "element").value("component") === "button") continue;
415
+ elements.push(parseWebElement(childResource, options, context));
416
+ }
409
417
  properties = {
410
418
  component: "button",
411
419
  variant,
@@ -415,7 +423,8 @@ function parseWebElementProperties(componentProperty, elementResource, options,
415
423
  label: elementResource.document && "content" in elementResource.document ? parseXMLContent(elementResource.document, options) : null,
416
424
  startIcon,
417
425
  endIcon,
418
- image
426
+ image,
427
+ elements
419
428
  };
420
429
  break;
421
430
  }
@@ -290,6 +290,7 @@ type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
290
290
  startIcon: string | null;
291
291
  endIcon: string | null;
292
292
  image: WebImage<T> | null;
293
+ elements: Array<WebElement<T>>;
293
294
  } | {
294
295
  component: "collection";
295
296
  linkUuids: Array<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
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",
@@ -47,7 +47,7 @@
47
47
  "dependencies": {
48
48
  "date-fns": "^4.4.0",
49
49
  "fast-equals": "^6.0.0",
50
- "fast-xml-parser": "^5.9.0",
50
+ "fast-xml-parser": "^5.9.2",
51
51
  "valibot": "^1.4.1"
52
52
  },
53
53
  "devDependencies": {
@@ -57,7 +57,7 @@
57
57
  "eslint": "^10.5.0",
58
58
  "knip": "^6.17.1",
59
59
  "oxfmt": "^0.55.0",
60
- "tsdown": "^0.22.2",
60
+ "tsdown": "^0.22.3",
61
61
  "typescript": "^6.0.3",
62
62
  "vitest": "^4.1.9"
63
63
  },