ochre-sdk 1.3.10 → 1.3.12
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeItemCategory } from "../../categories.mjs";
|
|
1
2
|
import { componentSchema } from "../../schemas.mjs";
|
|
2
3
|
import { parseXMLContent, transformPermanentIdentificationUrlToItemLink } from "../string.mjs";
|
|
3
4
|
import { parseStringContent } from "../helpers.mjs";
|
|
@@ -126,14 +127,16 @@ function parse3dViewerComponent(parameters) {
|
|
|
126
127
|
}
|
|
127
128
|
const ADVANCED_SEARCH_FILTER_DEFAULTS = {
|
|
128
129
|
sidebarSort: "default",
|
|
129
|
-
isSidebarHelpTooltipsDisplayed:
|
|
130
|
-
isSidebarResultCountsDisplayed:
|
|
130
|
+
isSidebarHelpTooltipsDisplayed: true,
|
|
131
|
+
isSidebarResultCountsDisplayed: true
|
|
131
132
|
};
|
|
132
133
|
function parseAdvancedSearchComponent(parameters) {
|
|
133
134
|
const { componentProperty, componentReader, elementResource, options, pageSlugs } = parameters;
|
|
134
135
|
const boundElementPropertyUuid = componentReader.uuid("bound-element");
|
|
135
136
|
const href = parseWebsiteLinkTarget(componentReader.valueNode("link-to"), pageSlugs);
|
|
136
137
|
if (boundElementPropertyUuid == null && href == null) throw new Error(formatComponentError("Bound element or href not found", "advanced-search", elementResource), { cause: componentProperty });
|
|
138
|
+
const prominentPropertyVariable = componentReader.valueNode("prominent-property-variable");
|
|
139
|
+
if (prominentPropertyVariable != null && (prominentPropertyVariable.uuid == null || normalizeItemCategory(prominentPropertyVariable.category ?? void 0) !== "propertyVariable")) throw new Error(formatComponentError("Prominent property variable must link to a property variable", "advanced-search", elementResource), { cause: prominentPropertyVariable });
|
|
137
140
|
const filter = { ...ADVANCED_SEARCH_FILTER_DEFAULTS };
|
|
138
141
|
componentReader.readAll(filter, {
|
|
139
142
|
sidebarSort: "filter-sidebar-sort",
|
|
@@ -144,6 +147,7 @@ function parseAdvancedSearchComponent(parameters) {
|
|
|
144
147
|
component: "advanced-search",
|
|
145
148
|
boundElementUuid: boundElementPropertyUuid,
|
|
146
149
|
href,
|
|
150
|
+
prominentPropertyVariableUuid: prominentPropertyVariable?.uuid ?? null,
|
|
147
151
|
filter,
|
|
148
152
|
options: parseWebsiteOptions(elementResource.options, options)
|
|
149
153
|
};
|
|
@@ -267,8 +271,8 @@ const COLLECTION_FILTER_DEFAULTS = {
|
|
|
267
271
|
isLimitedToLeafPropertyValues: false,
|
|
268
272
|
isSidebarDisplayed: false,
|
|
269
273
|
sidebarSort: "default",
|
|
270
|
-
isSidebarHelpTooltipsDisplayed:
|
|
271
|
-
isSidebarResultCountsDisplayed:
|
|
274
|
+
isSidebarHelpTooltipsDisplayed: true,
|
|
275
|
+
isSidebarResultCountsDisplayed: true
|
|
272
276
|
};
|
|
273
277
|
function parseCollectionComponent(parameters) {
|
|
274
278
|
const { componentProperty, componentReader, elementResource, websiteLinks, options } = parameters;
|
package/dist/types/website.d.mts
CHANGED
|
@@ -297,6 +297,7 @@ export type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
|
|
|
297
297
|
component: "advanced-search";
|
|
298
298
|
boundElementUuid: string | null;
|
|
299
299
|
href: string | null;
|
|
300
|
+
prominentPropertyVariableUuid: string | null;
|
|
300
301
|
filter: {
|
|
301
302
|
sidebarSort: "default" | "alphabetical";
|
|
302
303
|
isSidebarHelpTooltipsDisplayed: boolean;
|