@digitalculture/ochre-sdk 0.5.8 → 0.5.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.cjs CHANGED
@@ -577,7 +577,6 @@ var componentSchema = import_zod3.z.enum(
577
577
  "network-graph",
578
578
  "table",
579
579
  "text",
580
- "text-image",
581
580
  "timeline",
582
581
  "video"
583
582
  ],
@@ -1747,67 +1746,6 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1747
1746
  properties.content = document.content;
1748
1747
  break;
1749
1748
  }
1750
- case "text-image": {
1751
- if (!document) {
1752
- throw new Error(
1753
- `Document not found for the following component: \u201C${componentName}\u201D`
1754
- );
1755
- }
1756
- let variant = getPropertyValueByLabel(
1757
- componentProperty.properties,
1758
- "variant"
1759
- );
1760
- variant ??= "block";
1761
- let layout = getPropertyValueByLabel(
1762
- componentProperty.properties,
1763
- "layout"
1764
- );
1765
- layout ??= "image-start";
1766
- let captionLayout = getPropertyValueByLabel(
1767
- componentProperty.properties,
1768
- "layout-caption"
1769
- );
1770
- captionLayout ??= "bottom";
1771
- const imageLink = links.find(
1772
- (link) => link.type === "image" || link.type === "IIIF"
1773
- );
1774
- if (!imageLink) {
1775
- throw new Error(
1776
- `Image link not found for the following component: \u201C${componentName}\u201D: ${JSON.stringify(
1777
- links
1778
- )}`
1779
- );
1780
- }
1781
- let imageQuality = getPropertyValueByLabel(
1782
- componentProperty.properties,
1783
- "image-quality"
1784
- );
1785
- imageQuality ??= "high";
1786
- let captionSource = getPropertyValueByLabel(
1787
- componentProperty.properties,
1788
- "caption-source"
1789
- );
1790
- captionSource ??= "name";
1791
- let altTextSource = getPropertyValueByLabel(
1792
- componentProperty.properties,
1793
- "alt-text-source"
1794
- );
1795
- altTextSource ??= "name";
1796
- properties.variant = variant;
1797
- properties.image = {
1798
- url: `https://ochre.lib.uchicago.edu/ochre?uuid=${imageLink.uuid}&preview`,
1799
- label: imageLink.identification?.label ?? null,
1800
- width: imageLink.image?.width ?? 0,
1801
- height: imageLink.image?.height ?? 0
1802
- };
1803
- properties.imageQuality = imageQuality;
1804
- properties.layout = layout;
1805
- properties.captionSource = captionSource;
1806
- properties.captionLayout = captionLayout;
1807
- properties.altTextSource = altTextSource;
1808
- properties.content = document.content;
1809
- break;
1810
- }
1811
1749
  case "timeline": {
1812
1750
  const timelineLink = links.find((link) => link.category === "tree");
1813
1751
  if (!timelineLink) {
package/dist/index.d.cts CHANGED
@@ -559,16 +559,6 @@ type WebElementComponent = {
559
559
  variant: "title" | "block" | "banner";
560
560
  heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
561
561
  content: string;
562
- } | {
563
- component: "text-image";
564
- variant: "title" | "block" | "banner";
565
- image: WebImage;
566
- imageQuality: "high" | "low";
567
- layout: "image-top" | "image-bottom" | "image-start" | "image-end" | "image-background";
568
- captionSource: "name" | "abbreviation" | "description";
569
- captionLayout: "top" | "bottom" | "suppress";
570
- altTextSource: "name" | "abbreviation" | "description";
571
- content: string;
572
562
  } | {
573
563
  component: "timeline";
574
564
  timelineId: string;
package/dist/index.d.ts CHANGED
@@ -559,16 +559,6 @@ type WebElementComponent = {
559
559
  variant: "title" | "block" | "banner";
560
560
  heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
561
561
  content: string;
562
- } | {
563
- component: "text-image";
564
- variant: "title" | "block" | "banner";
565
- image: WebImage;
566
- imageQuality: "high" | "low";
567
- layout: "image-top" | "image-bottom" | "image-start" | "image-end" | "image-background";
568
- captionSource: "name" | "abbreviation" | "description";
569
- captionLayout: "top" | "bottom" | "suppress";
570
- altTextSource: "name" | "abbreviation" | "description";
571
- content: string;
572
562
  } | {
573
563
  component: "timeline";
574
564
  timelineId: string;
package/dist/index.js CHANGED
@@ -500,7 +500,6 @@ var componentSchema = z3.enum(
500
500
  "network-graph",
501
501
  "table",
502
502
  "text",
503
- "text-image",
504
503
  "timeline",
505
504
  "video"
506
505
  ],
@@ -1670,67 +1669,6 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1670
1669
  properties.content = document.content;
1671
1670
  break;
1672
1671
  }
1673
- case "text-image": {
1674
- if (!document) {
1675
- throw new Error(
1676
- `Document not found for the following component: \u201C${componentName}\u201D`
1677
- );
1678
- }
1679
- let variant = getPropertyValueByLabel(
1680
- componentProperty.properties,
1681
- "variant"
1682
- );
1683
- variant ??= "block";
1684
- let layout = getPropertyValueByLabel(
1685
- componentProperty.properties,
1686
- "layout"
1687
- );
1688
- layout ??= "image-start";
1689
- let captionLayout = getPropertyValueByLabel(
1690
- componentProperty.properties,
1691
- "layout-caption"
1692
- );
1693
- captionLayout ??= "bottom";
1694
- const imageLink = links.find(
1695
- (link) => link.type === "image" || link.type === "IIIF"
1696
- );
1697
- if (!imageLink) {
1698
- throw new Error(
1699
- `Image link not found for the following component: \u201C${componentName}\u201D: ${JSON.stringify(
1700
- links
1701
- )}`
1702
- );
1703
- }
1704
- let imageQuality = getPropertyValueByLabel(
1705
- componentProperty.properties,
1706
- "image-quality"
1707
- );
1708
- imageQuality ??= "high";
1709
- let captionSource = getPropertyValueByLabel(
1710
- componentProperty.properties,
1711
- "caption-source"
1712
- );
1713
- captionSource ??= "name";
1714
- let altTextSource = getPropertyValueByLabel(
1715
- componentProperty.properties,
1716
- "alt-text-source"
1717
- );
1718
- altTextSource ??= "name";
1719
- properties.variant = variant;
1720
- properties.image = {
1721
- url: `https://ochre.lib.uchicago.edu/ochre?uuid=${imageLink.uuid}&preview`,
1722
- label: imageLink.identification?.label ?? null,
1723
- width: imageLink.image?.width ?? 0,
1724
- height: imageLink.image?.height ?? 0
1725
- };
1726
- properties.imageQuality = imageQuality;
1727
- properties.layout = layout;
1728
- properties.captionSource = captionSource;
1729
- properties.captionLayout = captionLayout;
1730
- properties.altTextSource = altTextSource;
1731
- properties.content = document.content;
1732
- break;
1733
- }
1734
1672
  case "timeline": {
1735
1673
  const timelineLink = links.find((link) => link.category === "tree");
1736
1674
  if (!timelineLink) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.5.8",
3
+ "version": "0.5.9",
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",