@digitalculture/ochre-sdk 0.18.9 → 0.18.10

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/index.d.mts CHANGED
@@ -718,6 +718,9 @@ type Website = {
718
718
  options: {
719
719
  contexts: PropertyContexts | null;
720
720
  scopes: Array<Scope> | null;
721
+ labels: {
722
+ title: string | null;
723
+ };
721
724
  };
722
725
  };
723
726
  };
@@ -851,6 +854,9 @@ type WebElementComponent = {
851
854
  };
852
855
  scopes: Array<Scope> | null;
853
856
  contexts: PropertyContexts | null;
857
+ labels: {
858
+ title: string | null;
859
+ };
854
860
  };
855
861
  } | {
856
862
  component: "empty-space";
package/dist/index.mjs CHANGED
@@ -2366,7 +2366,8 @@ function parseWebElementProperties(componentProperty, elementResource) {
2366
2366
  type: scope.uuid.type,
2367
2367
  identification: parseIdentification(scope.identification)
2368
2368
  })) : null,
2369
- contexts: null
2369
+ contexts: null,
2370
+ labels: { title: null }
2370
2371
  };
2371
2372
  if ("options" in elementResource && elementResource.options) {
2372
2373
  const flattenContextsRaw = elementResource.options.flattenContexts != null ? Array.isArray(elementResource.options.flattenContexts) ? elementResource.options.flattenContexts : [elementResource.options.flattenContexts] : [];
@@ -2387,6 +2388,10 @@ function parseWebElementProperties(componentProperty, elementResource) {
2387
2388
  suppress: parseContexts(suppressContextsRaw),
2388
2389
  prominent: parseContexts(prominentContextsRaw)
2389
2390
  };
2391
+ if ("notes" in elementResource.options && elementResource.options.notes) {
2392
+ const labelNotes = parseNotes(Array.isArray(elementResource.options.notes.note) ? elementResource.options.notes.note : [elementResource.options.notes.note]);
2393
+ options.labels.title = labelNotes.find((note) => note.title === "Title label")?.content ?? null;
2394
+ }
2390
2395
  }
2391
2396
  properties.collectionIds = collectionLinks.map((link) => link.uuid);
2392
2397
  properties.displayedProperties = displayedProperties?.values.map((value) => ({
@@ -3235,6 +3240,7 @@ function parseWebsiteProperties(properties, websiteTree) {
3235
3240
  const { type: validatedType, status: validatedStatus, privacy: validatedPrivacy } = result.data;
3236
3241
  let contexts = null;
3237
3242
  let scopes = null;
3243
+ const labels = { title: null };
3238
3244
  if ("options" in websiteTree && websiteTree.options) {
3239
3245
  scopes = websiteTree.options.scopes != null ? (Array.isArray(websiteTree.options.scopes.scope) ? websiteTree.options.scopes.scope : [websiteTree.options.scopes.scope]).map((scope) => ({
3240
3246
  uuid: scope.uuid.content,
@@ -3259,6 +3265,7 @@ function parseWebsiteProperties(properties, websiteTree) {
3259
3265
  label: parseContexts(labelContextsRaw),
3260
3266
  prominent: parseContexts(prominentContextsRaw)
3261
3267
  };
3268
+ if ("notes" in websiteTree.options && websiteTree.options.notes != null) labels.title = parseNotes(Array.isArray(websiteTree.options.notes.note) ? websiteTree.options.notes.note : [websiteTree.options.notes.note]).find((note) => note.title === "Title label")?.content ?? null;
3262
3269
  }
3263
3270
  return {
3264
3271
  type: validatedType,
@@ -3289,7 +3296,8 @@ function parseWebsiteProperties(properties, websiteTree) {
3289
3296
  },
3290
3297
  options: {
3291
3298
  contexts,
3292
- scopes
3299
+ scopes,
3300
+ labels
3293
3301
  }
3294
3302
  };
3295
3303
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.18.9",
3
+ "version": "0.18.10",
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",