@digitalculture/ochre-sdk 0.2.8 → 0.2.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
@@ -1548,7 +1548,7 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1548
1548
  if (altTextSource === null) {
1549
1549
  altTextSource = "name";
1550
1550
  }
1551
- let secondsPerImage = images.length > 1 ? 5 : null;
1551
+ let secondsPerImage = 5;
1552
1552
  const secondsPerImageProperty = getPropertyValueByLabel(
1553
1553
  componentProperty.properties,
1554
1554
  "seconds-per-image"
@@ -1574,13 +1574,15 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1574
1574
  }
1575
1575
  properties.images = images;
1576
1576
  properties.variant = variant;
1577
+ properties.carouselOptions = images.length > 1 ? {
1578
+ secondsPerImage,
1579
+ isFullWidth,
1580
+ isFullHeight
1581
+ } : null;
1577
1582
  properties.imageQuality = imageQuality;
1578
1583
  properties.captionLayout = captionLayout;
1579
1584
  properties.captionSource = captionSource;
1580
1585
  properties.altTextSource = altTextSource;
1581
- properties.secondsPerImage = secondsPerImage;
1582
- properties.isFullWidth = isFullWidth;
1583
- properties.isFullHeight = isFullHeight;
1584
1586
  break;
1585
1587
  }
