@digitalculture/ochre-sdk 0.4.5 → 0.4.7

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,6 +1573,22 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1573
1573
  if (captionLayout === null) {
1574
1574
  captionLayout = "bottom";
1575
1575
  }
1576
+ let width = null;
1577
+ const widthProperty = getPropertyValueByLabel(
1578
+ componentProperty.properties,
1579
+ "width"
1580
+ );
1581
+ if (widthProperty !== null) {
1582
+ width = Number.parseFloat(widthProperty);
1583
+ }
1584
+ let height = null;
1585
+ const heightProperty = getPropertyValueByLabel(
1586
+ componentProperty.properties,
1587
+ "height"
1588
+ );
1589
+ if (heightProperty !== null) {
1590
+ height = Number.parseFloat(heightProperty);
1591
+ }
1576
1592
  let isFullWidth = true;
1577
1593
  const isFullWidthProperty = getPropertyValueByLabel(
1578
1594
  componentProperty.properties,
@@ -1632,13 +1648,15 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1632
1648
  }
1633
1649
  properties.images = images;
1634
1650
  properties.variant = variant;
1635
- properties.carouselOptions = carouselOptions;
1651
+ properties.width = width;
1652
+ properties.height = height;
1636
1653
  properties.isFullWidth = isFullWidth;
1637
1654
  properties.isFullHeight = isFullHeight;
1638
1655
  properties.imageQuality = imageQuality;
1639
1656
  properties.captionLayout = captionLayout;
1640
1657
  properties.captionSource = captionSource;
1641
1658
  properties.altTextSource = altTextSource;
1659
+ properties.carouselOptions = carouselOptions;
1642
1660
  break;
1643
1661
  }
