@digitalculture/ochre-sdk 0.12.5 → 0.12.6
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 +3 -0
- package/dist/index.mjs +7 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -617,6 +617,9 @@ type WebElement = {
|
|
|
617
617
|
* Union type of all possible web element components
|
|
618
618
|
*/
|
|
619
619
|
type WebElementComponent = {
|
|
620
|
+
component: "advanced-search";
|
|
621
|
+
boundComponentUuid: string;
|
|
622
|
+
} | {
|
|
620
623
|
component: "annotated-document";
|
|
621
624
|
documentId: string;
|
|
622
625
|
} | {
|
package/dist/index.mjs
CHANGED
|
@@ -37,6 +37,7 @@ const websiteSchema = z.object({
|
|
|
37
37
|
* @internal
|
|
38
38
|
*/
|
|
39
39
|
const componentSchema = z.enum([
|
|
40
|
+
"advanced-search",
|
|
40
41
|
"annotated-document",
|
|
41
42
|
"annotated-image",
|
|
42
43
|
"audio-player",
|
|
@@ -1692,6 +1693,12 @@ function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1692
1693
|
const properties = { component: componentName };
|
|
1693
1694
|
const links = elementResource.links ? parseLinks(Array.isArray(elementResource.links) ? elementResource.links : [elementResource.links]) : [];
|
|
1694
1695
|
switch (componentName) {
|
|
1696
|
+
case "advanced-search": {
|
|
1697
|
+
const boundComponentPropertyUuid = getPropertyByLabel(componentProperty.properties, "bound-component")?.values[0]?.uuid;
|
|
1698
|
+
if (!boundComponentPropertyUuid) throw new Error(`Bound component not found for the following component: “${componentName}”`);
|
|
1699
|
+
properties.boundComponentUuid = boundComponentPropertyUuid;
|
|
1700
|
+
break;
|
|
1701
|
+
}
|
|
1695
1702
|
case "annotated-document": {
|
|
1696
1703
|
const documentLink = links.find((link) => link.type === "internalDocument");
|
|
1697
1704
|
if (!documentLink) throw new Error(`Document link not found for the following component: “${componentName}”`);
|
package/package.json
CHANGED