@digitalculture/ochre-sdk 0.3.2 → 0.3.4

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
@@ -1884,6 +1884,7 @@ async function parseWebpage(webpageResource) {
1884
1884
  let displayedInHeader = true;
1885
1885
  let width = "default";
1886
1886
  let variant = "default";
1887
+ let isSidebarDisplayed = true;
1887
1888
  const webpageSubProperties = webpageProperties.find(
1888
1889
  (property) => property.label === "presentation" && property.values[0]?.content === "page"
1889
1890
  )?.properties;
@@ -1906,6 +1907,12 @@ async function parseWebpage(webpageResource) {
1906
1907
  if (variantProperty) {
1907
1908
  variant = variantProperty.content;
1908
1909
  }
1910
+ const isSidebarDisplayedProperty = webpageSubProperties.find(
1911
+ (property) => property.label === "sidebar-visible"
1912
+ )?.values[0];
1913
+ if (isSidebarDisplayedProperty) {
1914
+ isSidebarDisplayed = isSidebarDisplayedProperty.content === "Yes";
1915
+ }
1909
1916
  }
1910
1917
  const cssStyleSubProperties = webpageProperties.find(
1911
1918
  (property) => property.label === "presentation" && property.values[0]?.content === "css"
@@ -1928,6 +1935,7 @@ async function parseWebpage(webpageResource) {
1928
1935
  width,
1929
1936
  variant,
1930
1937
  backgroundImageUrl: imageLink ? `https://ochre.lib.uchicago.edu/ochre?uuid=${imageLink.uuid}&load` : null,
1938
+ isSidebarDisplayed,
1931
1939
  cssStyles
1932
1940
  },
1933
1941
  webpages
@@ -2077,6 +2085,7 @@ async function parseWebsite(websiteTree, projectName, website) {
2077
2085
  isCreatorsDisplayed: false
2078
2086
  }
2079
2087
  };
2088
+ let sidebarLayout = "start";
2080
2089
  const sidebarCssStyles = [];
2081
2090
  const sidebarResource = resources.find((resource) => {
2082
2091
  const resourceProperties = resource.properties ? parseProperties(
@@ -2091,6 +2100,12 @@ async function parseWebsite(websiteTree, projectName, website) {
2091
2100
  const sidebarProperties = sidebarResource.properties ? parseProperties(
2092
2101
  Array.isArray(sidebarResource.properties.property) ? sidebarResource.properties.property : [sidebarResource.properties.property]
2093
2102
  ) : [];
2103
+ const sidebarLayoutProperty = sidebarProperties.find(
2104
+ (property) => property.label === "layout"
2105
+ );
2106
+ if (sidebarLayoutProperty) {
2107
+ sidebarLayout = sidebarLayoutProperty.values[0].content;
2108
+ }
2094
2109
  const cssProperties = sidebarProperties.find(
2095
2110
  (property) => property.label === "presentation" && property.values[0].content === "css"
2096
2111
  )?.properties ?? [];
@@ -2142,6 +2157,7 @@ async function parseWebsite(websiteTree, projectName, website) {
2142
2157
  sidebar = {
2143
2158
  elements: sidebarElements,
2144
2159
  title: sidebarTitle,
2160
+ layout: sidebarLayout,
2145
2161
  cssStyles: sidebarCssStyles
2146
2162
  };
2147
2163
  }
package/dist/index.d.cts CHANGED
@@ -412,6 +412,7 @@ type Website = {
412
412
  sidebar: {
413
413
  elements: Array<WebElement>;
414
414
  title: WebElement["title"];
415
+ layout: "start" | "end";
415
416
  cssStyles: Array<Style>;
416
417
  } | null;
417
418
  properties: WebsiteProperties;
@@ -448,6 +449,7 @@ type WebpageProperties = {
448
449
  width: "full" | "large" | "narrow" | "default";
449
450
  variant: "default" | "no-background";
450
451
  backgroundImageUrl: string | null;
452
+ isSidebarDisplayed: boolean;
451
453
  cssStyles: Array<Style>;
452
454
  };
453
455
  /**
package/dist/index.d.ts CHANGED
@@ -412,6 +412,7 @@ type Website = {
412
412
  sidebar: {
413
413
  elements: Array<WebElement>;
414
414
  title: WebElement["title"];
415
+ layout: "start" | "end";
415
416
  cssStyles: Array<Style>;
416
417
  } | null;
417
418
  properties: WebsiteProperties;
@@ -448,6 +449,7 @@ type WebpageProperties = {
448
449
  width: "full" | "large" | "narrow" | "default";
449
450
  variant: "default" | "no-background";
450
451
  backgroundImageUrl: string | null;
452
+ isSidebarDisplayed: boolean;
451
453
  cssStyles: Array<Style>;
452
454
  };
453
455
  /**
package/dist/index.js CHANGED
@@ -1806,6 +1806,7 @@ async function parseWebpage(webpageResource) {
1806
1806
  let displayedInHeader = true;
1807
1807
  let width = "default";
1808
1808
  let variant = "default";
1809
+ let isSidebarDisplayed = true;
1809
1810
  const webpageSubProperties = webpageProperties.find(
1810
1811
  (property) => property.label === "presentation" && property.values[0]?.content === "page"
1811
1812
  )?.properties;
@@ -1828,6 +1829,12 @@ async function parseWebpage(webpageResource) {
1828
1829
  if (variantProperty) {
1829
1830
  variant = variantProperty.content;
1830
1831
  }
1832
+ const isSidebarDisplayedProperty = webpageSubProperties.find(
1833
+ (property) => property.label === "sidebar-visible"
1834
+ )?.values[0];
1835
+ if (isSidebarDisplayedProperty) {
1836
+ isSidebarDisplayed = isSidebarDisplayedProperty.content === "Yes";
1837
+ }
1831
1838
  }
1832
1839
  const cssStyleSubProperties = webpageProperties.find(
1833
1840
  (property) => property.label === "presentation" && property.values[0]?.content === "css"
@@ -1850,6 +1857,7 @@ async function parseWebpage(webpageResource) {
1850
1857
  width,
1851
1858
  variant,
1852
1859
  backgroundImageUrl: imageLink ? `https://ochre.lib.uchicago.edu/ochre?uuid=${imageLink.uuid}&load` : null,
1860
+ isSidebarDisplayed,
1853
1861
  cssStyles
1854
1862
  },
1855
1863
  webpages
@@ -1999,6 +2007,7 @@ async function parseWebsite(websiteTree, projectName, website) {
1999
2007
  isCreatorsDisplayed: false
2000
2008
  }
2001
2009
  };
2010
+ let sidebarLayout = "start";
2002
2011
  const sidebarCssStyles = [];
2003
2012
  const sidebarResource = resources.find((resource) => {
2004
2013
  const resourceProperties = resource.properties ? parseProperties(
@@ -2013,6 +2022,12 @@ async function parseWebsite(websiteTree, projectName, website) {
2013
2022
  const sidebarProperties = sidebarResource.properties ? parseProperties(
2014
2023
  Array.isArray(sidebarResource.properties.property) ? sidebarResource.properties.property : [sidebarResource.properties.property]
2015
2024
  ) : [];
2025
+ const sidebarLayoutProperty = sidebarProperties.find(
2026
+ (property) => property.label === "layout"
2027
+ );
2028
+ if (sidebarLayoutProperty) {
2029
+ sidebarLayout = sidebarLayoutProperty.values[0].content;
2030
+ }
2016
2031
  const cssProperties = sidebarProperties.find(
2017
2032
  (property) => property.label === "presentation" && property.values[0].content === "css"
2018
2033
  )?.properties ?? [];
@@ -2064,6 +2079,7 @@ async function parseWebsite(websiteTree, projectName, website) {
2064
2079
  sidebar = {
2065
2080
  elements: sidebarElements,
2066
2081
  title: sidebarTitle,
2082
+ layout: sidebarLayout,
2067
2083
  cssStyles: sidebarCssStyles
2068
2084
  };
2069
2085
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
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",