@digitalculture/ochre-sdk 0.3.3 → 0.3.5
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 +13 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -0
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -1667,7 +1667,12 @@ async function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1667
1667
|
if (variant === null) {
|
|
1668
1668
|
variant = "block";
|
|
1669
1669
|
}
|
|
1670
|
+
const heading = getPropertyValueByLabel(
|
|
1671
|
+
componentProperty.properties,
|
|
1672
|
+
"heading"
|
|
1673
|
+
);
|
|
1670
1674
|
properties.variant = variant;
|
|
1675
|
+
properties.heading = heading;
|
|
1671
1676
|
properties.content = document.content;
|
|
1672
1677
|
break;
|
|
1673
1678
|
}
|
|
@@ -1884,6 +1889,7 @@ async function parseWebpage(webpageResource) {
|
|
|
1884
1889
|
let displayedInHeader = true;
|
|
1885
1890
|
let width = "default";
|
|
1886
1891
|
let variant = "default";
|
|
1892
|
+
let isSidebarDisplayed = true;
|
|
1887
1893
|
const webpageSubProperties = webpageProperties.find(
|
|
1888
1894
|
(property) => property.label === "presentation" && property.values[0]?.content === "page"
|
|
1889
1895
|
)?.properties;
|
|
@@ -1906,6 +1912,12 @@ async function parseWebpage(webpageResource) {
|
|
|
1906
1912
|
if (variantProperty) {
|
|
1907
1913
|
variant = variantProperty.content;
|
|
1908
1914
|
}
|
|
1915
|
+
const isSidebarDisplayedProperty = webpageSubProperties.find(
|
|
1916
|
+
(property) => property.label === "sidebar-visible"
|
|
1917
|
+
)?.values[0];
|
|
1918
|
+
if (isSidebarDisplayedProperty) {
|
|
1919
|
+
isSidebarDisplayed = isSidebarDisplayedProperty.content === "Yes";
|
|
1920
|
+
}
|
|
1909
1921
|
}
|
|
1910
1922
|
const cssStyleSubProperties = webpageProperties.find(
|
|
1911
1923
|
(property) => property.label === "presentation" && property.values[0]?.content === "css"
|
|
@@ -1928,6 +1940,7 @@ async function parseWebpage(webpageResource) {
|
|
|
1928
1940
|
width,
|
|
1929
1941
|
variant,
|
|
1930
1942
|
backgroundImageUrl: imageLink ? `https://ochre.lib.uchicago.edu/ochre?uuid=${imageLink.uuid}&load` : null,
|
|
1943
|
+
isSidebarDisplayed,
|
|
1931
1944
|
cssStyles
|
|
1932
1945
|
},
|
|
1933
1946
|
webpages
|
package/dist/index.d.cts
CHANGED
|
@@ -449,6 +449,7 @@ type WebpageProperties = {
|
|
|
449
449
|
width: "full" | "large" | "narrow" | "default";
|
|
450
450
|
variant: "default" | "no-background";
|
|
451
451
|
backgroundImageUrl: string | null;
|
|
452
|
+
isSidebarDisplayed: boolean;
|
|
452
453
|
cssStyles: Array<Style>;
|
|
453
454
|
};
|
|
454
455
|
/**
|
|
@@ -534,6 +535,7 @@ type WebElementComponent = {
|
|
|
534
535
|
} | {
|
|
535
536
|
component: "text";
|
|
536
537
|
variant: "title" | "block" | "banner";
|
|
538
|
+
heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
|
|
537
539
|
content: string;
|
|
538
540
|
} | {
|
|
539
541
|
component: "text-image";
|
package/dist/index.d.ts
CHANGED
|
@@ -449,6 +449,7 @@ type WebpageProperties = {
|
|
|
449
449
|
width: "full" | "large" | "narrow" | "default";
|
|
450
450
|
variant: "default" | "no-background";
|
|
451
451
|
backgroundImageUrl: string | null;
|
|
452
|
+
isSidebarDisplayed: boolean;
|
|
452
453
|
cssStyles: Array<Style>;
|
|
453
454
|
};
|
|
454
455
|
/**
|
|
@@ -534,6 +535,7 @@ type WebElementComponent = {
|
|
|
534
535
|
} | {
|
|
535
536
|
component: "text";
|
|
536
537
|
variant: "title" | "block" | "banner";
|
|
538
|
+
heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
|
|
537
539
|
content: string;
|
|
538
540
|
} | {
|
|
539
541
|
component: "text-image";
|
package/dist/index.js
CHANGED
|
@@ -1589,7 +1589,12 @@ async function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1589
1589
|
if (variant === null) {
|
|
1590
1590
|
variant = "block";
|
|
1591
1591
|
}
|
|
1592
|
+
const heading = getPropertyValueByLabel(
|
|
1593
|
+
componentProperty.properties,
|
|
1594
|
+
"heading"
|
|
1595
|
+
);
|
|
1592
1596
|
properties.variant = variant;
|
|
1597
|
+
properties.heading = heading;
|
|
1593
1598
|
properties.content = document.content;
|
|
1594
1599
|
break;
|
|
1595
1600
|
}
|
|
@@ -1806,6 +1811,7 @@ async function parseWebpage(webpageResource) {
|
|
|
1806
1811
|
let displayedInHeader = true;
|
|
1807
1812
|
let width = "default";
|
|
1808
1813
|
let variant = "default";
|
|
1814
|
+
let isSidebarDisplayed = true;
|
|
1809
1815
|
const webpageSubProperties = webpageProperties.find(
|
|
1810
1816
|
(property) => property.label === "presentation" && property.values[0]?.content === "page"
|
|
1811
1817
|
)?.properties;
|
|
@@ -1828,6 +1834,12 @@ async function parseWebpage(webpageResource) {
|
|
|
1828
1834
|
if (variantProperty) {
|
|
1829
1835
|
variant = variantProperty.content;
|
|
1830
1836
|
}
|
|
1837
|
+
const isSidebarDisplayedProperty = webpageSubProperties.find(
|
|
1838
|
+
(property) => property.label === "sidebar-visible"
|
|
1839
|
+
)?.values[0];
|
|
1840
|
+
if (isSidebarDisplayedProperty) {
|
|
1841
|
+
isSidebarDisplayed = isSidebarDisplayedProperty.content === "Yes";
|
|
1842
|
+
}
|
|
1831
1843
|
}
|
|
1832
1844
|
const cssStyleSubProperties = webpageProperties.find(
|
|
1833
1845
|
(property) => property.label === "presentation" && property.values[0]?.content === "css"
|
|
@@ -1850,6 +1862,7 @@ async function parseWebpage(webpageResource) {
|
|
|
1850
1862
|
width,
|
|
1851
1863
|
variant,
|
|
1852
1864
|
backgroundImageUrl: imageLink ? `https://ochre.lib.uchicago.edu/ochre?uuid=${imageLink.uuid}&load` : null,
|
|
1865
|
+
isSidebarDisplayed,
|
|
1853
1866
|
cssStyles
|
|
1854
1867
|
},
|
|
1855
1868
|
webpages
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalculture/ochre-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
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",
|
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"iso-639-3": "^3.0.1",
|
|
44
|
-
"zod": "^3.24.
|
|
44
|
+
"zod": "^3.24.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@antfu/eslint-config": "^4.
|
|
47
|
+
"@antfu/eslint-config": "^4.3.0",
|
|
48
48
|
"@arethetypeswrong/cli": "^0.17.3",
|
|
49
|
-
"@changesets/cli": "^2.
|
|
49
|
+
"@changesets/cli": "^2.28.0",
|
|
50
50
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
51
|
-
"@types/node": "^22.13.
|
|
52
|
-
"eslint": "^9.
|
|
51
|
+
"@types/node": "^22.13.4",
|
|
52
|
+
"eslint": "^9.20.1",
|
|
53
53
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
54
|
-
"prettier": "^3.
|
|
54
|
+
"prettier": "^3.5.1",
|
|
55
55
|
"tsup": "^8.3.6",
|
|
56
56
|
"typescript": "^5.7.3",
|
|
57
|
-
"vitest": "^3.0.
|
|
57
|
+
"vitest": "^3.0.6"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"dev": "tsup src/index.ts --watch",
|