@digitalculture/ochre-sdk 0.12.8 → 0.12.9

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.
Files changed (2) hide show
  1. package/dist/index.mjs +2 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -2062,7 +2062,8 @@ function parseWebElementProperties(componentProperty, elementResource) {
2062
2062
  }
2063
2063
  case "search-bar": {
2064
2064
  const boundElementPropertyUuid = getPropertyByLabel(componentProperty.properties, "bound-element")?.values[0]?.uuid;
2065
- const href = getPropertyValueByLabel(componentProperty.properties, "link-to")?.toString() ?? null;
2065
+ const linkToProperty = getPropertyByLabel(componentProperty.properties, "link-to");
2066
+ const href = linkToProperty?.values[0]?.href ?? linkToProperty?.values[0]?.slug ?? null;
2066
2067
  if (!boundElementPropertyUuid && !href) throw new Error(`Bound element or href not found for the following component: “${componentName}”`);
2067
2068
  let variant = getPropertyValueByLabel(componentProperty.properties, "variant");
2068
2069
  variant ??= "default";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.12.8",
3
+ "version": "0.12.9",
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",