@digitalculture/ochre-sdk 0.5.14 → 0.5.15

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.cjs CHANGED
@@ -1573,13 +1573,23 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1573
1573
  break;
1574
1574
  }
1575
1575
  case "iframe": {
1576
- const url = links.find((link) => link.type === "webpage")?.href;
1577
- if (!url) {
1576
+ const href = links.find((link) => link.type === "webpage")?.href;
1577
+ if (!href) {
1578
1578
  throw new Error(
1579
1579
  `URL not found for the following component: \u201C${componentName}\u201D`
1580
1580
  );
1581
1581
  }
1582
- properties.url = url;
1582
+ const height = getPropertyValueByLabel(
1583
+ componentProperty.properties,
1584
+ "height"
1585
+ );
1586
+ const width = getPropertyValueByLabel(
1587
+ componentProperty.properties,
1588
+ "width"
1589
+ );
1590
+ properties.href = href;
1591
+ properties.height = height;
1592
+ properties.width = width;
1583
1593
  break;
1584
1594
  }
1585
1595
  case "iiif-viewer": {
@@ -2312,7 +2322,7 @@ async function parseWebsite(websiteTree, projectName, website) {
2312
2322
  Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
2313
2323
  ) : [];
2314
2324
  return resourceProperties.some(
2315
- (property) => property.label === "presentation" && property.values[0]?.content === "element" && property.properties[0]?.label === "component" && property.properties[0]?.values[0]?.content === "sidebar"
2325
+ (property) => property.label === "presentation" && property.values[0]?.content === "element" && property.properties[0]?.label === "component" && property.properties[0].values[0]?.content === "sidebar"
2316
2326
  );
2317
2327
  });
2318
2328
  if (sidebarResource) {
package/dist/index.d.cts CHANGED
@@ -529,7 +529,9 @@ type WebElementComponent = {
529
529
  width: string | null;
530
530
  } | {
531
531
  component: "iframe";
532
- url: string;
532
+ href: string;
533
+ height: string | null;
534
+ width: string | null;
533
535
  } | {
534
536
  component: "iiif-viewer";
535
537
  IIIFId: string;
package/dist/index.d.ts CHANGED
@@ -529,7 +529,9 @@ type WebElementComponent = {
529
529
  width: string | null;
530
530
  } | {
531
531
  component: "iframe";
532
- url: string;
532
+ href: string;
533
+ height: string | null;
534
+ width: string | null;
533
535
  } | {
534
536
  component: "iiif-viewer";
535
537
  IIIFId: string;
package/dist/index.js CHANGED
@@ -1493,13 +1493,23 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1493
1493
  break;
1494
1494
  }
1495
1495
  case "iframe": {
1496
- const url = links.find((link) => link.type === "webpage")?.href;
1497
- if (!url) {
1496
+ const href = links.find((link) => link.type === "webpage")?.href;
1497
+ if (!href) {
1498
1498
  throw new Error(
1499
1499
  `URL not found for the following component: \u201C${componentName}\u201D`
1500
1500
  );
1501
1501
  }
1502
- properties.url = url;
1502
+ const height = getPropertyValueByLabel(
1503
+ componentProperty.properties,
1504
+ "height"
1505
+ );
1506
+ const width = getPropertyValueByLabel(
1507
+ componentProperty.properties,
1508
+ "width"
1509
+ );
1510
+ properties.href = href;
1511
+ properties.height = height;
1512
+ properties.width = width;
1503
1513
  break;
1504
1514
  }
1505
1515
  case "iiif-viewer": {
@@ -2232,7 +2242,7 @@ async function parseWebsite(websiteTree, projectName, website) {
2232
2242
  Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
2233
2243
  ) : [];
2234
2244
  return resourceProperties.some(
2235
- (property) => property.label === "presentation" && property.values[0]?.content === "element" && property.properties[0]?.label === "component" && property.properties[0]?.values[0]?.content === "sidebar"
2245
+ (property) => property.label === "presentation" && property.values[0]?.content === "element" && property.properties[0]?.label === "component" && property.properties[0].values[0]?.content === "sidebar"
2236
2246
  );
2237
2247
  });
2238
2248
  if (sidebarResource) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.5.14",
3
+ "version": "0.5.15",
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",
@@ -44,11 +44,11 @@
44
44
  "zod": "^3.24.2"
45
45
  },
46
46
  "devDependencies": {
47
- "@antfu/eslint-config": "^4.11.0",
47
+ "@antfu/eslint-config": "^4.12.0",
48
48
  "@arethetypeswrong/cli": "^0.17.4",
49
- "@changesets/cli": "^2.28.1",
49
+ "@changesets/cli": "^2.29.0",
50
50
  "@total-typescript/ts-reset": "^0.6.1",
51
- "@types/node": "^22.14.0",
51
+ "@types/node": "^22.14.1",
52
52
  "eslint": "^9.24.0",
53
53
  "eslint-plugin-unused-imports": "^4.1.4",
54
54
  "prettier": "^3.5.3",