@digitalculture/ochre-sdk 0.12.11 → 0.12.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.
package/dist/index.d.mts CHANGED
@@ -559,36 +559,39 @@ type Website = {
559
559
  isHeaderProjectDisplayed: boolean;
560
560
  isFooterDisplayed: boolean;
561
561
  isSidebarDisplayed: boolean;
562
- headerSearchButtonPageSlug: string | null;
562
+ headerSearchBarPageSlug: string | null;
563
563
  iiifViewer: "universal-viewer" | "clover";
564
564
  supportsThemeToggle: boolean;
565
565
  defaultTheme: "light" | "dark" | null;
566
566
  logoUrl: string | null;
567
567
  };
568
568
  };
569
+ /**
570
+ * Represents a webpage with its title, slug, properties, items and subpages
571
+ */
569
572
  type Webpage = {
570
573
  title: string;
571
574
  slug: string;
572
- properties: WebpageProperties;
575
+ properties: {
576
+ displayedInHeader: boolean;
577
+ width: "full" | "large" | "narrow" | "default";
578
+ variant: "default" | "no-background";
579
+ backgroundImageUrl: string | null;
580
+ isBreadcrumbsDisplayed: boolean;
581
+ isSidebarDisplayed: boolean;
582
+ isHeaderSearchBarDisplayed: boolean;
583
+ cssStyles: {
584
+ default: Array<Style>;
585
+ tablet: Array<Style>;
586
+ mobile: Array<Style>;
587
+ };
588
+ };
573
589
  items: Array<WebElement | WebBlock>;
574
590
  webpages: Array<Webpage>;
575
591
  };
576
592
  /**
577
- * Properties for configuring webpage display and styling
593
+ * Represents a title with its label and variant
578
594
  */
