@digitalculture/ochre-sdk 0.4.8 → 0.4.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.cjs CHANGED
@@ -1372,7 +1372,9 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1372
1372
  const links = elementResource.links ? parseLinks(
1373
1373
  Array.isArray(elementResource.links) ? elementResource.links : [elementResource.links]
1374
1374
  ) : [];
1375
- const imageLinks = links.filter((link) => link.type === "image");
1375
+ const imageLinks = links.filter(
1376
+ (link) => link.type === "image" || link.type === "IIIF"
1377
+ );
1376
1378
  let document = elementResource.document ? parseDocument(elementResource.document.content) : null;
1377
1379
  if (document === null) {
1378
1380
  const documentLink = links.find((link) => link.type === "internalDocument");
@@ -1607,6 +1609,22 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1607
1609
  if (altTextSource === null) {
1608
1610
  altTextSource = "name";
1609
1611
  }
1612
+ let isTransparentBackground = false;
1613
+ const isTransparentBackgroundProperty = getPropertyValueByLabel(
1614
+ componentProperty.properties,
1615
+ "is-transparent"
1616
+ );
1617
+ if (isTransparentBackgroundProperty !== null) {
1618
+ isTransparentBackground = isTransparentBackgroundProperty === "Yes";
1619
+ }
1620
+ let isCover = false;
1621
+ const isCoverProperty = getPropertyValueByLabel(
1622
+ componentProperty.properties,
1623
+ "is-cover"
1624
+ );
1625
+ if (isCoverProperty !== null) {
1626
+ isCover = isCoverProperty === "Yes";
1627
+ }
1610
1628
  let carouselOptions = null;
1611
1629
  if (images.length > 1) {
1612
1630
  const variantProperty = getPropertyByLabel(
@@ -1637,6 +1655,8 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1637
1655
  properties.captionLayout = captionLayout;
1638
1656
  properties.captionSource = captionSource;
1639
1657
  properties.altTextSource = altTextSource;
1658
+ properties.isTransparentBackground = isTransparentBackground;
1659
+ properties.isCover = isCover;
1640
1660
  properties.carouselOptions = carouselOptions;
1641
1661
  break;
1642
1662
  }
package/dist/index.d.cts CHANGED
@@ -518,6 +518,8 @@ type WebElementComponent = {
518
518
  captionSource: "name" | "abbreviation" | "description";
519
519
  captionLayout: "top" | "bottom" | "suppress";
520
520
  altTextSource: "name" | "abbreviation" | "description";
521
+ isTransparentBackground: boolean;
522
+ isCover: boolean;
521
523
  carouselOptions: {
522
524
  secondsPerImage: number;
523
525
  } | null;
package/dist/index.d.ts CHANGED
@@ -518,6 +518,8 @@ type WebElementComponent = {
518
518
  captionSource: "name" | "abbreviation" | "description";
519
519
  captionLayout: "top" | "bottom" | "suppress";
520
520
  altTextSource: "name" | "abbreviation" | "description";
521
+ isTransparentBackground: boolean;
522
+ isCover: boolean;
521
523
  carouselOptions: {
522
524
  secondsPerImage: number;
523
525
  } | null;
package/dist/index.js CHANGED
@@ -1295,7 +1295,9 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1295
1295
  const links = elementResource.links ? parseLinks(
1296
1296
  Array.isArray(elementResource.links) ? elementResource.links : [elementResource.links]
1297
1297
  ) : [];
1298
- const imageLinks = links.filter((link) => link.type === "image");
1298
+ const imageLinks = links.filter(
1299
+ (link) => link.type === "image" || link.type === "IIIF"
1300
+ );
1299
1301
  let document = elementResource.document ? parseDocument(elementResource.document.content) : null;
1300
1302
  if (document === null) {
1301
1303
  const documentLink = links.find((link) => link.type === "internalDocument");
@@ -1530,6 +1532,22 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1530
1532
  if (altTextSource === null) {
1531
1533
  altTextSource = "name";
1532
1534
  }
1535
+ let isTransparentBackground = false;
1536
+ const isTransparentBackgroundProperty = getPropertyValueByLabel(
1537
+ componentProperty.properties,
1538
+ "is-transparent"
1539
+ );
1540
+ if (isTransparentBackgroundProperty !== null) {
1541
+ isTransparentBackground = isTransparentBackgroundProperty === "Yes";
1542
+ }
1543
+ let isCover = false;
1544
+ const isCoverProperty = getPropertyValueByLabel(
1545
+ componentProperty.properties,
1546
+ "is-cover"
1547
+ );
1548
+ if (isCoverProperty !== null) {
1549
+ isCover = isCoverProperty === "Yes";
1550
+ }
1533
1551
  let carouselOptions = null;
1534
1552
  if (images.length > 1) {
1535
1553
  const variantProperty = getPropertyByLabel(
@@ -1560,6 +1578,8 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1560
1578
  properties.captionLayout = captionLayout;
1561
1579
  properties.captionSource = captionSource;
1562
1580
  properties.altTextSource = altTextSource;
1581
+ properties.isTransparentBackground = isTransparentBackground;
1582
+ properties.isCover = isCover;
1563
1583
  properties.carouselOptions = carouselOptions;
1564
1584
  break;
1565
1585
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.4.8",
3
+ "version": "0.4.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",