@digitalculture/ochre-sdk 0.14.9 → 0.14.11

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
@@ -132,6 +132,10 @@ type Image = {
132
132
  width: number | null;
133
133
  height: number | null;
134
134
  };
135
+ /**
136
+ * Represents a file format
137
+ */
138
+ type FileFormat = "image/jpeg" | "image/gif" | "image/tiff" | "image/bmp" | "image/png" | "image/svg+xml" | "image/jpeg-imageMap" | "image/gif-imageMap" | "image/tiff-imageMap" | "image/bmp-imageMap" | "image/png-imageMap" | "image/svg+xml-imageMap" | "video/mpeg" | "video/mp4" | "video/quicktime" | "video/x-msvideo" | "video/x-ms-wmv" | "video/x-ms-asf" | "drawing/dwg" | "audio/aiff" | "audio/basic" | "audio/midi" | "audio/mp4" | "audio/mpeg" | "audio/x-ms-wax" | "audio/x-ms-wma" | "audio/wav" | "text/pdf" | "text/doc" | "text/ppt" | "text/html" | "text/plain" | "application/xls" | "application/xlsx" | "application/ai" | "application/octet-stream" | "application/IIIF" | "image/fits" | "image/ptm" | "model/obj";
135
139
  /**
136
140
  * Represents a link to another item with optional image and bibliographic references
137
141
  */