579
- type WebpageProperties = {
580
- displayedInHeader: boolean;
581
- width: "full" | "large" | "narrow" | "default";
582
- variant: "default" | "no-background";
583
- backgroundImageUrl: string | null;
584
- isBreadcrumbsDisplayed: boolean;
585
- isSidebarDisplayed: boolean;
586
- cssStyles: {
587
- default: Array<Style>;
588
- tablet: Array<Style>;
589
- mobile: Array<Style>;
590
- };
591
- };
592
595
  type WebTitle = {
593
596
  label: string;
594
597
  variant: "default" | "simple";
@@ -1204,4 +1207,4 @@ declare function filterProperties(property: Property, filter: {
1204
1207
  value: string | number | boolean | Date;
1205
1208
  }, options?: PropertyOptions): boolean;
1206
1209
  //#endregion
1207
- export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinates, CoordinatesItem, Data, DataCategory, Event, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyQueryItem, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, UuidMetadata, WebBlock, WebBlockLayout, WebElement, WebElementComponent, WebImage, WebTitle, Webpage, WebpageProperties, Website, fetchByUuidMetadata, fetchGallery, fetchItem, fetchPropertyQuery, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
1210
+ export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinates, CoordinatesItem, Data, DataCategory, Event, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyQueryItem, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, UuidMetadata, WebBlock, WebBlockLayout, WebElement, WebElementComponent, WebImage, WebTitle, Webpage, Website, fetchByUuidMetadata, fetchGallery, fetchItem, fetchPropertyQuery, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
package/dist/index.mjs CHANGED
@@ -2257,6 +2257,7 @@ function parseWebpage(webpageResource) {
2257
2257
  let variant = "default";
2258
2258
  let isSidebarDisplayed = true;
2259
2259
  let isBreadcrumbsDisplayed = false;
2260
+ let isHeaderSearchBarDisplayed = true;
2260
2261
  const webpageSubProperties = webpageProperties.find((property) => property.label === "presentation" && property.values[0]?.content === "page")?.properties;
2261
2262
  if (webpageSubProperties) {
2262
2263
  const headerProperty = webpageSubProperties.find((property) => property.label === "header")?.values[0];
@@ -2265,10 +2266,12 @@ function parseWebpage(webpageResource) {
2265
2266
  if (widthProperty) width = widthProperty.content;
2266
2267
  const variantProperty = webpageSubProperties.find((property) => property.label === "variant")?.values[0];
2267
2268
  if (variantProperty) variant = variantProperty.content;
2268
- const isSidebarDisplayedProperty = webpageSubProperties.find((property) => property.label === "sidebar-visible")?.values[0];
2269
+ const isSidebarDisplayedProperty = webpageSubProperties.find((property) => property.label === "sidebar-displayed")?.values[0];
2269
2270
  if (isSidebarDisplayedProperty) isSidebarDisplayed = isSidebarDisplayedProperty.content === true;
2270
- const isBreadcrumbsDisplayedProperty = webpageSubProperties.find((property) => property.label === "breadcrumbs-visible")?.values[0];
2271
+ const isBreadcrumbsDisplayedProperty = webpageSubProperties.find((property) => property.label === "breadcrumbs-displayed")?.values[0];
2271
2272
  if (isBreadcrumbsDisplayedProperty) isBreadcrumbsDisplayed = isBreadcrumbsDisplayedProperty.content === true;
2273
+ const isHeaderSearchBarDisplayedProperty = webpageSubProperties.find((property) => property.label === "header-search-bar-displayed")?.values[0];
2274
+ if (isHeaderSearchBarDisplayedProperty) isHeaderSearchBarDisplayed = isHeaderSearchBarDisplayedProperty.content === true;
2272
2275
  }
2273
2276
  const cssStyleSubProperties = webpageProperties.find((property) => property.label === "presentation" && property.values[0]?.content === "css")?.properties;
2274
2277
  const cssStyles = [];
@@ -2299,6 +2302,7 @@ function parseWebpage(webpageResource) {
2299
2302
  backgroundImageUrl: imageLink ? `https://ochre.lib.uchicago.edu/ochre?uuid=${imageLink.uuid}&load` : null,
2300
2303
  isSidebarDisplayed,
2301
2304
  isBreadcrumbsDisplayed,
2305
+ isHeaderSearchBarDisplayed,
2302
2306
  cssStyles: {
2303
2307
  default: cssStyles,
2304
2308
  tablet: cssStylesTablet,
@@ -2635,19 +2639,19 @@ function parseWebsiteProperties(properties) {
2635
2639
  let iiifViewer = "universal-viewer";
2636
2640
  let supportsThemeToggle = true;
2637
2641
  let defaultTheme = null;
2638
- const headerProperty = websiteProperties.find((property) => property.label === "navbar-visible")?.values[0];
2642
+ const headerProperty = websiteProperties.find((property) => property.label === "navbar-displayed")?.values[0];
2639
2643
  if (headerProperty) isHeaderDisplayed = headerProperty.content === true;
2640
2644
  const headerVariantProperty = websiteProperties.find((property) => property.label === "navbar-variant")?.values[0];
2641
2645
  if (headerVariantProperty) headerVariant = headerVariantProperty.content;
2642
2646
  const headerAlignmentProperty = websiteProperties.find((property) => property.label === "navbar-alignment")?.values[0];
2643
2647
  if (headerAlignmentProperty) headerAlignment = headerAlignmentProperty.content;
2644
- const isHeaderProjectDisplayedProperty = websiteProperties.find((property) => property.label === "navbar-project-visible")?.values[0];
2648
+ const isHeaderProjectDisplayedProperty = websiteProperties.find((property) => property.label === "navbar-project-displayed")?.values[0];
2645
2649
  if (isHeaderProjectDisplayedProperty) isHeaderProjectDisplayed = isHeaderProjectDisplayedProperty.content === true;
2646
- const footerProperty = websiteProperties.find((property) => property.label === "footer-visible")?.values[0];
2650
+ const footerProperty = websiteProperties.find((property) => property.label === "footer-displayed")?.values[0];
2647
2651
  if (footerProperty) isFooterDisplayed = footerProperty.content === true;
2648
- const sidebarProperty = websiteProperties.find((property) => property.label === "sidebar-visible")?.values[0];
2652
+ const sidebarProperty = websiteProperties.find((property) => property.label === "sidebar-displayed")?.values[0];
2649
2653
  if (sidebarProperty) isSidebarDisplayed = sidebarProperty.content === true;
2650
- const headerSearchButtonPageSlug = websiteProperties.find((property) => property.label === "navbar-search-button-page")?.values[0]?.content?.toString() ?? null;
2654
+ const headerSearchBarPageSlug = websiteProperties.find((property) => property.label === "navbar-search-bar-page")?.values[0]?.content?.toString() ?? null;
2651
2655
  const iiifViewerProperty = websiteProperties.find((property) => property.label === "iiif-viewer")?.values[0];
2652
2656
  if (iiifViewerProperty) iiifViewer = iiifViewerProperty.content;
2653
2657
  const supportsThemeToggleProperty = websiteProperties.find((property) => property.label === "supports-theme-toggle")?.values[0];
@@ -2666,7 +2670,7 @@ function parseWebsiteProperties(properties) {
2666
2670
  isHeaderProjectDisplayed,
2667
2671
  isFooterDisplayed,
2668
2672
  isSidebarDisplayed,
2669
- headerSearchButtonPageSlug,
2673
+ headerSearchBarPageSlug,
2670
2674
  iiifViewer,
2671
2675
  supportsThemeToggle,
2672
2676
  defaultTheme,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.12.11",
3
+ "version": "0.12.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",