@digitalculture/ochre-sdk 0.16.7 → 0.16.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.
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -904,6 +904,10 @@ type WebElementComponent = {
|
|
|
904
904
|
startIcon: string | null;
|
|
905
905
|
endIcon: string | null;
|
|
906
906
|
}>;
|
|
907
|
+
displayedProperties: Array<{
|
|
908
|
+
uuid: string;
|
|
909
|
+
label: string;
|
|
910
|
+
}> | null;
|
|
907
911
|
itemVariant: "detailed" | "card" | "tile";
|
|
908
912
|
paginationVariant: "default" | "numeric";
|
|
909
913
|
layout: "image-top" | "image-bottom" | "image-start" | "image-end";
|
package/dist/index.mjs
CHANGED
|
@@ -2482,7 +2482,7 @@ function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
2482
2482
|
for (const query of queryProperties) {
|
|
2483
2483
|
const querySubProperties = query.properties;
|
|
2484
2484
|
const label = getPropertyValueByLabel(querySubProperties, "query-prompt");
|
|
2485
|
-
if (label === null)
|
|
2485
|
+
if (label === null) continue;
|
|
2486
2486
|
const propertyUuids = querySubProperties.find((property) => property.label === "use-property")?.values.map((value) => value.uuid).filter((uuid) => uuid !== null) ?? [];
|
|
2487
2487
|
const startIcon = getPropertyValueByLabel(querySubProperties, "start-icon");
|
|
2488
2488
|
const endIcon = getPropertyValueByLabel(querySubProperties, "end-icon");
|
|
@@ -2493,6 +2493,8 @@ function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
2493
2493
|
endIcon: endIcon !== null ? String(endIcon) : null
|
|
2494
2494
|
});
|
|
2495
2495
|
}
|
|
2496
|
+
if (queries.length === 0) throw new Error(`No queries found for the following component: “${componentName}”`);
|
|
2497
|
+
const displayedProperties = getPropertyByLabel(componentProperty.properties, "use-property");
|
|
2496
2498
|
let itemVariant = getPropertyValueByLabel(componentProperty.properties, "item-variant");
|
|
2497
2499
|
itemVariant ??= "detailed";
|
|
2498
2500
|
let paginationVariant = getPropertyValueByLabel(componentProperty.properties, "pagination-variant");
|
|
@@ -2500,6 +2502,10 @@ function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
2500
2502
|
let layout = getPropertyValueByLabel(componentProperty.properties, "layout");
|
|
2501
2503
|
layout ??= "image-start";
|
|
2502
2504
|
properties.queries = queries;
|
|
2505
|
+
properties.displayedProperties = displayedProperties?.values.map((value) => ({
|
|
2506
|
+
uuid: value.uuid,
|
|
2507
|
+
label: value.content
|
|
2508
|
+
})).filter(Boolean) ?? null;
|
|
2503
2509
|
properties.itemVariant = itemVariant;
|
|
2504
2510
|
properties.paginationVariant = paginationVariant;
|
|
2505
2511
|
properties.layout = layout;
|
package/package.json
CHANGED