cozy-iiif 0.1.1 → 0.1.2
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.js +1 -1
- package/package.json +3 -3
- package/src/core/canvas.ts +1 -0
- package/src/core/image-service.ts +4 -1
package/dist/index.js
CHANGED
@@ -552,7 +552,7 @@ var G = class z {
|
|
552
552
|
}
|
553
553
|
}
|
554
554
|
};
|
555
|
-
const K = (t) => p(t, "type").startsWith("ImageService"), Q = (t) => {
|
555
|
+
const K = (t) => p(t, "type").startsWith("ImageService") || t.profile && t.profile.toString().includes("iiif.io/api/image/"), Q = (t) => {
|
556
556
|
const e = p(t, "type"), r = p(t, "context");
|
557
557
|
if (e === "ImageService2" || r != null && r.includes("image/2")) {
|
558
558
|
const i = t, s = ["level0", "level1", "level2"];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cozy-iiif",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.2",
|
4
4
|
"description": "A developer-friendly collection of abstractions and utilities built on top of @iiif/presentation-3 and @iiif/parser",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Rainer Simon",
|
@@ -26,8 +26,8 @@
|
|
26
26
|
"./level-0": "./dist/level-0/index.js"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
|
-
"vite": "^6.
|
30
|
-
"vite-plugin-dts": "^4.5.
|
29
|
+
"vite": "^6.2.0",
|
30
|
+
"vite-plugin-dts": "^4.5.3"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
33
|
"@iiif/parser": "^2.1.7",
|
package/src/core/canvas.ts
CHANGED
@@ -54,6 +54,7 @@ const toCozyImageResource = (resource: IIIFExternalWebResource) => {
|
|
54
54
|
const imageService = (resource.service || []).find(isImageService);
|
55
55
|
|
56
56
|
const service = imageService ? parseImageService(imageService) : undefined;
|
57
|
+
|
57
58
|
if (service) {
|
58
59
|
const image = {
|
59
60
|
source: resource,
|
@@ -6,7 +6,10 @@ type ImageService = ImageService2 | ImageService3;
|
|
6
6
|
|
7
7
|
export const isImageService = (data: any): data is ImageService => {
|
8
8
|
const t = getPropertyValue<string>(data, 'type');
|
9
|
-
|
9
|
+
|
10
|
+
return t.startsWith('ImageService') || (
|
11
|
+
data.profile && data.profile.toString().includes('iiif.io/api/image/')
|
12
|
+
);
|
10
13
|
}
|
11
14
|
|
12
15
|
export const parseImageService = (service: Service) => {
|