@digitalculture/ochre-sdk 0.12.9 → 0.12.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.d.mts +2 -1
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -618,7 +618,8 @@ type WebElement = {
|
|
|
618
618
|
*/
|
|
619
619
|
type WebElementComponent = {
|
|
620
620
|
component: "advanced-search";
|
|
621
|
-
boundElementUuid: string;
|
|
621
|
+
boundElementUuid: string | null;
|
|
622
|
+
href: string | null;
|
|
622
623
|
} | {
|
|
623
624
|
component: "annotated-document";
|
|
624
625
|
documentId: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1695,8 +1695,11 @@ function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1695
1695
|
switch (componentName) {
|
|
1696
1696
|
case "advanced-search": {
|
|
1697
1697
|
const boundElementPropertyUuid = getPropertyByLabel(componentProperty.properties, "bound-element")?.values[0]?.uuid;
|
|
1698
|
-
|
|
1698
|
+
const linkToProperty = getPropertyByLabel(componentProperty.properties, "link-to");
|
|
1699
|
+
const href = linkToProperty?.values[0]?.href ?? linkToProperty?.values[0]?.slug ?? null;
|
|
1700
|
+
if (!boundElementPropertyUuid && !href) throw new Error(`Bound element or href not found for the following component: “${componentName}”`);
|
|
1699
1701
|
properties.boundElementUuid = boundElementPropertyUuid;
|
|
1702
|
+
properties.href = href;
|
|
1700
1703
|
break;
|
|
1701
1704
|
}
|
|
1702
1705
|
case "annotated-document": {
|
package/package.json
CHANGED