@digitalculture/ochre-sdk 0.12.5 → 0.12.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 +4 -0
- package/dist/index.mjs +10 -0
- package/package.json +3 -3
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
|
+
boundElementUuid: string;
|
|
622
|
+
} | {
|
|
620
623
|
component: "annotated-document";
|
|
621
624
|
documentId: string;
|
|
622
625
|
} | {
|
|
@@ -752,6 +755,7 @@ type WebElementComponent = {
|
|
|
752
755
|
variant: "default" | "full";
|
|
753
756
|
placeholder: string | null;
|
|
754
757
|
baseQuery: string | null;
|
|
758
|
+
boundElementUuid: string;
|
|
755
759
|
} | {
|
|
756
760
|
component: "table";
|
|
757
761
|
tableId: string;
|
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 boundElementPropertyUuid = getPropertyByLabel(componentProperty.properties, "bound-element")?.values[0]?.uuid;
|
|
1698
|
+
if (!boundElementPropertyUuid) throw new Error(`Bound element not found for the following component: “${componentName}”`);
|
|
1699
|
+
properties.boundElementUuid = boundElementPropertyUuid;
|
|
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}”`);
|
|
@@ -2054,6 +2061,8 @@ function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
2054
2061
|
break;
|
|
2055
2062
|
}
|
|
2056
2063
|
case "search-bar": {
|
|
2064
|
+
const boundElementPropertyUuid = getPropertyByLabel(componentProperty.properties, "bound-element")?.values[0]?.uuid;
|
|
2065
|
+
if (!boundElementPropertyUuid) throw new Error(`Bound element not found for the following component: “${componentName}”`);
|
|
2057
2066
|
let variant = getPropertyValueByLabel(componentProperty.properties, "variant");
|
|
2058
2067
|
variant ??= "default";
|
|
2059
2068
|
const placeholder = getPropertyValueByLabel(componentProperty.properties, "placeholder-text");
|
|
@@ -2061,6 +2070,7 @@ function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
2061
2070
|
properties.variant = variant;
|
|
2062
2071
|
properties.placeholder = placeholder !== null ? String(placeholder) : null;
|
|
2063
2072
|
properties.baseQuery = baseQuery !== null ? String(baseQuery).replaceAll(String.raw`\{`, "{").replaceAll(String.raw`\}`, "}") : null;
|
|
2073
|
+
properties.boundElementUuid = boundElementPropertyUuid;
|
|
2064
2074
|
break;
|
|
2065
2075
|
}
|
|
2066
2076
|
case "text": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalculture/ochre-sdk",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.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",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@antfu/eslint-config": "^6.2.0",
|
|
47
|
-
"@types/node": "^24.10.
|
|
47
|
+
"@types/node": "^24.10.1",
|
|
48
48
|
"bumpp": "^10.3.1",
|
|
49
49
|
"eslint": "^9.39.1",
|
|
50
50
|
"prettier": "^3.6.2",
|
|
51
51
|
"terser": "^5.44.1",
|
|
52
|
-
"tsdown": "^0.16.
|
|
52
|
+
"tsdown": "^0.16.3",
|
|
53
53
|
"typescript": "^5.9.3",
|
|
54
54
|
"vitest": "^4.0.8"
|
|
55
55
|
},
|