ochre-sdk 1.3.11 → 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";
@@ -134,6 +135,8 @@ function parseAdvancedSearchComponent(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
  };
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
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",