@manifest-editor/creators 1.4.0 → 1.4.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/chunk-2B2F7X4A.js +59 -0
- package/dist/chunk-5YV7MYAZ.js +60 -0
- package/dist/chunk-CYVZA2MU.js +59 -0
- package/dist/chunk-W4PYM3PN.js +59 -0
- package/dist/index.cjs +56 -47
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +46 -46
- package/dist/manifest-browser-form.lazy-4CFTHOMZ.js +6 -0
- package/dist/manifest-browser-form.lazy-5JVKGB7O.js +6 -0
- package/dist/manifest-browser-form.lazy-ALVCNMEV.js +6 -0
- package/dist/manifest-browser-form.lazy-QGTJHSSC.js +6 -0
- package/package.json +7 -7
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/Manifest/ManifestBrowserCreator/manifest-browser-form.lazy.tsx
|
|
2
|
+
import { Vault } from "@iiif/helpers";
|
|
3
|
+
import { PreviewVaultBoundary } from "@manifest-editor/shell";
|
|
4
|
+
import { IIIFBrowser } from "iiif-browser";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function ManifestBrowserCreatorForm(props) {
|
|
8
|
+
const vault = useMemo(() => new Vault(), []);
|
|
9
|
+
const output = useMemo(() => {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
type: "callback",
|
|
13
|
+
label: "Select",
|
|
14
|
+
supportedTypes: ["Manifest", "Collection"],
|
|
15
|
+
cb: (resource) => props.runCreate({ output: resource }),
|
|
16
|
+
format: {
|
|
17
|
+
type: "custom",
|
|
18
|
+
format: (resource, parent, vault2) => {
|
|
19
|
+
const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
|
|
20
|
+
const resources = [];
|
|
21
|
+
for (const resource2 of resourcesAsArray) {
|
|
22
|
+
resources.push({ resource: vault2.get(resource2), parent: resource2.parent, selector: resource2.selector });
|
|
23
|
+
}
|
|
24
|
+
return resources;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
}, [props.runCreate]);
|
|
30
|
+
const navigationOptions = useMemo(() => {
|
|
31
|
+
return {
|
|
32
|
+
canCropImage: false,
|
|
33
|
+
canSelectCanvas: false,
|
|
34
|
+
canSelectManifest: true,
|
|
35
|
+
canSelectCollection: true,
|
|
36
|
+
multiSelect: true
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
const uiOptions = useMemo(() => {
|
|
40
|
+
return {
|
|
41
|
+
buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
|
|
45
|
+
IIIFBrowser,
|
|
46
|
+
{
|
|
47
|
+
debug: true,
|
|
48
|
+
ui: uiOptions,
|
|
49
|
+
vault,
|
|
50
|
+
className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
|
|
51
|
+
output,
|
|
52
|
+
navigation: navigationOptions
|
|
53
|
+
}
|
|
54
|
+
) });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
ManifestBrowserCreatorForm
|
|
59
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/Manifest/ManifestBrowserCreator/manifest-browser-form.lazy.tsx
|
|
2
|
+
import { Vault } from "@iiif/helpers";
|
|
3
|
+
import { PreviewVaultBoundary } from "@manifest-editor/shell";
|
|
4
|
+
import { IIIFBrowser } from "iiif-browser";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function ManifestBrowserCreatorForm(props) {
|
|
8
|
+
const vault = useMemo(() => new Vault(), []);
|
|
9
|
+
const output = useMemo(() => {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
type: "callback",
|
|
13
|
+
label: "Select",
|
|
14
|
+
supportedTypes: ["Manifest", "Collection"],
|
|
15
|
+
cb: (resource) => props.runCreate({ output: resource }),
|
|
16
|
+
format: {
|
|
17
|
+
type: "custom",
|
|
18
|
+
format: (resource, parent, vault2) => {
|
|
19
|
+
const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
|
|
20
|
+
const resources = [];
|
|
21
|
+
for (const resource2 of resourcesAsArray) {
|
|
22
|
+
resources.push({ resource: vault2.get(resource2), parent: resource2.parent, selector: resource2.selector });
|
|
23
|
+
}
|
|
24
|
+
return resources;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
}, [props.runCreate]);
|
|
30
|
+
const navigationOptions = useMemo(() => {
|
|
31
|
+
return {
|
|
32
|
+
canCropImage: false,
|
|
33
|
+
canSelectCanvas: false,
|
|
34
|
+
canSelectManifest: true,
|
|
35
|
+
canSelectCollection: true,
|
|
36
|
+
// @todo fix the output so this one works.
|
|
37
|
+
multiSelect: false
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
const uiOptions = useMemo(() => {
|
|
41
|
+
return {
|
|
42
|
+
buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
45
|
+
return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
|
|
46
|
+
IIIFBrowser,
|
|
47
|
+
{
|
|
48
|
+
debug: true,
|
|
49
|
+
ui: uiOptions,
|
|
50
|
+
vault,
|
|
51
|
+
className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
|
|
52
|
+
output,
|
|
53
|
+
navigation: navigationOptions
|
|
54
|
+
}
|
|
55
|
+
) });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
ManifestBrowserCreatorForm
|
|
60
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/Manifest/ManifestBrowserCreator/manifest-browser-form.lazy.tsx
|
|
2
|
+
import { Vault } from "@iiif/helpers";
|
|
3
|
+
import { PreviewVaultBoundary } from "@manifest-editor/shell";
|
|
4
|
+
import { IIIFBrowser } from "iiif-browser";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function ManifestBrowserCreatorForm(props) {
|
|
8
|
+
const vault = useMemo(() => new Vault(), []);
|
|
9
|
+
const output = useMemo(() => {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
type: "callback",
|
|
13
|
+
label: "Select",
|
|
14
|
+
supportedTypes: ["Manifest", "Collection", "ManifestList", "CollectionList", "CollectionItemList"],
|
|
15
|
+
cb: (resource) => props.runCreate({ output: resource }),
|
|
16
|
+
format: {
|
|
17
|
+
type: "custom",
|
|
18
|
+
format: (resource, parent, vault2) => {
|
|
19
|
+
const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
|
|
20
|
+
const resources = [];
|
|
21
|
+
for (const resource2 of resourcesAsArray) {
|
|
22
|
+
resources.push({ resource: vault2.get(resource2), parent: resource2.parent, selector: resource2.selector });
|
|
23
|
+
}
|
|
24
|
+
return resources;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
}, [props.runCreate]);
|
|
30
|
+
const navigationOptions = useMemo(() => {
|
|
31
|
+
return {
|
|
32
|
+
canCropImage: false,
|
|
33
|
+
canSelectCanvas: false,
|
|
34
|
+
canSelectManifest: true,
|
|
35
|
+
canSelectCollection: true,
|
|
36
|
+
multiSelect: true
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
const uiOptions = useMemo(() => {
|
|
40
|
+
return {
|
|
41
|
+
buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
|
|
45
|
+
IIIFBrowser,
|
|
46
|
+
{
|
|
47
|
+
debug: true,
|
|
48
|
+
ui: uiOptions,
|
|
49
|
+
vault,
|
|
50
|
+
className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
|
|
51
|
+
output,
|
|
52
|
+
navigation: navigationOptions
|
|
53
|
+
}
|
|
54
|
+
) });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
ManifestBrowserCreatorForm
|
|
59
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/Manifest/ManifestBrowserCreator/manifest-browser-form.lazy.tsx
|
|
2
|
+
import { Vault } from "@iiif/helpers";
|
|
3
|
+
import { PreviewVaultBoundary } from "@manifest-editor/shell";
|
|
4
|
+
import { IIIFBrowser } from "iiif-browser";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function ManifestBrowserCreatorForm(props) {
|
|
8
|
+
const vault = useMemo(() => new Vault(), []);
|
|
9
|
+
const output = useMemo(() => {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
type: "callback",
|
|
13
|
+
label: "Select",
|
|
14
|
+
supportedTypes: ["Manifest", "Collection", "CollectionItemList"],
|
|
15
|
+
cb: (resource) => props.runCreate({ output: resource }),
|
|
16
|
+
format: {
|
|
17
|
+
type: "custom",
|
|
18
|
+
format: (resource, parent, vault2) => {
|
|
19
|
+
const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
|
|
20
|
+
const resources = [];
|
|
21
|
+
for (const resource2 of resourcesAsArray) {
|
|
22
|
+
resources.push({ resource: vault2.get(resource2), parent: resource2.parent, selector: resource2.selector });
|
|
23
|
+
}
|
|
24
|
+
return resources;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
}, [props.runCreate]);
|
|
30
|
+
const navigationOptions = useMemo(() => {
|
|
31
|
+
return {
|
|
32
|
+
canCropImage: false,
|
|
33
|
+
canSelectCanvas: false,
|
|
34
|
+
canSelectManifest: true,
|
|
35
|
+
canSelectCollection: true,
|
|
36
|
+
multiSelect: true
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
const uiOptions = useMemo(() => {
|
|
40
|
+
return {
|
|
41
|
+
buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
|
|
45
|
+
IIIFBrowser,
|
|
46
|
+
{
|
|
47
|
+
debug: true,
|
|
48
|
+
ui: uiOptions,
|
|
49
|
+
vault,
|
|
50
|
+
className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
|
|
51
|
+
output,
|
|
52
|
+
navigation: navigationOptions
|
|
53
|
+
}
|
|
54
|
+
) });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
ManifestBrowserCreatorForm
|
|
59
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -108,9 +108,19 @@ function ManifestBrowserCreatorForm(props) {
|
|
|
108
108
|
{
|
|
109
109
|
type: "callback",
|
|
110
110
|
label: "Select",
|
|
111
|
-
supportedTypes: ["Manifest", "Collection"],
|
|
111
|
+
supportedTypes: ["Manifest", "Collection", "ManifestList", "CollectionList", "CollectionItemList"],
|
|
112
112
|
cb: (resource) => props.runCreate({ output: resource }),
|
|
113
|
-
format: {
|
|
113
|
+
format: {
|
|
114
|
+
type: "custom",
|
|
115
|
+
format: (resource, parent, vault2) => {
|
|
116
|
+
const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
|
|
117
|
+
const resources = [];
|
|
118
|
+
for (const resource2 of resourcesAsArray) {
|
|
119
|
+
resources.push({ resource: vault2.get(resource2), parent: resource2.parent, selector: resource2.selector });
|
|
120
|
+
}
|
|
121
|
+
return resources;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
114
124
|
}
|
|
115
125
|
];
|
|
116
126
|
}, [props.runCreate]);
|
|
@@ -120,8 +130,7 @@ function ManifestBrowserCreatorForm(props) {
|
|
|
120
130
|
canSelectCanvas: false,
|
|
121
131
|
canSelectManifest: true,
|
|
122
132
|
canSelectCollection: true,
|
|
123
|
-
|
|
124
|
-
multiSelect: false
|
|
133
|
+
multiSelect: true
|
|
125
134
|
};
|
|
126
135
|
}, []);
|
|
127
136
|
const uiOptions = (0, import_react13.useMemo)(() => {
|
|
@@ -1977,6 +1986,7 @@ async function createFromIIIFBrowserOutput(data, ctx) {
|
|
|
1977
1986
|
if (!fullCanvas.label) {
|
|
1978
1987
|
fullCanvas.label = { en: ["Untitled canvas"] };
|
|
1979
1988
|
}
|
|
1989
|
+
ctx.vault.loadSync(fullCanvas.id, fullCanvas);
|
|
1980
1990
|
returnResources.push(ctx.embed(fullCanvas));
|
|
1981
1991
|
continue;
|
|
1982
1992
|
}
|
|
@@ -2647,50 +2657,49 @@ var import_creator_api25 = require("@manifest-editor/creator-api");
|
|
|
2647
2657
|
var import_helpers7 = require("@iiif/helpers");
|
|
2648
2658
|
var import_react14 = require("react");
|
|
2649
2659
|
async function createFromManifestBrowserOutput(data, ctx) {
|
|
2650
|
-
const
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
});
|
|
2660
|
+
const inputItems = data.output || [];
|
|
2661
|
+
const itemsToAdd = [];
|
|
2662
|
+
for (const item of inputItems) {
|
|
2663
|
+
const { resource, parent, selector } = item;
|
|
2664
|
+
const previewVault = ctx.getPreviewVault();
|
|
2665
|
+
const thumbnails = (0, import_helpers7.createThumbnailHelper)(previewVault);
|
|
2666
|
+
if (resource.type === "Manifest") {
|
|
2667
|
+
const manifestId = resource.id;
|
|
2668
|
+
invariant(manifestId, "Could not find Manifest ID");
|
|
2669
|
+
const manifest = await previewVault.loadManifest(manifestId);
|
|
2670
|
+
const thumbnail = await thumbnails.getBestThumbnailAtSize(manifest, { width: 256, height: 256 }, false);
|
|
2671
|
+
invariant(manifest, "Manifest not found");
|
|
2672
|
+
itemsToAdd.push(
|
|
2673
|
+
ctx.embed({
|
|
2674
|
+
id: resource.id,
|
|
2675
|
+
type: "Manifest",
|
|
2676
|
+
label: manifest.label,
|
|
2677
|
+
summary: manifest.summary,
|
|
2678
|
+
thumbnail: thumbnail?.best ? [
|
|
2679
|
+
{
|
|
2680
|
+
id: thumbnail.best.id,
|
|
2681
|
+
type: "Image"
|
|
2682
|
+
}
|
|
2683
|
+
] : void 0
|
|
2684
|
+
})
|
|
2685
|
+
);
|
|
2686
|
+
continue;
|
|
2687
|
+
}
|
|
2688
|
+
if (resource.type === "Collection") {
|
|
2689
|
+
const collectionId = resource.id;
|
|
2690
|
+
invariant(collectionId, "Could not find Manifest ID");
|
|
2691
|
+
const collection = await previewVault.loadManifest(collectionId);
|
|
2692
|
+
invariant(collection, "Collection not found");
|
|
2693
|
+
itemsToAdd.push(
|
|
2694
|
+
ctx.embed({
|
|
2695
|
+
id: resource.id,
|
|
2696
|
+
type: "Collection",
|
|
2697
|
+
label: collection.label
|
|
2698
|
+
})
|
|
2699
|
+
);
|
|
2700
|
+
}
|
|
2692
2701
|
}
|
|
2693
|
-
|
|
2702
|
+
return itemsToAdd;
|
|
2694
2703
|
}
|
|
2695
2704
|
var ManifestBrowserCreatorForm2 = (0, import_react14.lazy)(() => Promise.resolve().then(() => (init_manifest_browser_form_lazy(), manifest_browser_form_lazy_exports)));
|
|
2696
2705
|
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ import { CreatorFunctionContext, CreatorContext, CreatorResource } from '@manife
|
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { SizeParameter, RegionParameter } from '@iiif/parser/image-3';
|
|
7
7
|
import * as react from 'react';
|
|
8
|
-
import { BoxSelector
|
|
8
|
+
import { BoxSelector } from '@iiif/helpers';
|
|
9
9
|
|
|
10
10
|
interface CreateAudioAnnotationPayload {
|
|
11
11
|
label?: InternationalString;
|
|
@@ -315,9 +315,16 @@ declare const youTubeBodyCreator: _manifest_editor_creator_api.SpecificCreatorDe
|
|
|
315
315
|
declare function ManifestBrowserCreatorForm$1(props: CreatorContext): react_jsx_runtime.JSX.Element;
|
|
316
316
|
|
|
317
317
|
interface ManifestBrowserCreatorPayload {
|
|
318
|
-
output:
|
|
318
|
+
output: Array<{
|
|
319
|
+
resource: any;
|
|
320
|
+
parent: {
|
|
321
|
+
id: string;
|
|
322
|
+
type: string;
|
|
323
|
+
} | undefined;
|
|
324
|
+
selector: BoxSelector | undefined;
|
|
325
|
+
}>;
|
|
319
326
|
}
|
|
320
|
-
declare function createFromManifestBrowserOutput(data: ManifestBrowserCreatorPayload, ctx: CreatorFunctionContext): Promise<
|
|
327
|
+
declare function createFromManifestBrowserOutput(data: ManifestBrowserCreatorPayload, ctx: CreatorFunctionContext): Promise<CreatorResource[]>;
|
|
321
328
|
declare const ManifestBrowserCreatorForm: react.LazyExoticComponent<typeof ManifestBrowserCreatorForm$1>;
|
|
322
329
|
|
|
323
330
|
declare module "@manifest-editor/creator-api" {
|
|
@@ -327,7 +334,7 @@ declare module "@manifest-editor/creator-api" {
|
|
|
327
334
|
}
|
|
328
335
|
}
|
|
329
336
|
}
|
|
330
|
-
declare const manifestBrowserCreator: _manifest_editor_creator_api.SpecificCreatorDefinition<ManifestBrowserCreatorPayload, "@manifest-editor/manifest-browser-creator", "Manifest", ["Collection"], ["Manifest", "Collection"], ["Collection"], [], Promise<_manifest_editor_creator_api.CreatorResource>>;
|
|
337
|
+
declare const manifestBrowserCreator: _manifest_editor_creator_api.SpecificCreatorDefinition<ManifestBrowserCreatorPayload, "@manifest-editor/manifest-browser-creator", "Manifest", ["Collection"], ["Manifest", "Collection"], ["Collection"], [], Promise<_manifest_editor_creator_api.CreatorResource[]>>;
|
|
331
338
|
|
|
332
339
|
declare function createImageUrlListAnnotation(payload: {
|
|
333
340
|
images: CreateImageUrlPayload[];
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { CreatorFunctionContext, CreatorContext, CreatorResource } from '@manife
|
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { SizeParameter, RegionParameter } from '@iiif/parser/image-3';
|
|
7
7
|
import * as react from 'react';
|
|
8
|
-
import { BoxSelector
|
|
8
|
+
import { BoxSelector } from '@iiif/helpers';
|
|
9
9
|
|
|
10
10
|
interface CreateAudioAnnotationPayload {
|
|
11
11
|
label?: InternationalString;
|
|
@@ -315,9 +315,16 @@ declare const youTubeBodyCreator: _manifest_editor_creator_api.SpecificCreatorDe
|
|
|
315
315
|
declare function ManifestBrowserCreatorForm$1(props: CreatorContext): react_jsx_runtime.JSX.Element;
|
|
316
316
|
|
|
317
317
|
interface ManifestBrowserCreatorPayload {
|
|
318
|
-
output:
|
|
318
|
+
output: Array<{
|
|
319
|
+
resource: any;
|
|
320
|
+
parent: {
|
|
321
|
+
id: string;
|
|
322
|
+
type: string;
|
|
323
|
+
} | undefined;
|
|
324
|
+
selector: BoxSelector | undefined;
|
|
325
|
+
}>;
|
|
319
326
|
}
|
|
320
|
-
declare function createFromManifestBrowserOutput(data: ManifestBrowserCreatorPayload, ctx: CreatorFunctionContext): Promise<
|
|
327
|
+
declare function createFromManifestBrowserOutput(data: ManifestBrowserCreatorPayload, ctx: CreatorFunctionContext): Promise<CreatorResource[]>;
|
|
321
328
|
declare const ManifestBrowserCreatorForm: react.LazyExoticComponent<typeof ManifestBrowserCreatorForm$1>;
|
|
322
329
|
|
|
323
330
|
declare module "@manifest-editor/creator-api" {
|
|
@@ -327,7 +334,7 @@ declare module "@manifest-editor/creator-api" {
|
|
|
327
334
|
}
|
|
328
335
|
}
|
|
329
336
|
}
|
|
330
|
-
declare const manifestBrowserCreator: _manifest_editor_creator_api.SpecificCreatorDefinition<ManifestBrowserCreatorPayload, "@manifest-editor/manifest-browser-creator", "Manifest", ["Collection"], ["Manifest", "Collection"], ["Collection"], [], Promise<_manifest_editor_creator_api.CreatorResource>>;
|
|
337
|
+
declare const manifestBrowserCreator: _manifest_editor_creator_api.SpecificCreatorDefinition<ManifestBrowserCreatorPayload, "@manifest-editor/manifest-browser-creator", "Manifest", ["Collection"], ["Manifest", "Collection"], ["Collection"], [], Promise<_manifest_editor_creator_api.CreatorResource[]>>;
|
|
331
338
|
|
|
332
339
|
declare function createImageUrlListAnnotation(payload: {
|
|
333
340
|
images: CreateImageUrlPayload[];
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ManifestBrowserCreatorForm
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CYVZA2MU.js";
|
|
4
4
|
|
|
5
5
|
// src/Annotation/AudioAnnotation/index.tsx
|
|
6
6
|
import { AudioIcon } from "@manifest-editor/components";
|
|
@@ -1774,6 +1774,7 @@ async function createFromIIIFBrowserOutput(data, ctx) {
|
|
|
1774
1774
|
if (!fullCanvas.label) {
|
|
1775
1775
|
fullCanvas.label = { en: ["Untitled canvas"] };
|
|
1776
1776
|
}
|
|
1777
|
+
ctx.vault.loadSync(fullCanvas.id, fullCanvas);
|
|
1777
1778
|
returnResources.push(ctx.embed(fullCanvas));
|
|
1778
1779
|
continue;
|
|
1779
1780
|
}
|
|
@@ -2446,55 +2447,54 @@ import { IIIFBrowserIcon as IIIFBrowserIcon2 } from "@manifest-editor/components
|
|
|
2446
2447
|
import { defineCreator as defineCreator21 } from "@manifest-editor/creator-api";
|
|
2447
2448
|
|
|
2448
2449
|
// src/Manifest/ManifestBrowserCreator/manifest-browser-creator.tsx
|
|
2449
|
-
import { createThumbnailHelper
|
|
2450
|
+
import { createThumbnailHelper } from "@iiif/helpers";
|
|
2450
2451
|
import { lazy as lazy2 } from "react";
|
|
2451
2452
|
async function createFromManifestBrowserOutput(data, ctx) {
|
|
2452
|
-
const
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
});
|
|
2453
|
+
const inputItems = data.output || [];
|
|
2454
|
+
const itemsToAdd = [];
|
|
2455
|
+
for (const item of inputItems) {
|
|
2456
|
+
const { resource, parent, selector } = item;
|
|
2457
|
+
const previewVault = ctx.getPreviewVault();
|
|
2458
|
+
const thumbnails = createThumbnailHelper(previewVault);
|
|
2459
|
+
if (resource.type === "Manifest") {
|
|
2460
|
+
const manifestId = resource.id;
|
|
2461
|
+
invariant(manifestId, "Could not find Manifest ID");
|
|
2462
|
+
const manifest = await previewVault.loadManifest(manifestId);
|
|
2463
|
+
const thumbnail = await thumbnails.getBestThumbnailAtSize(manifest, { width: 256, height: 256 }, false);
|
|
2464
|
+
invariant(manifest, "Manifest not found");
|
|
2465
|
+
itemsToAdd.push(
|
|
2466
|
+
ctx.embed({
|
|
2467
|
+
id: resource.id,
|
|
2468
|
+
type: "Manifest",
|
|
2469
|
+
label: manifest.label,
|
|
2470
|
+
summary: manifest.summary,
|
|
2471
|
+
thumbnail: thumbnail?.best ? [
|
|
2472
|
+
{
|
|
2473
|
+
id: thumbnail.best.id,
|
|
2474
|
+
type: "Image"
|
|
2475
|
+
}
|
|
2476
|
+
] : void 0
|
|
2477
|
+
})
|
|
2478
|
+
);
|
|
2479
|
+
continue;
|
|
2480
|
+
}
|
|
2481
|
+
if (resource.type === "Collection") {
|
|
2482
|
+
const collectionId = resource.id;
|
|
2483
|
+
invariant(collectionId, "Could not find Manifest ID");
|
|
2484
|
+
const collection = await previewVault.loadManifest(collectionId);
|
|
2485
|
+
invariant(collection, "Collection not found");
|
|
2486
|
+
itemsToAdd.push(
|
|
2487
|
+
ctx.embed({
|
|
2488
|
+
id: resource.id,
|
|
2489
|
+
type: "Collection",
|
|
2490
|
+
label: collection.label
|
|
2491
|
+
})
|
|
2492
|
+
);
|
|
2493
|
+
}
|
|
2494
2494
|
}
|
|
2495
|
-
|
|
2495
|
+
return itemsToAdd;
|
|
2496
2496
|
}
|
|
2497
|
-
var ManifestBrowserCreatorForm2 = lazy2(() => import("./manifest-browser-form.lazy-
|
|
2497
|
+
var ManifestBrowserCreatorForm2 = lazy2(() => import("./manifest-browser-form.lazy-QGTJHSSC.js"));
|
|
2498
2498
|
|
|
2499
2499
|
// src/Manifest/ManifestBrowserCreator/index.tsx
|
|
2500
2500
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manifest-editor/creators",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
|
|
6
6
|
"repository": {
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"@iiif/parser": "^2.1.8",
|
|
48
48
|
"@iiif/presentation-3": "^2.2.3",
|
|
49
49
|
"@iiif/presentation-3-normalized": "^0.9.7",
|
|
50
|
-
"@manifest-editor/components": "1.4.
|
|
51
|
-
"@manifest-editor/creator-api": "1.4.
|
|
50
|
+
"@manifest-editor/components": "1.4.2",
|
|
51
|
+
"@manifest-editor/creator-api": "1.4.2",
|
|
52
52
|
"@manifest-editor/editor-api": "1.4.0",
|
|
53
|
-
"@manifest-editor/editors": "1.4.
|
|
54
|
-
"@manifest-editor/iiif-browser": "1.4.
|
|
55
|
-
"@manifest-editor/shell": "1.4.
|
|
53
|
+
"@manifest-editor/editors": "1.4.2",
|
|
54
|
+
"@manifest-editor/iiif-browser": "1.4.1",
|
|
55
|
+
"@manifest-editor/shell": "1.4.2",
|
|
56
56
|
"iiif-browser": "^2.0.1",
|
|
57
57
|
"react": "^18.3.1",
|
|
58
58
|
"react-dom": "^18.3.1",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "7da90acfb83545d53d34ba95b86c8d5492005e81"
|
|
75
75
|
}
|