@digitalculture/ochre-sdk 0.4.15 → 0.5.0
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/README.md +1 -1
- package/dist/index.cjs +60 -80
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +60 -80
- package/package.json +7 -7
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -76,7 +76,6 @@ __export(index_exports, {
|
|
|
76
76
|
module.exports = __toCommonJS(index_exports);
|
|
77
77
|
|
|
78
78
|
// src/utils/parse.ts
|
|
79
|
-
var import_uuid = require("uuid");
|
|
80
79
|
var import_zod3 = require("zod");
|
|
81
80
|
|
|
82
81
|
// src/utils/fetchers/generic.ts
|
|
@@ -1307,10 +1306,7 @@ var parseWebpageResources = async (webpageResources, type) => {
|
|
|
1307
1306
|
if (!resourceProperty) continue;
|
|
1308
1307
|
switch (type) {
|
|
1309
1308
|
case "element": {
|
|
1310
|
-
const element = await parseWebElement(
|
|
1311
|
-
resource,
|
|
1312
|
-
resourceProperty.properties
|
|
1313
|
-
);
|
|
1309
|
+
const element = await parseWebElement(resource);
|
|
1314
1310
|
returnElements.push(
|
|
1315
1311
|
element
|
|
1316
1312
|
);
|
|
@@ -1837,9 +1833,20 @@ async function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1837
1833
|
}
|
|
1838
1834
|
return properties;
|
|
1839
1835
|
}
|
|
1840
|
-
async function parseWebElement(elementResource
|
|
1836
|
+
async function parseWebElement(elementResource) {
|
|
1841
1837
|
const identification = parseIdentification(elementResource.identification);
|
|
1842
|
-
const
|
|
1838
|
+
const elementProperties = elementResource.properties?.property ? parseProperties(
|
|
1839
|
+
Array.isArray(elementResource.properties.property) ? elementResource.properties.property : [elementResource.properties.property]
|
|
1840
|
+
) : [];
|
|
1841
|
+
const presentationProperty = elementProperties.find(
|
|
1842
|
+
(property) => property.label === "presentation"
|
|
1843
|
+
);
|
|
1844
|
+
if (!presentationProperty) {
|
|
1845
|
+
throw new Error(
|
|
1846
|
+
`Presentation property not found for element \u201C${identification.label}\u201D`
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1849
|
+
const componentProperty = presentationProperty.properties.find(
|
|
1843
1850
|
(property) => property.label === "component"
|
|
1844
1851
|
);
|
|
1845
1852
|
if (!componentProperty) {
|
|
@@ -1903,6 +1910,7 @@ async function parseWebElement(elementResource, elementProperties) {
|
|
|
1903
1910
|
}
|
|
1904
1911
|
return {
|
|
1905
1912
|
uuid: elementResource.uuid,
|
|
1913
|
+
type: "element",
|
|
1906
1914
|
title: {
|
|
1907
1915
|
label: identification.label,
|
|
1908
1916
|
variant,
|
|
@@ -1937,8 +1945,7 @@ async function parseWebpage(webpageResource) {
|
|
|
1937
1945
|
(link) => link.type === "image" || link.type === "IIIF"
|
|
1938
1946
|
);
|
|
1939
1947
|
const webpageResources = webpageResource.resource ? Array.isArray(webpageResource.resource) ? webpageResource.resource : [webpageResource.resource] : [];
|
|
1940
|
-
const
|
|
1941
|
-
let elementsToHandle = [];
|
|
1948
|
+
const items = [];
|
|
1942
1949
|
for (const resource of webpageResources) {
|
|
1943
1950
|
const resourceProperties = resource.properties ? parseProperties(
|
|
1944
1951
|
Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
|
|
@@ -1950,55 +1957,21 @@ async function parseWebpage(webpageResource) {
|
|
|
1950
1957
|
if (!resourceType) {
|
|
1951
1958
|
continue;
|
|
1952
1959
|
}
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
);
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
elements,
|
|
1966
|
-
properties: {
|
|
1967
|
-
spacing: void 0,
|
|
1968
|
-
gap: void 0,
|
|
1969
|
-
alignItems: "start",
|
|
1970
|
-
justifyContent: "stretch"
|
|
1971
|
-
},
|
|
1972
|
-
propertiesMobile: null,
|
|
1973
|
-
cssStyles: [],
|
|
1974
|
-
cssStylesMobile: []
|
|
1975
|
-
};
|
|
1976
|
-
blocks.push(block);
|
|
1977
|
-
elementsToHandle = [];
|
|
1960
|
+
switch (resourceType) {
|
|
1961
|
+
case "element": {
|
|
1962
|
+
const element = await parseWebElement(resource);
|
|
1963
|
+
items.push(element);
|
|
1964
|
+
break;
|
|
1965
|
+
}
|
|
1966
|
+
case "block": {
|
|
1967
|
+
const block = await parseBlock(resource);
|
|
1968
|
+
if (block) {
|
|
1969
|
+
items.push(block);
|
|
1970
|
+
}
|
|
1971
|
+
break;
|
|
1978
1972
|
}
|
|
1979
|
-
const parsedBlocks = await parseWebpageResources([resource], "block");
|
|
1980
|
-
blocks.push(...parsedBlocks);
|
|
1981
1973
|
}
|
|
1982
1974
|
}
|
|
1983
|
-
if (elementsToHandle.length > 0) {
|
|
1984
|
-
const elements = await parseWebpageResources(elementsToHandle, "element");
|
|
1985
|
-
const block = {
|
|
1986
|
-
uuid: (0, import_uuid.v4)(),
|
|
1987
|
-
layout: "vertical",
|
|
1988
|
-
blocks: [],
|
|
1989
|
-
elements,
|
|
1990
|
-
properties: {
|
|
1991
|
-
spacing: void 0,
|
|
1992
|
-
gap: void 0,
|
|
1993
|
-
alignItems: "start",
|
|
1994
|
-
justifyContent: "stretch"
|
|
1995
|
-
},
|
|
1996
|
-
propertiesMobile: null,
|
|
1997
|
-
cssStyles: [],
|
|
1998
|
-
cssStylesMobile: []
|
|
1999
|
-
};
|
|
2000
|
-
blocks.push(block);
|
|
2001
|
-
}
|
|
2002
1975
|
const webpages = webpageResource.resource ? await parseWebpageResources(
|
|
2003
1976
|
Array.isArray(webpageResource.resource) ? webpageResource.resource : [webpageResource.resource],
|
|
2004
1977
|
"page"
|
|
@@ -2063,7 +2036,7 @@ async function parseWebpage(webpageResource) {
|
|
|
2063
2036
|
return {
|
|
2064
2037
|
title: identification.label,
|
|
2065
2038
|
slug,
|
|
2066
|
-
|
|
2039
|
+
items,
|
|
2067
2040
|
properties: {
|
|
2068
2041
|
displayedInHeader,
|
|
2069
2042
|
width,
|
|
@@ -2090,9 +2063,9 @@ async function parseWebpages(webpageResources) {
|
|
|
2090
2063
|
async function parseBlock(blockResource) {
|
|
2091
2064
|
const returnBlock = {
|
|
2092
2065
|
uuid: blockResource.uuid,
|
|
2066
|
+
type: "block",
|
|
2093
2067
|
layout: "vertical",
|
|
2094
|
-
|
|
2095
|
-
elements: [],
|
|
2068
|
+
items: [],
|
|
2096
2069
|
properties: {
|
|
2097
2070
|
spacing: void 0,
|
|
2098
2071
|
gap: void 0,
|
|
@@ -2152,20 +2125,35 @@ async function parseBlock(blockResource) {
|
|
|
2152
2125
|
returnBlock.propertiesMobile = propertiesMobile;
|
|
2153
2126
|
}
|
|
2154
2127
|
}
|
|
2155
|
-
const
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2128
|
+
const blockResources = blockResource.resource ? Array.isArray(blockResource.resource) ? blockResource.resource : [blockResource.resource] : [];
|
|
2129
|
+
const blockItems = [];
|
|
2130
|
+
for (const resource of blockResources) {
|
|
2131
|
+
const resourceProperties = resource.properties ? parseProperties(
|
|
2132
|
+
Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
|
|
2133
|
+
) : [];
|
|
2134
|
+
const resourceType = getPropertyValueByLabel(
|
|
2135
|
+
resourceProperties,
|
|
2136
|
+
"presentation"
|
|
2137
|
+
);
|
|
2138
|
+
if (!resourceType) {
|
|
2139
|
+
continue;
|
|
2140
|
+
}
|
|
2141
|
+
switch (resourceType) {
|
|
2142
|
+
case "element": {
|
|
2143
|
+
const element = await parseWebElement(resource);
|
|
2144
|
+
blockItems.push(element);
|
|
2145
|
+
break;
|
|
2146
|
+
}
|
|
2147
|
+
case "block": {
|
|
2148
|
+
const block = await parseBlock(resource);
|
|
2149
|
+
if (block) {
|
|
2150
|
+
blockItems.push(block);
|
|
2151
|
+
}
|
|
2152
|
+
break;
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2168
2155
|
}
|
|
2156
|
+
returnBlock.items = blockItems;
|
|
2169
2157
|
const blockCssStyles = blockProperties.find(
|
|
2170
2158
|
(property) => property.label === "presentation" && property.values[0]?.content === "css"
|
|
2171
2159
|
)?.properties;
|
|
@@ -2399,15 +2387,7 @@ async function parseWebsite(websiteTree, projectName, website) {
|
|
|
2399
2387
|
}
|
|
2400
2388
|
const sidebarResources = sidebarResource.resource ? Array.isArray(sidebarResource.resource) ? sidebarResource.resource : [sidebarResource.resource] : [];
|
|
2401
2389
|
for (const resource of sidebarResources) {
|
|
2402
|
-
const
|
|
2403
|
-
Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
|
|
2404
|
-
) : [];
|
|
2405
|
-
const element = await parseWebElement(
|
|
2406
|
-
resource,
|
|
2407
|
-
sidebarResourceProperties.find(
|
|
2408
|
-
(property) => property.label === "presentation" && property.values[0]?.content === "element"
|
|
2409
|
-
)?.properties ?? []
|
|
2410
|
-
);
|
|
2390
|
+
const element = await parseWebElement(resource);
|
|
2411
2391
|
sidebarElements.push(element);
|
|
2412
2392
|
}
|
|
2413
2393
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -440,7 +440,7 @@ type Webpage = {
|
|
|
440
440
|
title: string;
|
|
441
441
|
slug: string;
|
|
442
442
|
properties: WebpageProperties;
|
|
443
|
-
|
|
443
|
+
items: Array<WebElement | WebBlock>;
|
|
444
444
|
webpages: Array<Webpage>;
|
|
445
445
|
};
|
|
446
446
|
/**
|
|
@@ -460,6 +460,7 @@ type WebpageProperties = {
|
|
|
460
460
|
*/
|
|
461
461
|
type WebElement = {
|
|
462
462
|
uuid: string;
|
|
463
|
+
type: "element";
|
|
463
464
|
title: {
|
|
464
465
|
label: string;
|
|
465
466
|
variant: "default" | "simple";
|
|
@@ -588,9 +589,9 @@ type Style = {
|
|
|
588
589
|
*/
|
|
589
590
|
type WebBlock = {
|
|
590
591
|
uuid: string;
|
|
592
|
+
type: "block";
|
|
591
593
|
layout: "vertical" | "horizontal" | "grid";
|
|
592
|
-
|
|
593
|
-
elements: Array<WebElement>;
|
|
594
|
+
items: Array<WebElement | WebBlock>;
|
|
594
595
|
properties: {
|
|
595
596
|
/**
|
|
596
597
|
* valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
|
package/dist/index.d.ts
CHANGED
|
@@ -440,7 +440,7 @@ type Webpage = {
|
|
|
440
440
|
title: string;
|
|
441
441
|
slug: string;
|
|
442
442
|
properties: WebpageProperties;
|
|
443
|
-
|
|
443
|
+
items: Array<WebElement | WebBlock>;
|
|
444
444
|
webpages: Array<Webpage>;
|
|
445
445
|
};
|
|
446
446
|
/**
|
|
@@ -460,6 +460,7 @@ type WebpageProperties = {
|
|
|
460
460
|
*/
|
|
461
461
|
type WebElement = {
|
|
462
462
|
uuid: string;
|
|
463
|
+
type: "element";
|
|
463
464
|
title: {
|
|
464
465
|
label: string;
|
|
465
466
|
variant: "default" | "simple";
|
|
@@ -588,9 +589,9 @@ type Style = {
|
|
|
588
589
|
*/
|
|
589
590
|
type WebBlock = {
|
|
590
591
|
uuid: string;
|
|
592
|
+
type: "block";
|
|
591
593
|
layout: "vertical" | "horizontal" | "grid";
|
|
592
|
-
|
|
593
|
-
elements: Array<WebElement>;
|
|
594
|
+
items: Array<WebElement | WebBlock>;
|
|
594
595
|
properties: {
|
|
595
596
|
/**
|
|
596
597
|
* valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/utils/parse.ts
|
|
2
|
-
import { v4 as uuidv4 } from "uuid";
|
|
3
2
|
import { z as z3 } from "zod";
|
|
4
3
|
|
|
5
4
|
// src/utils/fetchers/generic.ts
|
|
@@ -1230,10 +1229,7 @@ var parseWebpageResources = async (webpageResources, type) => {
|
|
|
1230
1229
|
if (!resourceProperty) continue;
|
|
1231
1230
|
switch (type) {
|
|
1232
1231
|
case "element": {
|
|
1233
|
-
const element = await parseWebElement(
|
|
1234
|
-
resource,
|
|
1235
|
-
resourceProperty.properties
|
|
1236
|
-
);
|
|
1232
|
+
const element = await parseWebElement(resource);
|
|
1237
1233
|
returnElements.push(
|
|
1238
1234
|
element
|
|
1239
1235
|
);
|
|
@@ -1760,9 +1756,20 @@ async function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1760
1756
|
}
|
|
1761
1757
|
return properties;
|
|
1762
1758
|
}
|
|
1763
|
-
async function parseWebElement(elementResource
|
|
1759
|
+
async function parseWebElement(elementResource) {
|
|
1764
1760
|
const identification = parseIdentification(elementResource.identification);
|
|
1765
|
-
const
|
|
1761
|
+
const elementProperties = elementResource.properties?.property ? parseProperties(
|
|
1762
|
+
Array.isArray(elementResource.properties.property) ? elementResource.properties.property : [elementResource.properties.property]
|
|
1763
|
+
) : [];
|
|
1764
|
+
const presentationProperty = elementProperties.find(
|
|
1765
|
+
(property) => property.label === "presentation"
|
|
1766
|
+
);
|
|
1767
|
+
if (!presentationProperty) {
|
|
1768
|
+
throw new Error(
|
|
1769
|
+
`Presentation property not found for element \u201C${identification.label}\u201D`
|
|
1770
|
+
);
|
|
1771
|
+
}
|
|
1772
|
+
const componentProperty = presentationProperty.properties.find(
|
|
1766
1773
|
(property) => property.label === "component"
|
|
1767
1774
|
);
|
|
1768
1775
|
if (!componentProperty) {
|
|
@@ -1826,6 +1833,7 @@ async function parseWebElement(elementResource, elementProperties) {
|
|
|
1826
1833
|
}
|
|
1827
1834
|
return {
|
|
1828
1835
|
uuid: elementResource.uuid,
|
|
1836
|
+
type: "element",
|
|
1829
1837
|
title: {
|
|
1830
1838
|
label: identification.label,
|
|
1831
1839
|
variant,
|
|
@@ -1860,8 +1868,7 @@ async function parseWebpage(webpageResource) {
|
|
|
1860
1868
|
(link) => link.type === "image" || link.type === "IIIF"
|
|
1861
1869
|
);
|
|
1862
1870
|
const webpageResources = webpageResource.resource ? Array.isArray(webpageResource.resource) ? webpageResource.resource : [webpageResource.resource] : [];
|
|
1863
|
-
const
|
|
1864
|
-
let elementsToHandle = [];
|
|
1871
|
+
const items = [];
|
|
1865
1872
|
for (const resource of webpageResources) {
|
|
1866
1873
|
const resourceProperties = resource.properties ? parseProperties(
|
|
1867
1874
|
Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
|
|
@@ -1873,55 +1880,21 @@ async function parseWebpage(webpageResource) {
|
|
|
1873
1880
|
if (!resourceType) {
|
|
1874
1881
|
continue;
|
|
1875
1882
|
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
);
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
elements,
|
|
1889
|
-
properties: {
|
|
1890
|
-
spacing: void 0,
|
|
1891
|
-
gap: void 0,
|
|
1892
|
-
alignItems: "start",
|
|
1893
|
-
justifyContent: "stretch"
|
|
1894
|
-
},
|
|
1895
|
-
propertiesMobile: null,
|
|
1896
|
-
cssStyles: [],
|
|
1897
|
-
cssStylesMobile: []
|
|
1898
|
-
};
|
|
1899
|
-
blocks.push(block);
|
|
1900
|
-
elementsToHandle = [];
|
|
1883
|
+
switch (resourceType) {
|
|
1884
|
+
case "element": {
|
|
1885
|
+
const element = await parseWebElement(resource);
|
|
1886
|
+
items.push(element);
|
|
1887
|
+
break;
|
|
1888
|
+
}
|
|
1889
|
+
case "block": {
|
|
1890
|
+
const block = await parseBlock(resource);
|
|
1891
|
+
if (block) {
|
|
1892
|
+
items.push(block);
|
|
1893
|
+
}
|
|
1894
|
+
break;
|
|
1901
1895
|
}
|
|
1902
|
-
const parsedBlocks = await parseWebpageResources([resource], "block");
|
|
1903
|
-
blocks.push(...parsedBlocks);
|
|
1904
1896
|
}
|
|
1905
1897
|
}
|
|
1906
|
-
if (elementsToHandle.length > 0) {
|
|
1907
|
-
const elements = await parseWebpageResources(elementsToHandle, "element");
|
|
1908
|
-
const block = {
|
|
1909
|
-
uuid: uuidv4(),
|
|
1910
|
-
layout: "vertical",
|
|
1911
|
-
blocks: [],
|
|
1912
|
-
elements,
|
|
1913
|
-
properties: {
|
|
1914
|
-
spacing: void 0,
|
|
1915
|
-
gap: void 0,
|
|
1916
|
-
alignItems: "start",
|
|
1917
|
-
justifyContent: "stretch"
|
|
1918
|
-
},
|
|
1919
|
-
propertiesMobile: null,
|
|
1920
|
-
cssStyles: [],
|
|
1921
|
-
cssStylesMobile: []
|
|
1922
|
-
};
|
|
1923
|
-
blocks.push(block);
|
|
1924
|
-
}
|
|
1925
1898
|
const webpages = webpageResource.resource ? await parseWebpageResources(
|
|
1926
1899
|
Array.isArray(webpageResource.resource) ? webpageResource.resource : [webpageResource.resource],
|
|
1927
1900
|
"page"
|
|
@@ -1986,7 +1959,7 @@ async function parseWebpage(webpageResource) {
|
|
|
1986
1959
|
return {
|
|
1987
1960
|
title: identification.label,
|
|
1988
1961
|
slug,
|
|
1989
|
-
|
|
1962
|
+
items,
|
|
1990
1963
|
properties: {
|
|
1991
1964
|
displayedInHeader,
|
|
1992
1965
|
width,
|
|
@@ -2013,9 +1986,9 @@ async function parseWebpages(webpageResources) {
|
|
|
2013
1986
|
async function parseBlock(blockResource) {
|
|
2014
1987
|
const returnBlock = {
|
|
2015
1988
|
uuid: blockResource.uuid,
|
|
1989
|
+
type: "block",
|
|
2016
1990
|
layout: "vertical",
|
|
2017
|
-
|
|
2018
|
-
elements: [],
|
|
1991
|
+
items: [],
|
|
2019
1992
|
properties: {
|
|
2020
1993
|
spacing: void 0,
|
|
2021
1994
|
gap: void 0,
|
|
@@ -2075,20 +2048,35 @@ async function parseBlock(blockResource) {
|
|
|
2075
2048
|
returnBlock.propertiesMobile = propertiesMobile;
|
|
2076
2049
|
}
|
|
2077
2050
|
}
|
|
2078
|
-
const
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2051
|
+
const blockResources = blockResource.resource ? Array.isArray(blockResource.resource) ? blockResource.resource : [blockResource.resource] : [];
|
|
2052
|
+
const blockItems = [];
|
|
2053
|
+
for (const resource of blockResources) {
|
|
2054
|
+
const resourceProperties = resource.properties ? parseProperties(
|
|
2055
|
+
Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
|
|
2056
|
+
) : [];
|
|
2057
|
+
const resourceType = getPropertyValueByLabel(
|
|
2058
|
+
resourceProperties,
|
|
2059
|
+
"presentation"
|
|
2060
|
+
);
|
|
2061
|
+
if (!resourceType) {
|
|
2062
|
+
continue;
|
|
2063
|
+
}
|
|
2064
|
+
switch (resourceType) {
|
|
2065
|
+
case "element": {
|
|
2066
|
+
const element = await parseWebElement(resource);
|
|
2067
|
+
blockItems.push(element);
|
|
2068
|
+
break;
|
|
2069
|
+
}
|
|
2070
|
+
case "block": {
|
|
2071
|
+
const block = await parseBlock(resource);
|
|
2072
|
+
if (block) {
|
|
2073
|
+
blockItems.push(block);
|
|
2074
|
+
}
|
|
2075
|
+
break;
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2091
2078
|
}
|
|
2079
|
+
returnBlock.items = blockItems;
|
|
2092
2080
|
const blockCssStyles = blockProperties.find(
|
|
2093
2081
|
(property) => property.label === "presentation" && property.values[0]?.content === "css"
|
|
2094
2082
|
)?.properties;
|
|
@@ -2322,15 +2310,7 @@ async function parseWebsite(websiteTree, projectName, website) {
|
|
|
2322
2310
|
}
|
|
2323
2311
|
const sidebarResources = sidebarResource.resource ? Array.isArray(sidebarResource.resource) ? sidebarResource.resource : [sidebarResource.resource] : [];
|
|
2324
2312
|
for (const resource of sidebarResources) {
|
|
2325
|
-
const
|
|
2326
|
-
Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
|
|
2327
|
-
) : [];
|
|
2328
|
-
const element = await parseWebElement(
|
|
2329
|
-
resource,
|
|
2330
|
-
sidebarResourceProperties.find(
|
|
2331
|
-
(property) => property.label === "presentation" && property.values[0]?.content === "element"
|
|
2332
|
-
)?.properties ?? []
|
|
2333
|
-
);
|
|
2313
|
+
const element = await parseWebElement(resource);
|
|
2334
2314
|
sidebarElements.push(element);
|
|
2335
2315
|
}
|
|
2336
2316
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalculture/ochre-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"zod": "^3.24.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@antfu/eslint-config": "^4.
|
|
48
|
+
"@antfu/eslint-config": "^4.10.1",
|
|
49
49
|
"@arethetypeswrong/cli": "^0.17.4",
|
|
50
50
|
"@changesets/cli": "^2.28.1",
|
|
51
51
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
52
|
-
"@types/node": "^22.13.
|
|
53
|
-
"eslint": "^9.
|
|
52
|
+
"@types/node": "^22.13.10",
|
|
53
|
+
"eslint": "^9.22.0",
|
|
54
54
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
55
|
-
"prettier": "^3.5.
|
|
55
|
+
"prettier": "^3.5.3",
|
|
56
56
|
"tsup": "^8.4.0",
|
|
57
|
-
"typescript": "^5.
|
|
58
|
-
"vitest": "^3.0.
|
|
57
|
+
"typescript": "^5.8.2",
|
|
58
|
+
"vitest": "^3.0.9"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"dev": "tsup src/index.ts --watch",
|