@digitalculture/ochre-sdk 0.5.6 → 0.5.8
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 +31 -7
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +31 -7
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1467,25 +1467,49 @@ async function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1467
1467
|
break;
|
|
1468
1468
|
}
|
|
1469
1469
|
case "collection": {
|
|
1470
|
+
const collectionLink = links.find((link) => link.category === "set");
|
|
1471
|
+
if (!collectionLink) {
|
|
1472
|
+
throw new Error(
|
|
1473
|
+
`Collection link not found for the following component: \u201C${componentName}\u201D`
|
|
1474
|
+
);
|
|
1475
|
+
}
|
|
1470
1476
|
let variant = getPropertyValueByLabel(
|
|
1471
1477
|
componentProperty.properties,
|
|
1472
1478
|
"variant"
|
|
1473
1479
|
);
|
|
1474
1480
|
variant ??= "full";
|
|
1481
|
+
let itemVariant = getPropertyValueByLabel(
|
|
1482
|
+
componentProperty.properties,
|
|
1483
|
+
"item-variant"
|
|
1484
|
+
);
|
|
1485
|
+
itemVariant ??= "default";
|
|
1486
|
+
let showCount = false;
|
|
1487
|
+
const showCountProperty = getPropertyValueByLabel(
|
|
1488
|
+
componentProperty.properties,
|
|
1489
|
+
"show-count"
|
|
1490
|
+
);
|
|
1491
|
+
if (showCountProperty !== null) {
|
|
1492
|
+
showCount = showCountProperty === "Yes";
|
|
1493
|
+
}
|
|
1494
|
+
let isSearchable = false;
|
|
1495
|
+
const isSearchableProperty = getPropertyValueByLabel(
|
|
1496
|
+
componentProperty.properties,
|
|
1497
|
+
"is-searchable"
|
|
1498
|
+
);
|
|
1499
|
+
if (isSearchableProperty !== null) {
|
|
1500
|
+
isSearchable = isSearchableProperty === "Yes";
|
|
1501
|
+
}
|
|
1475
1502
|
let layout = getPropertyValueByLabel(
|
|
1476
1503
|
componentProperty.properties,
|
|
1477
1504
|
"layout"
|
|
1478
1505
|
);
|
|
1479
1506
|
layout ??= "image-start";
|
|
1480
|
-
|
|
1481
|
-
if (!collectionLink) {
|
|
1482
|
-
throw new Error(
|
|
1483
|
-
`Collection link not found for the following component: \u201C${componentName}\u201D`
|
|
1484
|
-
);
|
|
1485
|
-
}
|
|
1507
|
+
properties.collectionId = collectionLink.uuid;
|
|
1486
1508
|
properties.variant = variant;
|
|
1509
|
+
properties.itemVariant = itemVariant;
|
|
1510
|
+
properties.isSearchable = isSearchable;
|
|
1511
|
+
properties.showCount = showCount;
|
|
1487
1512
|
properties.layout = layout;
|
|
1488
|
-
properties.collectionId = collectionLink.uuid;
|
|
1489
1513
|
break;
|
|
1490
1514
|
}
|
|
1491
1515
|
case "empty-space": {
|
package/dist/index.d.cts
CHANGED
|
@@ -504,8 +504,10 @@ type WebElementComponent = {
|
|
|
504
504
|
component: "collection";
|
|
505
505
|
collectionId: string;
|
|
506
506
|
variant: "full" | "highlights";
|
|
507
|
-
|
|
507
|
+
itemVariant: "default" | "card";
|
|
508
508
|
isSearchable: boolean;
|
|
509
|
+
showCount: boolean;
|
|
510
|
+
layout: "image-top" | "image-bottom" | "image-start" | "image-end";
|
|
509
511
|
} | {
|
|
510
512
|
component: "empty-space";
|
|
511
513
|
height: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -504,8 +504,10 @@ type WebElementComponent = {
|
|
|
504
504
|
component: "collection";
|
|
505
505
|
collectionId: string;
|
|
506
506
|
variant: "full" | "highlights";
|
|
507
|
-
|
|
507
|
+
itemVariant: "default" | "card";
|
|
508
508
|
isSearchable: boolean;
|
|
509
|
+
showCount: boolean;
|
|
510
|
+
layout: "image-top" | "image-bottom" | "image-start" | "image-end";
|
|
509
511
|
} | {
|
|
510
512
|
component: "empty-space";
|
|
511
513
|
height: string | null;
|
package/dist/index.js
CHANGED
|
@@ -1390,25 +1390,49 @@ async function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1390
1390
|
break;
|
|
1391
1391
|
}
|
|
1392
1392
|
case "collection": {
|
|
1393
|
+
const collectionLink = links.find((link) => link.category === "set");
|
|
1394
|
+
if (!collectionLink) {
|
|
1395
|
+
throw new Error(
|
|
1396
|
+
`Collection link not found for the following component: \u201C${componentName}\u201D`
|
|
1397
|
+
);
|
|
1398
|
+
}
|
|
1393
1399
|
let variant = getPropertyValueByLabel(
|
|
1394
1400
|
componentProperty.properties,
|
|
1395
1401
|
"variant"
|
|
1396
1402
|
);
|
|
1397
1403
|
variant ??= "full";
|
|
1404
|
+
let itemVariant = getPropertyValueByLabel(
|
|
1405
|
+
componentProperty.properties,
|
|
1406
|
+
"item-variant"
|
|
1407
|
+
);
|
|
1408
|
+
itemVariant ??= "default";
|
|
1409
|
+
let showCount = false;
|
|
1410
|
+
const showCountProperty = getPropertyValueByLabel(
|
|
1411
|
+
componentProperty.properties,
|
|
1412
|
+
"show-count"
|
|
1413
|
+
);
|
|
1414
|
+
if (showCountProperty !== null) {
|
|
1415
|
+
showCount = showCountProperty === "Yes";
|
|
1416
|
+
}
|
|
1417
|
+
let isSearchable = false;
|
|
1418
|
+
const isSearchableProperty = getPropertyValueByLabel(
|
|
1419
|
+
componentProperty.properties,
|
|
1420
|
+
"is-searchable"
|
|
1421
|
+
);
|
|
1422
|
+
if (isSearchableProperty !== null) {
|
|
1423
|
+
isSearchable = isSearchableProperty === "Yes";
|
|
1424
|
+
}
|
|
1398
1425
|
let layout = getPropertyValueByLabel(
|
|
1399
1426
|
componentProperty.properties,
|
|
1400
1427
|
"layout"
|
|
1401
1428
|
);
|
|
1402
1429
|
layout ??= "image-start";
|
|
1403
|
-
|
|
1404
|
-
if (!collectionLink) {
|
|
1405
|
-
throw new Error(
|
|
1406
|
-
`Collection link not found for the following component: \u201C${componentName}\u201D`
|
|
1407
|
-
);
|
|
1408
|
-
}
|
|
1430
|
+
properties.collectionId = collectionLink.uuid;
|
|
1409
1431
|
properties.variant = variant;
|
|
1432
|
+
properties.itemVariant = itemVariant;
|
|
1433
|
+
properties.isSearchable = isSearchable;
|
|
1434
|
+
properties.showCount = showCount;
|
|
1410
1435
|
properties.layout = layout;
|
|
1411
|
-
properties.collectionId = collectionLink.uuid;
|
|
1412
1436
|
break;
|
|
1413
1437
|
}
|
|
1414
1438
|
case "empty-space": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalculture/ochre-sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
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",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"@changesets/cli": "^2.28.1",
|
|
50
50
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
51
51
|
"@types/node": "^22.14.0",
|
|
52
|
-
"eslint": "^9.
|
|
52
|
+
"eslint": "^9.24.0",
|
|
53
53
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
54
54
|
"prettier": "^3.5.3",
|
|
55
55
|
"tsup": "^8.4.0",
|
|
56
|
-
"typescript": "^5.8.
|
|
56
|
+
"typescript": "^5.8.3",
|
|
57
57
|
"vitest": "^3.1.1"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|