@@ -144,7 +148,7 @@ type Link = {
144
148
  description: string | null;
145
149
  content: string | null;
146
150
  href: string | null;
147
- fileFormat: string | null;
151
+ fileFormat: FileFormat | null;
148
152
  fileSize: number | null;
149
153
  image: {
150
154
  isInline: boolean;
@@ -301,7 +305,7 @@ type Resource = {
301
305
  coordinates: Array<Coordinate>;
302
306
  document: string | null;
303
307
  href: string | null;
304
- fileFormat: string | null;
308
+ fileFormat: FileFormat | null;
305
309
  fileSize: number | null;
306
310
  imageMap: ImageMap | null;
307
311
  periods: Array<Period>;
@@ -718,7 +722,7 @@ type WebElementComponent = {
718
722
  } | {
719
723
  component: "annotated-image";
720
724
  imageUuid: string;
721
- isFilterDisplayed: boolean;
725
+ isFilterInputDisplayed: boolean;
722
726
  isOptionsDisplayed: boolean;
723
727
  isAnnotationHighlightsDisplayed: boolean;
724
728
  isAnnotationTooltipsDisplayed: boolean;
@@ -738,7 +742,7 @@ type WebElementComponent = {
738
742
  component: "entries";
739
743
  entriesId: string;
740
744
  variant: "entry" | "item";
741
- isFilterDisplayed: boolean;
745
+ isFilterInputDisplayed: boolean;
742
746
  } | {
743
747
  component: "button";
744
748
  variant: "default" | "transparent" | "link";
@@ -819,7 +823,7 @@ type WebElementComponent = {
819
823
  } | {
820
824
  component: "image-gallery";
821
825
  galleryId: string;
822
- isFilterDisplayed: boolean;
826
+ isFilterInputDisplayed: boolean;
823
827
  } | {
824
828
  component: "map";
825
829
  mapId: string;
@@ -1294,4 +1298,4 @@ declare function filterProperties(property: Property, filter: {
1294
1298
  value: string | number | boolean | Date;
1295
1299
  }, options?: PropertyOptions): boolean;
1296
1300
  //#endregion
1297
- export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinate, Data, DataCategory, Event, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyContexts, PropertyQueryItem, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Section, Set, SpatialUnit, Style, Text, Tree, UuidMetadata, WebBlock, WebBlockLayout, WebElement, WebElementComponent, WebImage, WebTitle, Webpage, Website, fetchByUuidMetadata, fetchGallery, fetchItem, fetchPropertyQuery, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
1301
+ export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinate, Data, DataCategory, Event, FileFormat, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyContexts, PropertyQueryItem, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Section, Set, SpatialUnit, Style, Text, Tree, UuidMetadata, WebBlock, WebBlockLayout, WebElement, WebElementComponent, WebImage, WebTitle, Webpage, Website, fetchByUuidMetadata, fetchGallery, fetchItem, fetchPropertyQuery, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
package/dist/index.mjs CHANGED
@@ -1907,12 +1907,12 @@ function parseWebElementProperties(componentProperty, elementResource) {
1907
1907
  case "annotated-image": {
1908
1908
  const imageLinks = links.filter((link) => link.type === "image" || link.type === "IIIF");
1909
1909
  if (imageLinks.length === 0) throw new Error(`Image link not found for the following component: “${componentName}”`);
1910
- const isFilterDisplayed = getPropertyValueByLabel(componentProperty.properties, "filter-displayed") === true;
1910
+ const isFilterInputDisplayed = getPropertyValueByLabel(componentProperty.properties, "filter-input-displayed") === true;
1911
1911
  const isOptionsDisplayed = getPropertyValueByLabel(componentProperty.properties, "options-displayed") !== false;
1912
1912
  const isAnnotationHighlightsDisplayed = getPropertyValueByLabel(componentProperty.properties, "annotation-highlights-displayed") !== false;
1913
1913
  const isAnnotationTooltipsDisplayed = getPropertyValueByLabel(componentProperty.properties, "annotation-tooltips-displayed") !== false;
1914
1914
  properties.imageUuid = imageLinks[0].uuid;
1915
- properties.isFilterDisplayed = isFilterDisplayed;
1915
+ properties.isFilterInputDisplayed = isFilterInputDisplayed;
1916
1916
  properties.isOptionsDisplayed = isOptionsDisplayed;
1917
1917
  properties.isAnnotationHighlightsDisplayed = isAnnotationHighlightsDisplayed;
1918
1918
  properties.isAnnotationTooltipsDisplayed = isAnnotationTooltipsDisplayed;
@@ -2097,12 +2097,12 @@ function parseWebElementProperties(componentProperty, elementResource) {
2097
2097
  if (!entriesLink) throw new Error(`Entries link not found for the following component: “${componentName}”`);
2098
2098
  let variant = getPropertyValueByLabel(componentProperty.properties, "variant");
2099
2099
  variant ??= "entry";
2100
- let isFilterDisplayed = false;
2101
- const isFilterDisplayedProperty = getPropertyValueByLabel(componentProperty.properties, "filter-displayed");
2102
- if (isFilterDisplayedProperty !== null) isFilterDisplayed = isFilterDisplayedProperty === true;
2100
+ let isFilterInputDisplayed = false;
2101
+ const isFilterInputDisplayedProperty = getPropertyValueByLabel(componentProperty.properties, "filter-input-displayed");
2102
+ if (isFilterInputDisplayedProperty !== null) isFilterInputDisplayed = isFilterInputDisplayedProperty === true;
2103
2103
  properties.entriesId = entriesLink.uuid;
2104
2104
  properties.variant = variant;
2105
- properties.isFilterDisplayed = isFilterDisplayed;
2105
+ properties.isFilterInputDisplayed = isFilterInputDisplayed;
2106
2106
  break;
2107
2107
  }
2108
2108
  case "iframe": {
@@ -2212,9 +2212,9 @@ function parseWebElementProperties(componentProperty, elementResource) {
2212
2212
  case "image-gallery": {
2213
2213
  const galleryLink = links.find((link) => link.category === "tree" || link.category === "set");
2214
2214
  if (!galleryLink) throw new Error(`Image gallery link not found for the following component: “${componentName}”`);
2215
- const isFilterDisplayed = getPropertyValueByLabel(componentProperty.properties, "filter-displayed") === true;
2215
+ const isFilterInputDisplayed = getPropertyValueByLabel(componentProperty.properties, "filter-input-displayed") === true;
2216
2216
  properties.galleryId = galleryLink.uuid;
2217
- properties.isFilterDisplayed = isFilterDisplayed;
2217
+ properties.isFilterInputDisplayed = isFilterInputDisplayed;
2218
2218
  break;
2219
2219
  }
2220
2220
  case "map": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.14.9",
3
+ "version": "0.14.11",
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",
@@ -40,7 +40,7 @@
40
40
  "dist"
41
41
  ],
42
42
  "dependencies": {
43
- "zod": "^4.2.1"
43
+ "zod": "^4.3.5"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@antfu/eslint-config": "^6.7.3",
@@ -49,7 +49,7 @@
49
49
  "eslint": "^9.39.2",
50
50
  "prettier": "^3.7.4",
51
51
  "terser": "^5.44.1",
52
- "tsdown": "^0.18.2",
52
+ "tsdown": "^0.18.4",
53
53
  "typescript": "^5.9.3",
54
54
  "vitest": "^4.0.16"
55
55
  },