@digitalculture/ochre-sdk 0.14.6 → 0.14.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.d.mts CHANGED
@@ -446,6 +446,9 @@ type PropertyValueContent<T extends PropertyValueContentType> = {
446
446
  label: string | null;
447
447
  isUncertain: boolean;
448
448
  unit: string | null;
449
+ height: number | null;
450
+ width: number | null;
451
+ fileSize: number | null;
449
452
  category: string | null;
450
453
  type: string | null;
451
454
  uuid: string | null;
@@ -631,6 +634,7 @@ type Website = {
631
634
  logoUrl: string | null;
632
635
  itemPage: {
633
636
  iiifViewer: "universal-viewer" | "clover";
637
+ isPropertyValuesGrouped: boolean;
634
638
  options: {
635
639
  contexts: PropertyContexts;
636
640
  };
@@ -747,6 +751,7 @@ type WebElementComponent = {
747
751
  itemVariant: "detailed" | "card" | "tile";
748
752
  paginationVariant: "default" | "numeric";
749
753
  layout: "image-top" | "image-bottom" | "image-start" | "image-end";
754
+ imageQuality: "high" | "low";
750
755
  isSortDisplayed: boolean;
751
756
  isUsingQueryParams: boolean;
752
757
  filter: {
package/dist/index.mjs CHANGED
@@ -1179,6 +1179,9 @@ function parseProperty(property, language = "eng") {
1179
1179
  uuid: null,
1180
1180
  publicationDateTime: null,
1181
1181
  unit: null,
1182
+ height: null,
1183
+ width: null,
1184
+ fileSize: null,
1182
1185
  href: null,
1183
1186
  slug: null
1184
1187
  };
@@ -1231,6 +1234,9 @@ function parseProperty(property, language = "eng") {
1231
1234
  uuid: value.uuid ?? null,
1232
1235
  publicationDateTime: value.publicationDateTime != null ? new Date(value.publicationDateTime) : null,
1233
1236
  unit: value.unit ?? null,
1237
+ height: value.height ?? null,
1238
+ width: value.width ?? null,
1239
+ fileSize: value.fileSize ?? null,
1234
1240
  href: value.href ?? null,
1235
1241
  slug: value.slug ?? null
1236
1242
  };
@@ -1953,6 +1959,8 @@ function parseWebElementProperties(componentProperty, elementResource) {
1953
1959
  itemVariant ??= "detailed";
1954
1960
  let paginationVariant = getPropertyValueByLabel(componentProperty.properties, "pagination-variant");
1955
1961
  paginationVariant ??= "default";
1962
+ let imageQuality = getPropertyValueByLabel(componentProperty.properties, "image-quality");
1963
+ imageQuality ??= "low";
1956
1964
  let isUsingQueryParams = false;
1957
1965
  const isUsingQueryParamsProperty = getPropertyValueByLabel(componentProperty.properties, "is-using-query-params");
1958
1966
  if (isUsingQueryParamsProperty !== null) isUsingQueryParams = isUsingQueryParamsProperty === true;
@@ -2024,6 +2032,8 @@ function parseWebElementProperties(componentProperty, elementResource) {
2024
2032
  properties.variant = variant;
2025
2033
  properties.itemVariant = itemVariant;
2026
2034
  properties.paginationVariant = paginationVariant;
2035
+ properties.layout = layout;
2036
+ properties.imageQuality = imageQuality;
2027
2037
  properties.isUsingQueryParams = isUsingQueryParams;
2028
2038
  properties.filter = {
2029
2039
  isSidebarDisplayed: isFilterSidebarDisplayed,
@@ -2033,7 +2043,6 @@ function parseWebElementProperties(componentProperty, elementResource) {
2033
2043
  sidebarSort: filterSidebarSort
2034
2044
  };
2035
2045
  properties.isSortDisplayed = isSortDisplayed;
2036
- properties.layout = layout;
2037
2046
  properties.options = options;
2038
2047
  break;
2039
2048
  }
@@ -2078,7 +2087,7 @@ function parseWebElementProperties(componentProperty, elementResource) {
2078
2087
  }
2079
2088
  case "image": {
2080
2089
  if (links.length === 0) throw new Error(`No links found for the following component: “${componentName}”`);
2081
- let imageQuality = getPropertyValueByLabel(componentProperty.properties, "quality");
2090
+ let imageQuality = getPropertyValueByLabel(componentProperty.properties, "image-quality");
2082
2091
  imageQuality ??= "high";
2083
2092
  const images = [];
2084
2093
  for (const link of links) images.push({
@@ -2794,6 +2803,7 @@ function parseWebsiteProperties(properties, websiteTree) {
2794
2803
  let isFooterDisplayed = true;
2795
2804
  let isSidebarDisplayed = false;
2796
2805
  let iiifViewer = "universal-viewer";
2806
+ let isPropertyValuesGrouped = true;
2797
2807
  let supportsThemeToggle = true;
2798
2808
  let defaultTheme = null;
2799
2809
  const headerProperty = websiteProperties.find((property) => property.label === "navbar-displayed")?.values[0];
@@ -2811,6 +2821,8 @@ function parseWebsiteProperties(properties, websiteTree) {
2811
2821
  const headerSearchBarBoundElementUuid = websiteProperties.find((property) => property.label === "bound-element-navbar-search-bar")?.values[0]?.uuid ?? null;
2812
2822
  const iiifViewerProperty = websiteProperties.find((property) => property.label === "iiif-viewer")?.values[0];
2813
2823
  if (iiifViewerProperty) iiifViewer = iiifViewerProperty.content;
2824
+ const isPropertyValuesGroupedProperty = websiteProperties.find((property) => property.label === "is-property-values-grouped")?.values[0];
2825
+ if (isPropertyValuesGroupedProperty) isPropertyValuesGrouped = isPropertyValuesGroupedProperty.content === true;
2814
2826
  const supportsThemeToggleProperty = websiteProperties.find((property) => property.label === "supports-theme-toggle")?.values[0];
2815
2827
  if (supportsThemeToggleProperty) supportsThemeToggle = supportsThemeToggleProperty.content === true;
2816
2828
  const defaultThemeProperty = websiteProperties.find((property) => property.label === "default-theme")?.values[0];
@@ -2863,6 +2875,7 @@ function parseWebsiteProperties(properties, websiteTree) {
2863
2875
  logoUrl: logoUuid !== null ? `https://ochre.lib.uchicago.edu/ochre?uuid=${logoUuid}&load` : null,
2864
2876
  itemPage: {
2865
2877
  iiifViewer,
2878
+ isPropertyValuesGrouped,
2866
2879
  options: { contexts }
2867
2880
  }
2868
2881
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.14.6",
3
+ "version": "0.14.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",
@@ -43,13 +43,13 @@
43
43
  "zod": "^4.2.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@antfu/eslint-config": "^6.7.1",
46
+ "@antfu/eslint-config": "^6.7.3",
47
47
  "@types/node": "^24.10.4",
48
48
  "bumpp": "^10.3.2",
49
49
  "eslint": "^9.39.2",
50
50
  "prettier": "^3.7.4",
51
51
  "terser": "^5.44.1",
52
- "tsdown": "^0.18.1",
52
+ "tsdown": "^0.18.2",
53
53
  "typescript": "^5.9.3",
54
54
  "vitest": "^4.0.16"
55
55
  },