1644
1662
  case "image-gallery": {
@@ -1952,9 +1970,9 @@ async function parseWebpage(webpageResource) {
1952
1970
  blocks: [],
1953
1971
  elements,
1954
1972
  properties: {
1955
- spacing: "auto",
1973
+ spacing: null,
1956
1974
  gap: "none",
1957
- alignItems: "stretch",
1975
+ alignItems: "start",
1958
1976
  justifyContent: "stretch"
1959
1977
  },
1960
1978
  cssStyles: []
@@ -1974,9 +1992,9 @@ async function parseWebpage(webpageResource) {
1974
1992
  blocks: [],
1975
1993
  elements,
1976
1994
  properties: {
1977
- spacing: "auto",
1995
+ spacing: null,
1978
1996
  gap: "none",
1979
- alignItems: "stretch",
1997
+ alignItems: "start",
1980
1998
  justifyContent: "stretch"
1981
1999
  },
1982
2000
  cssStyles: []
@@ -2065,9 +2083,9 @@ async function parseBlock(blockResource) {
2065
2083
  blocks: [],
2066
2084
  elements: [],
2067
2085
  properties: {
2068
- spacing: "auto",
2086
+ spacing: null,
2069
2087
  gap: "none",
2070
- alignItems: "stretch",
2088
+ alignItems: "start",
2071
2089
  justifyContent: "stretch"
2072
2090
  },
2073
2091
  cssStyles: []
package/dist/index.d.cts CHANGED
@@ -510,15 +510,17 @@ type WebElementComponent = {
510
510
  component: "image";
511
511
  images: Array<WebImage>;
512
512
  variant: "default" | "carousel";
513
- carouselOptions: {
514
- secondsPerImage: number;
515
- } | null;
513
+ width: number | null;
514
+ height: number | null;
516
515
  isFullWidth: boolean;
517
516
  isFullHeight: boolean;
518
517
  imageQuality: "high" | "low";
519
518
  captionSource: "name" | "abbreviation" | "description";
520
519
  captionLayout: "top" | "bottom" | "suppress";
521
520
  altTextSource: "name" | "abbreviation" | "description";
521
+ carouselOptions: {
522
+ secondsPerImage: number;
523
+ } | null;
522
524
  } | {
523
525
  component: "image-gallery";
524
526
  galleryId: string;
@@ -588,7 +590,7 @@ type Block = {
588
590
  /**
589
591
  * valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
590
592
  */
591
- spacing: string;
593
+ spacing: string | null;
592
594
  /**
593
595
  * `gap` CSS property value
594
596
  */
package/dist/index.d.ts CHANGED
@@ -510,15 +510,17 @@ type WebElementComponent = {
510
510
  component: "image";
511
511
  images: Array<WebImage>;
512
512
  variant: "default" | "carousel";
513
- carouselOptions: {
514
- secondsPerImage: number;
515
- } | null;
513
+ width: number | null;
514
+ height: number | null;
516
515
  isFullWidth: boolean;
517
516
  isFullHeight: boolean;
518
517
  imageQuality: "high" | "low";
519
518
  captionSource: "name" | "abbreviation" | "description";
520
519
  captionLayout: "top" | "bottom" | "suppress";
521
520
  altTextSource: "name" | "abbreviation" | "description";
521
+ carouselOptions: {
522
+ secondsPerImage: number;
523
+ } | null;
522
524
  } | {
523
525
  component: "image-gallery";
524
526
  galleryId: string;
@@ -588,7 +590,7 @@ type Block = {
588
590
  /**
589
591
  * valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
590
592
  */
591
- spacing: string;
593
+ spacing: string | null;
592
594
  /**
593
595
  * `gap` CSS property value
594
596
  */
package/dist/index.js CHANGED
@@ -1494,6 +1494,22 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1494
1494
  if (captionLayout === null) {
1495
1495
  captionLayout = "bottom";
1496
1496
  }
1497
+ let width = null;
1498
+ const widthProperty = getPropertyValueByLabel(
1499
+ componentProperty.properties,
1500
+ "width"
1501
+ );
1502
+ if (widthProperty !== null) {
1503
+ width = Number.parseFloat(widthProperty);
1504
+ }
1505
+ let height = null;
1506
+ const heightProperty = getPropertyValueByLabel(
1507
+ componentProperty.properties,
1508
+ "height"
1509
+ );
1510
+ if (heightProperty !== null) {
1511
+ height = Number.parseFloat(heightProperty);
1512
+ }
1497
1513
  let isFullWidth = true;
1498
1514
  const isFullWidthProperty = getPropertyValueByLabel(
1499
1515
  componentProperty.properties,
@@ -1553,13 +1569,15 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1553
1569
  }
1554
1570
  properties.images = images;
1555
1571
  properties.variant = variant;
1556
- properties.carouselOptions = carouselOptions;
1572
+ properties.width = width;
1573
+ properties.height = height;
1557
1574
  properties.isFullWidth = isFullWidth;
1558
1575
  properties.isFullHeight = isFullHeight;
1559
1576
  properties.imageQuality = imageQuality;
1560
1577
  properties.captionLayout = captionLayout;
1561
1578
  properties.captionSource = captionSource;
1562
1579
  properties.altTextSource = altTextSource;
1580
+ properties.carouselOptions = carouselOptions;
1563
1581
  break;
1564
1582
  }
1565
1583
  case "image-gallery": {
@@ -1873,9 +1891,9 @@ async function parseWebpage(webpageResource) {
1873
1891
  blocks: [],
1874
1892
  elements,
1875
1893
  properties: {
1876
- spacing: "auto",
1894
+ spacing: null,
1877
1895
  gap: "none",
1878
- alignItems: "stretch",
1896
+ alignItems: "start",
1879
1897
  justifyContent: "stretch"
1880
1898
  },
1881
1899
  cssStyles: []
@@ -1895,9 +1913,9 @@ async function parseWebpage(webpageResource) {
1895
1913
  blocks: [],
1896
1914
  elements,
1897
1915
  properties: {
1898
- spacing: "auto",
1916
+ spacing: null,
1899
1917
  gap: "none",
1900
- alignItems: "stretch",
1918
+ alignItems: "start",
1901
1919
  justifyContent: "stretch"
1902
1920
  },
1903
1921
  cssStyles: []
@@ -1986,9 +2004,9 @@ async function parseBlock(blockResource) {
1986
2004
  blocks: [],
1987
2005
  elements: [],
1988
2006
  properties: {
1989
- spacing: "auto",
2007
+ spacing: null,
1990
2008
  gap: "none",
1991
- alignItems: "stretch",
2009
+ alignItems: "start",
1992
2010
  justifyContent: "stretch"
1993
2011
  },
1994
2012
  cssStyles: []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
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",