ochre-sdk 1.0.45 → 1.0.47
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/parsers/index.mjs
CHANGED
|
@@ -392,7 +392,7 @@ function parseImageMapArea(area) {
|
|
|
392
392
|
const parsedCoord = Number(coord.trim());
|
|
393
393
|
coords.push(Number.isNaN(parsedCoord) ? 0 : parsedCoord);
|
|
394
394
|
}
|
|
395
|
-
const shape = area.shape === "rect" ? "rectangle" : area.shape === "circle" ? "circle" : "polygon";
|
|
395
|
+
const shape = area.shape === "rect" ? "rectangle" : area.shape === "circle" ? "circle" : area.shape === "point" ? "point" : "polygon";
|
|
396
396
|
return {
|
|
397
397
|
uuid: area.uuid,
|
|
398
398
|
publicationDateTime: area.publicationDateTime ?? null,
|
|
@@ -414,6 +414,12 @@ function parseImageMapArea(area) {
|
|
|
414
414
|
y: coords[1] ?? 0
|
|
415
415
|
},
|
|
416
416
|
radius: coords[2] ?? 0
|
|
417
|
+
}] : shape === "point" ? [{
|
|
418
|
+
shape,
|
|
419
|
+
point: {
|
|
420
|
+
x: coords[0] ?? 0,
|
|
421
|
+
y: coords[1] ?? 0
|
|
422
|
+
}
|
|
417
423
|
}] : [{
|
|
418
424
|
shape,
|
|
419
425
|
coords
|
|
@@ -301,8 +301,7 @@ var MultilingualString = class MultilingualString {
|
|
|
301
301
|
* Check if the multilingual string has any content
|
|
302
302
|
*/
|
|
303
303
|
hasContent() {
|
|
304
|
-
const
|
|
305
|
-
for (const entries of contentEntries) for (const entry of entries ?? []) if (entry.text.trim().length > 0 || entry.richText.trim().length > 0) return true;
|
|
304
|
+
for (const language of this._availableLanguages) for (const entry of this._content[language] ?? []) if (entry.text.trim().length > 0 || entry.richText.trim().length > 0) return true;
|
|
306
305
|
return false;
|
|
307
306
|
}
|
|
308
307
|
/**
|
|
@@ -636,7 +636,7 @@ function parseWebElementProperties(componentProperty, elementResource, options,
|
|
|
636
636
|
const queryVariant = componentReader.valueOr("query-variant", "submit");
|
|
637
637
|
const boundElementUuid = componentReader.uuid("bound-element");
|
|
638
638
|
const href = parseWebsiteLinkTarget(componentReader.valueNode("link-to"), context);
|
|
639
|
-
if (
|
|
639
|
+
if (boundElementUuid === null && href === null) throw new Error(formatComponentError("Bound element or href not found", componentName, elementResource), { cause: componentProperty });
|
|
640
640
|
properties = {
|
|
641
641
|
component: "search-bar",
|
|
642
642
|
queryVariant,
|
package/dist/types/index.d.mts
CHANGED
package/dist/xml/schemas.mjs
CHANGED
|
@@ -210,8 +210,9 @@ const XMLImageMapArea = v.object({
|
|
|
210
210
|
shape: v.picklist([
|
|
211
211
|
"rect",
|
|
212
212
|
"circle",
|
|
213
|
-
"poly"
|
|
214
|
-
|
|
213
|
+
"poly",
|
|
214
|
+
"point"
|
|
215
|
+
], "XMLImageMapArea: shape is rect, circle, poly, or point"),
|
|
215
216
|
coords: v.string("XMLImageMapArea: coords is string and required")
|
|
216
217
|
}, "XMLImageMapArea: Shape error");
|
|
217
218
|
const XMLImageMap = v.object({
|
package/dist/xml/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ochre-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
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",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"bumpp": "^11.1.0",
|
|
79
79
|
"eslint": "^10.4.1",
|
|
80
80
|
"knip": "^6.16.1",
|
|
81
|
-
"oxfmt": "^0.
|
|
81
|
+
"oxfmt": "^0.54.0",
|
|
82
82
|
"tsdown": "^0.22.2",
|
|
83
83
|
"typescript": "^6.0.3",
|
|
84
84
|
"vitest": "^4.1.8"
|