cozy-iiif 0.7.2 → 0.7.3
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 +6 -3
- package/package.json +4 -4
- package/src/core/image-service.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -192,10 +192,13 @@ var zt = class et {
|
|
|
192
192
|
}
|
|
193
193
|
traverseCollectionItems(t) {
|
|
194
194
|
if (this.options.mergeMemberProperties) {
|
|
195
|
-
let r = [...(t.manifests || []).map((n) => typeof n == "string" ? { "@id": n, "@type": "sc:Manifest" } : n), ...(t.collections || []).map((n) => typeof n == "string" ? { "@id": n, "@type": "sc:Collection" } : n), ...t.members || []], i = [], s = r.filter((n) => i.includes(n["@id"]) ? !1 : (i.push(n["@id"]), !0));
|
|
195
|
+
let r = [...(t.manifests || []).map((n) => typeof n == "string" ? { "@id": n, "@type": "sc:Manifest" } : (n["@type"] ||= "sc:Manifest", n)), ...(t.collections || []).map((n) => typeof n == "string" ? { "@id": n, "@type": "sc:Collection" } : n), ...t.members || []], i = [], s = r.filter((n) => i.includes(n["@id"]) ? !1 : (i.push(n["@id"]), !0));
|
|
196
196
|
delete t.collections, delete t.manifests, t.members = s;
|
|
197
197
|
}
|
|
198
|
-
return t.manifests &&= t.manifests.map((r) =>
|
|
198
|
+
return t.manifests &&= t.manifests.map((r) => {
|
|
199
|
+
let i = r;
|
|
200
|
+
return typeof r == "string" && (i = { "@id": r, "@type": "sc:Manifest" }), i["@type"] ||= "sc:Manifest", this.traverseManifest(i);
|
|
201
|
+
}), t.collections &&= t.collections.map((r) => this.traverseCollection(typeof r == "string" ? { "@id": r, "@type": "sc:Collection" } : r)), t.members &&= t.members.map((r) => typeof r == "string" ? r : r["@type"] === "sc:Collection" ? this.traverseCollection(r) : r["@type"] === "sc:Manifest" ? this.traverseManifest(r) : this.traverseUnknown(r)), t;
|
|
199
202
|
}
|
|
200
203
|
traverseManifest(t) {
|
|
201
204
|
return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(t))), this.traversals.manifest);
|
|
@@ -600,7 +603,7 @@ function O(e) {
|
|
|
600
603
|
if (e["@type"] == "iiif:ImageApiSelector") return { type: "ImageApiSelector", region: "region" in e ? e.region : void 0, rotation: "rotation" in e ? e.rotation : void 0 };
|
|
601
604
|
throw Error(`Unsupported selector type: ${e["@type"]}`);
|
|
602
605
|
}
|
|
603
|
-
const at = (e) => e.endsWith("/info.json") ? e : `${e.endsWith("/") ? e : `${e}/`}info.json`, ot = (e) => d(e, "type")
|
|
606
|
+
const at = (e) => e.endsWith("/info.json") ? e : `${e.endsWith("/") ? e : `${e}/`}info.json`, ot = (e) => d(e, "type")?.startsWith("ImageService") || e.profile?.toString().includes("iiif.io/api/image/"), ct = (e) => {
|
|
604
607
|
const t = d(e, "type"), r = d(e, "context");
|
|
605
608
|
if (t === "ImageService2" || r?.includes("image/2")) {
|
|
606
609
|
const s = d(e, "profile"), n = ["level0", "level1", "level2"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-iiif",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
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",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.9.3",
|
|
32
|
-
"vite": "^7.3.
|
|
33
|
-
"vitest": "^4.
|
|
32
|
+
"vite": "^7.3.2",
|
|
33
|
+
"vitest": "^4.1.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@iiif/parser": "^2.2.
|
|
36
|
+
"@iiif/parser": "^2.2.10",
|
|
37
37
|
"@iiif/presentation-3": "^2.2.3",
|
|
38
38
|
"image-size": "^2.0.2",
|
|
39
39
|
"p-throttle": "^8.1.0",
|
|
@@ -11,7 +11,7 @@ export const normalizeServiceUrl = (url: string) =>
|
|
|
11
11
|
export const isImageService = (data: any): data is ImageService => {
|
|
12
12
|
const t = getPropertyValue<string>(data, 'type');
|
|
13
13
|
|
|
14
|
-
return t
|
|
14
|
+
return t?.startsWith('ImageService') || (
|
|
15
15
|
data.profile?.toString().includes('iiif.io/api/image/')
|
|
16
16
|
);
|
|
17
17
|
}
|