1586
1588
  case "image-gallery": {
@@ -1967,9 +1969,12 @@ function parseWebsiteProperties(properties) {
1967
1969
  const logoUuid = websiteProperties.find((property) => property.label === "logo")?.values[0]?.uuid ?? null;
1968
1970
  let isHeaderDisplayed = true;
1969
1971
  let headerVariant = "default";
1972
+ let headerAlignment = "start";
1973
+ let isHeaderProjectDisplayed = true;
1970
1974
  let isFooterDisplayed = true;
1971
1975
  let isSidebarDisplayed = false;
1972
1976
  let searchCollectionUuid = null;
1977
+ let supportsThemeToggle = true;
1973
1978
  const headerProperty = websiteProperties.find(
1974
1979
  (property) => property.label === "navbar-visible"
1975
1980
  )?.values[0];
@@ -1982,6 +1987,18 @@ function parseWebsiteProperties(properties) {
1982
1987
  if (headerVariantProperty) {
1983
1988
  headerVariant = headerVariantProperty.content;
1984
1989
  }
1990
+ const headerAlignmentProperty = websiteProperties.find(
1991
+ (property) => property.label === "navbar-alignment"
1992
+ )?.values[0];
1993
+ if (headerAlignmentProperty) {
1994
+ headerAlignment = headerAlignmentProperty.content;
1995
+ }
1996
+ const isHeaderProjectDisplayedProperty = websiteProperties.find(
1997
+ (property) => property.label === "navbar-project-visible"
1998
+ )?.values[0];
1999
+ if (isHeaderProjectDisplayedProperty) {
2000
+ isHeaderProjectDisplayed = isHeaderProjectDisplayedProperty.content === "Yes";
2001
+ }
1985
2002
  const footerProperty = websiteProperties.find(
1986
2003
  (property) => property.label === "footer-visible"
1987
2004
  )?.values[0];
@@ -2000,6 +2017,12 @@ function parseWebsiteProperties(properties) {
2000
2017
  if (collectionSearchProperty) {
2001
2018
  searchCollectionUuid = collectionSearchProperty.uuid;
2002
2019
  }
2020
+ const supportsThemeToggleProperty = websiteProperties.find(
2021
+ (property) => property.label === "supports-theme-toggle"
2022
+ )?.values[0];
2023
+ if (supportsThemeToggleProperty) {
2024
+ supportsThemeToggle = supportsThemeToggleProperty.content === "Yes";
2025
+ }
2003
2026
  const {
2004
2027
  type: validatedType,
2005
2028
  status: validatedStatus,
@@ -2011,8 +2034,11 @@ function parseWebsiteProperties(properties) {
2011
2034
  status: validatedStatus,
2012
2035
  isHeaderDisplayed,
2013
2036
  headerVariant,
2037
+ headerAlignment,
2038
+ isHeaderProjectDisplayed,
2014
2039
  isFooterDisplayed,
2015
2040
  isSidebarDisplayed,
2041
+ supportsThemeToggle,
2016
2042
  searchCollectionUuid,
2017
2043
  logoUrl: logoUuid !== null ? `https://ochre.lib.uchicago.edu/ochre?uuid=${logoUuid}&load` : null
2018
2044
  };
package/dist/index.d.cts CHANGED
@@ -421,8 +421,11 @@ type WebsiteProperties = {
421
421
  status: "development" | "preview" | "production";
422
422
  isHeaderDisplayed: boolean;
423
423
  headerVariant: "default" | "floating";
424
+ headerAlignment: "start" | "center" | "end";
425
+ isHeaderProjectDisplayed: boolean;
424
426
  isFooterDisplayed: boolean;
425
427
  isSidebarDisplayed: boolean;
428
+ supportsThemeToggle: boolean;
426
429
  searchCollectionUuid: string | null;
427
430
  logoUrl: string | null;
428
431
  };
@@ -493,15 +496,17 @@ type WebElementComponent = {
493
496
  IIIFId: string;
494
497
  } | {
495
498
  component: "image";
496
- variant: "default" | "carousel";
497
499
  images: Array<WebImage>;
500
+ variant: "default" | "carousel";
501
+ carouselOptions: {
502
+ secondsPerImage: number | null;
503
+ isFullWidth: boolean | null;
504
+ isFullHeight: boolean | null;
505
+ } | null;
498
506
  imageQuality: "high" | "low";
499
507
  captionSource: "name" | "abbreviation" | "description";
500
508
  captionLayout: "top" | "bottom" | "suppress";
501
509
  altTextSource: "name" | "abbreviation" | "description";
502
- secondsPerImage: number | null;
503
- isFullWidth: boolean | null;
504
- isFullHeight: boolean | null;
505
510
  } | {
506
511
  component: "image-gallery";
507
512
  galleryId: string;
package/dist/index.d.ts CHANGED
@@ -421,8 +421,11 @@ type WebsiteProperties = {
421
421
  status: "development" | "preview" | "production";
422
422
  isHeaderDisplayed: boolean;
423
423
  headerVariant: "default" | "floating";
424
+ headerAlignment: "start" | "center" | "end";
425
+ isHeaderProjectDisplayed: boolean;
424
426
  isFooterDisplayed: boolean;
425
427
  isSidebarDisplayed: boolean;
428
+ supportsThemeToggle: boolean;
426
429
  searchCollectionUuid: string | null;
427
430
  logoUrl: string | null;
428
431
  };
@@ -493,15 +496,17 @@ type WebElementComponent = {
493
496
  IIIFId: string;
494
497
  } | {
495
498
  component: "image";
496
- variant: "default" | "carousel";
497
499
  images: Array<WebImage>;
500
+ variant: "default" | "carousel";
501
+ carouselOptions: {
502
+ secondsPerImage: number | null;
503
+ isFullWidth: boolean | null;
504
+ isFullHeight: boolean | null;
505
+ } | null;
498
506
  imageQuality: "high" | "low";
499
507
  captionSource: "name" | "abbreviation" | "description";
500
508
  captionLayout: "top" | "bottom" | "suppress";
501
509
  altTextSource: "name" | "abbreviation" | "description";
502
- secondsPerImage: number | null;
503
- isFullWidth: boolean | null;
504
- isFullHeight: boolean | null;
505
510
  } | {
506
511
  component: "image-gallery";
507
512
  galleryId: string;
package/dist/index.js CHANGED
@@ -1470,7 +1470,7 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1470
1470
  if (altTextSource === null) {
1471
1471
  altTextSource = "name";
1472
1472
  }
1473
- let secondsPerImage = images.length > 1 ? 5 : null;
1473
+ let secondsPerImage = 5;
1474
1474
  const secondsPerImageProperty = getPropertyValueByLabel(
1475
1475
  componentProperty.properties,
1476
1476
  "seconds-per-image"
@@ -1496,13 +1496,15 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1496
1496
  }
1497
1497
  properties.images = images;
1498
1498
  properties.variant = variant;
1499
+ properties.carouselOptions = images.length > 1 ? {
1500
+ secondsPerImage,
1501
+ isFullWidth,
1502
+ isFullHeight
1503
+ } : null;
1499
1504
  properties.imageQuality = imageQuality;
1500
1505
  properties.captionLayout = captionLayout;
1501
1506
  properties.captionSource = captionSource;
1502
1507
  properties.altTextSource = altTextSource;
1503
- properties.secondsPerImage = secondsPerImage;
1504
- properties.isFullWidth = isFullWidth;
1505
- properties.isFullHeight = isFullHeight;
1506
1508
  break;
1507
1509
  }
1508
1510
  case "image-gallery": {
@@ -1889,9 +1891,12 @@ function parseWebsiteProperties(properties) {
1889
1891
  const logoUuid = websiteProperties.find((property) => property.label === "logo")?.values[0]?.uuid ?? null;
1890
1892
  let isHeaderDisplayed = true;
1891
1893
  let headerVariant = "default";
1894
+ let headerAlignment = "start";
1895
+ let isHeaderProjectDisplayed = true;
1892
1896
  let isFooterDisplayed = true;
1893
1897
  let isSidebarDisplayed = false;
1894
1898
  let searchCollectionUuid = null;
1899
+ let supportsThemeToggle = true;
1895
1900
  const headerProperty = websiteProperties.find(
1896
1901
  (property) => property.label === "navbar-visible"
1897
1902
  )?.values[0];
@@ -1904,6 +1909,18 @@ function parseWebsiteProperties(properties) {
1904
1909
  if (headerVariantProperty) {
1905
1910
  headerVariant = headerVariantProperty.content;
1906
1911
  }
1912
+ const headerAlignmentProperty = websiteProperties.find(
1913
+ (property) => property.label === "navbar-alignment"
1914
+ )?.values[0];
1915
+ if (headerAlignmentProperty) {
1916
+ headerAlignment = headerAlignmentProperty.content;
1917
+ }
1918
+ const isHeaderProjectDisplayedProperty = websiteProperties.find(
1919
+ (property) => property.label === "navbar-project-visible"
1920
+ )?.values[0];
1921
+ if (isHeaderProjectDisplayedProperty) {
1922
+ isHeaderProjectDisplayed = isHeaderProjectDisplayedProperty.content === "Yes";
1923
+ }
1907
1924
  const footerProperty = websiteProperties.find(
1908
1925
  (property) => property.label === "footer-visible"
1909
1926
  )?.values[0];
@@ -1922,6 +1939,12 @@ function parseWebsiteProperties(properties) {
1922
1939
  if (collectionSearchProperty) {
1923
1940
  searchCollectionUuid = collectionSearchProperty.uuid;
1924
1941
  }
1942
+ const supportsThemeToggleProperty = websiteProperties.find(
1943
+ (property) => property.label === "supports-theme-toggle"
1944
+ )?.values[0];
1945
+ if (supportsThemeToggleProperty) {
1946
+ supportsThemeToggle = supportsThemeToggleProperty.content === "Yes";
1947
+ }
1925
1948
  const {
1926
1949
  type: validatedType,
1927
1950
  status: validatedStatus,
@@ -1933,8 +1956,11 @@ function parseWebsiteProperties(properties) {
1933
1956
  status: validatedStatus,
1934
1957
  isHeaderDisplayed,
1935
1958
  headerVariant,
1959
+ headerAlignment,
1960
+ isHeaderProjectDisplayed,
1936
1961
  isFooterDisplayed,
1937
1962
  isSidebarDisplayed,
1963
+ supportsThemeToggle,
1938
1964
  searchCollectionUuid,
1939
1965
  logoUrl: logoUuid !== null ? `https://ochre.lib.uchicago.edu/ochre?uuid=${logoUuid}&load` : null
1940
1966
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.2.8",
3
+ "version": "0.2.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",