@manifest-editor/creators 1.3.0 → 1.4.0

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.
Files changed (36) hide show
  1. package/README.md +49 -0
  2. package/dist/chunk-AVISJS46.js +50 -0
  3. package/dist/chunk-ES62IRNT.js +50 -0
  4. package/dist/chunk-KLSWX2QF.js +38 -0
  5. package/dist/chunk-PFQB3PNW.js +47 -0
  6. package/dist/chunk-S3JO5Y3Z.js +50 -0
  7. package/dist/iiif-browser-form.lazy-3INAWCE5.js +54 -0
  8. package/dist/iiif-browser-form.lazy-4NX7YPGK.js +57 -0
  9. package/dist/iiif-browser-form.lazy-4X5LD2U4.js +51 -0
  10. package/dist/iiif-browser-form.lazy-5TF74M2Q.js +48 -0
  11. package/dist/iiif-browser-form.lazy-BHX6TGDY.js +58 -0
  12. package/dist/iiif-browser-form.lazy-C72INDSJ.js +57 -0
  13. package/dist/iiif-browser-form.lazy-DKKTAIO5.js +59 -0
  14. package/dist/iiif-browser-form.lazy-DPRO7R2W.js +59 -0
  15. package/dist/iiif-browser-form.lazy-EREIP6PZ.js +58 -0
  16. package/dist/iiif-browser-form.lazy-FQDZQ3UW.js +58 -0
  17. package/dist/iiif-browser-form.lazy-G7TCZSC2.js +58 -0
  18. package/dist/iiif-browser-form.lazy-HZ3M2DXT.js +57 -0
  19. package/dist/iiif-browser-form.lazy-I7KTYV3O.js +57 -0
  20. package/dist/iiif-browser-form.lazy-JMT72BLP.js +59 -0
  21. package/dist/iiif-browser-form.lazy-JX4S6NGX.js +48 -0
  22. package/dist/iiif-browser-form.lazy-KTB4BQBM.js +59 -0
  23. package/dist/iiif-browser-form.lazy-O35TC45U.js +49 -0
  24. package/dist/iiif-browser-form.lazy-OMDV43NQ.js +51 -0
  25. package/dist/iiif-browser-form.lazy-OXQVZ3GS.js +59 -0
  26. package/dist/iiif-browser-form.lazy-XORWZFSW.js +49 -0
  27. package/dist/index.cjs +1028 -537
  28. package/dist/index.d.cts +367 -21
  29. package/dist/index.d.ts +367 -21
  30. package/dist/index.js +954 -489
  31. package/dist/manifest-browser-form.lazy-FI4GGCPX.js +6 -0
  32. package/dist/manifest-browser-form.lazy-HJJKFMR6.js +6 -0
  33. package/dist/manifest-browser-form.lazy-MYI26AX4.js +6 -0
  34. package/dist/manifest-browser-form.lazy-XVYSAQAW.js +6 -0
  35. package/dist/manifest-browser-form.lazy-YYKOYF7R.js +6 -0
  36. package/package.json +12 -11
@@ -0,0 +1,59 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-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 IIIFBrowserCreatorForm(props) {
8
+ const vault = useMemo(() => new Vault(), []);
9
+ const output = useMemo(() => {
10
+ return [
11
+ {
12
+ type: "callback",
13
+ label: "Select",
14
+ supportedTypes: ["Canvas", "CanvasList", "CanvasRegion", "ImageService", "ImageServiceRegion"],
15
+ cb: (resource) => props.runCreate({ output: resource }),
16
+ format: {
17
+ type: "custom",
18
+ format: (resource, parent, vault2) => {
19
+ console.log({ resource });
20
+ const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
21
+ const resources = [];
22
+ for (const resource2 of resourcesAsArray) {
23
+ resources.push({ resource: vault2.get(resource2), parent: resource2.parent, selector: resource2.selector });
24
+ }
25
+ return { resources };
26
+ }
27
+ }
28
+ }
29
+ ];
30
+ }, [props.runCreate]);
31
+ const navigationOptions = useMemo(() => {
32
+ return {
33
+ canCropImage: true,
34
+ canSelectCanvas: true,
35
+ canSelectManifest: false,
36
+ canSelectCollection: false,
37
+ // @todo fix the output so this one works.
38
+ multiSelect: true
39
+ };
40
+ }, []);
41
+ const uiOptions = useMemo(() => {
42
+ return {
43
+ buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
44
+ };
45
+ }, []);
46
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
47
+ IIIFBrowser,
48
+ {
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
+ export {
58
+ IIIFBrowserCreatorForm as default
59
+ };
@@ -0,0 +1,58 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-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 IIIFBrowserCreatorForm(props) {
8
+ const vault = useMemo(() => new Vault(), []);
9
+ const output = useMemo(() => {
10
+ return [
11
+ {
12
+ type: "callback",
13
+ label: "Select",
14
+ supportedTypes: ["Canvas", "CanvasList", "CanvasRegion", "ImageService", "ImageServiceRegion"],
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 resource;
25
+ }
26
+ }
27
+ }
28
+ ];
29
+ }, [props.runCreate]);
30
+ const navigationOptions = useMemo(() => {
31
+ return {
32
+ canCropImage: true,
33
+ canSelectCanvas: true,
34
+ canSelectManifest: false,
35
+ canSelectCollection: false,
36
+ // @todo fix the output so this one works.
37
+ multiSelect: true
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
+ 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
+ export {
57
+ IIIFBrowserCreatorForm as default
58
+ };
@@ -0,0 +1,58 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-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 IIIFBrowserCreatorForm(props) {
8
+ const vault = useMemo(() => new Vault(), []);
9
+ const output = useMemo(() => {
10
+ return [
11
+ {
12
+ type: "callback",
13
+ label: "Select",
14
+ supportedTypes: ["Canvas", "CanvasList", "CanvasRegion", "ImageService", "ImageServiceRegion"],
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: true,
33
+ canSelectCanvas: true,
34
+ canSelectManifest: false,
35
+ canSelectCollection: false,
36
+ // @todo fix the output so this one works.
37
+ multiSelect: true
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
+ 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
+ export {
57
+ IIIFBrowserCreatorForm as default
58
+ };
@@ -0,0 +1,58 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-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 IIIFBrowserCreatorForm(props) {
8
+ const vault = useMemo(() => new Vault(), []);
9
+ const output = useMemo(() => {
10
+ return [
11
+ {
12
+ type: "callback",
13
+ label: "Select",
14
+ supportedTypes: ["Canvas", "CanvasList", "CanvasRegion", "ImageService", "ImageServiceRegion"],
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 });
23
+ }
24
+ return { resources };
25
+ }
26
+ }
27
+ }
28
+ ];
29
+ }, [props.runCreate]);
30
+ const navigationOptions = useMemo(() => {
31
+ return {
32
+ canCropImage: true,
33
+ canSelectCanvas: true,
34
+ canSelectManifest: false,
35
+ canSelectCollection: false,
36
+ // @todo fix the output so this one works.
37
+ multiSelect: true
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
+ 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
+ export {
57
+ IIIFBrowserCreatorForm as default
58
+ };
@@ -0,0 +1,57 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-browser-form.lazy.tsx
2
+ import { Vault } from "@iiif/helpers";
3
+ import {
4
+ PreviewVaultBoundary
5
+ } from "@manifest-editor/shell";
6
+ import { IIIFBrowser } from "iiif-browser";
7
+ import { useMemo } from "react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function IIIFBrowserCreatorForm(props) {
10
+ const vault = useMemo(() => new Vault(), []);
11
+ const output = useMemo(() => {
12
+ return [
13
+ {
14
+ type: "callback",
15
+ label: "Select",
16
+ supportedTypes: [
17
+ "Canvas",
18
+ "CanvasList",
19
+ "CanvasRegion",
20
+ "ImageService",
21
+ "ImageServiceRegion"
22
+ ],
23
+ cb: (resource) => props.runCreate({ output: resource }),
24
+ format: { type: "content-state" }
25
+ }
26
+ ];
27
+ }, [props.runCreate]);
28
+ const navigationOptions = useMemo(() => {
29
+ return {
30
+ canCropImage: true,
31
+ canSelectCanvas: true,
32
+ canSelectManifest: false,
33
+ canSelectCollection: false,
34
+ // @todo fix the output so this one works.
35
+ multiSelect: false
36
+ };
37
+ }, []);
38
+ const uiOptions = useMemo(() => {
39
+ return {
40
+ buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
41
+ };
42
+ }, []);
43
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
44
+ IIIFBrowser,
45
+ {
46
+ debug: true,
47
+ ui: uiOptions,
48
+ vault,
49
+ className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
50
+ output,
51
+ navigation: navigationOptions
52
+ }
53
+ ) });
54
+ }
55
+ export {
56
+ IIIFBrowserCreatorForm as default
57
+ };
@@ -0,0 +1,57 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-browser-form.lazy.tsx
2
+ import { Vault } from "@iiif/helpers";
3
+ import {
4
+ PreviewVaultBoundary
5
+ } from "@manifest-editor/shell";
6
+ import { IIIFBrowser } from "iiif-browser";
7
+ import { useMemo } from "react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function IIIFBrowserCreatorForm(props) {
10
+ const vault = useMemo(() => new Vault(), []);
11
+ const output = useMemo(() => {
12
+ return [
13
+ {
14
+ type: "callback",
15
+ label: "Select",
16
+ supportedTypes: [
17
+ "Canvas",
18
+ "CanvasList",
19
+ "CanvasRegion",
20
+ "ImageService",
21
+ "ImageServiceRegion"
22
+ ],
23
+ cb: (resource) => props.runCreate({ output: resource }),
24
+ format: { type: "content-state" }
25
+ }
26
+ ];
27
+ }, [props.runCreate]);
28
+ const navigationOptions = useMemo(() => {
29
+ return {
30
+ canCropImage: true,
31
+ canSelectCanvas: true,
32
+ canSelectManifest: false,
33
+ canSelectCollection: false,
34
+ // @todo fix the output so this one works.
35
+ multiSelect: false
36
+ };
37
+ }, []);
38
+ const uiOptions = useMemo(() => {
39
+ return {
40
+ buttonClassName: "me-primary-500"
41
+ };
42
+ }, []);
43
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
44
+ IIIFBrowser,
45
+ {
46
+ debug: true,
47
+ ui: uiOptions,
48
+ vault,
49
+ className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
50
+ output,
51
+ navigation: navigationOptions
52
+ }
53
+ ) });
54
+ }
55
+ export {
56
+ IIIFBrowserCreatorForm as default
57
+ };
@@ -0,0 +1,59 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-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 IIIFBrowserCreatorForm(props) {
8
+ const vault = useMemo(() => new Vault(), []);
9
+ const output = useMemo(() => {
10
+ return [
11
+ {
12
+ type: "callback",
13
+ label: "Select",
14
+ supportedTypes: ["Canvas", "CanvasList", "CanvasRegion", "ImageService", "ImageServiceRegion"],
15
+ cb: (resource) => props.runCreate({ output: resource }),
16
+ format: {
17
+ type: "custom",
18
+ format: (resource, parent, vault2) => {
19
+ console.log({ resource });
20
+ const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
21
+ const resources = [];
22
+ for (const resource2 of resourcesAsArray) {
23
+ resources.push({ resource: vault2.get(resource2), parent: resource2.parent });
24
+ }
25
+ return { resources };
26
+ }
27
+ }
28
+ }
29
+ ];
30
+ }, [props.runCreate]);
31
+ const navigationOptions = useMemo(() => {
32
+ return {
33
+ canCropImage: true,
34
+ canSelectCanvas: true,
35
+ canSelectManifest: false,
36
+ canSelectCollection: false,
37
+ // @todo fix the output so this one works.
38
+ multiSelect: true
39
+ };
40
+ }, []);
41
+ const uiOptions = useMemo(() => {
42
+ return {
43
+ buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
44
+ };
45
+ }, []);
46
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
47
+ IIIFBrowser,
48
+ {
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
+ export {
58
+ IIIFBrowserCreatorForm as default
59
+ };
@@ -0,0 +1,48 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-browser-form.lazy.tsx
2
+ import {
3
+ PreviewVaultBoundary,
4
+ usePreviewVault
5
+ } from "@manifest-editor/shell";
6
+ import { IIIFBrowser } from "iiif-browser";
7
+ import { useMemo } from "react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function IIIFBrowserCreatorForm(props) {
10
+ const vault = usePreviewVault();
11
+ const output = useMemo(() => {
12
+ return [
13
+ {
14
+ type: "callback",
15
+ label: "Select",
16
+ supportedTypes: [
17
+ "Canvas",
18
+ "CanvasList",
19
+ "CanvasRegion",
20
+ "ImageService",
21
+ "ImageServiceRegion"
22
+ ],
23
+ cb: (resource) => props.runCreate({ output: resource }),
24
+ format: { type: "content-state" }
25
+ }
26
+ ];
27
+ }, [props.runCreate]);
28
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
29
+ IIIFBrowser,
30
+ {
31
+ debug: true,
32
+ vault,
33
+ className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
34
+ output,
35
+ navigation: {
36
+ canCropImage: true,
37
+ canSelectCanvas: true,
38
+ canSelectManifest: false,
39
+ canSelectCollection: false,
40
+ // @todo fix the output so this one works.
41
+ multiSelect: false
42
+ }
43
+ }
44
+ ) });
45
+ }
46
+ export {
47
+ IIIFBrowserCreatorForm as default
48
+ };
@@ -0,0 +1,59 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-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 IIIFBrowserCreatorForm(props) {
8
+ const vault = useMemo(() => new Vault(), []);
9
+ const output = useMemo(() => {
10
+ return [
11
+ {
12
+ type: "callback",
13
+ label: "Select",
14
+ supportedTypes: ["Canvas", "CanvasList", "CanvasRegion", "ImageService", "ImageServiceRegion"],
15
+ cb: (resource) => props.runCreate({ output: resource }),
16
+ format: {
17
+ type: "custom",
18
+ format: (resource, parent, vault2) => {
19
+ console.log({ resource });
20
+ const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
21
+ const resources = [];
22
+ for (const resource2 of resourcesAsArray) {
23
+ resources.push({ resource: vault2.get(resource2), parent: resource2.parent, selector: resource2.selector });
24
+ }
25
+ return resource;
26
+ }
27
+ }
28
+ }
29
+ ];
30
+ }, [props.runCreate]);
31
+ const navigationOptions = useMemo(() => {
32
+ return {
33
+ canCropImage: true,
34
+ canSelectCanvas: true,
35
+ canSelectManifest: false,
36
+ canSelectCollection: false,
37
+ // @todo fix the output so this one works.
38
+ multiSelect: true
39
+ };
40
+ }, []);
41
+ const uiOptions = useMemo(() => {
42
+ return {
43
+ buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
44
+ };
45
+ }, []);
46
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
47
+ IIIFBrowser,
48
+ {
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
+ export {
58
+ IIIFBrowserCreatorForm as default
59
+ };
@@ -0,0 +1,49 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-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 IIIFBrowserCreatorForm(props) {
8
+ const vault = useMemo(() => new Vault(), []);
9
+ const output = useMemo(() => {
10
+ return [
11
+ {
12
+ type: "callback",
13
+ label: "Select",
14
+ supportedTypes: ["Canvas", "CanvasList", "CanvasRegion", "ImageService", "ImageServiceRegion"],
15
+ cb: (resource) => props.runCreate({ output: resource }),
16
+ format: { type: "content-state" }
17
+ }
18
+ ];
19
+ }, [props.runCreate]);
20
+ const navigationOptions = useMemo(() => {
21
+ return {
22
+ canCropImage: true,
23
+ canSelectCanvas: true,
24
+ canSelectManifest: false,
25
+ canSelectCollection: false,
26
+ // @todo fix the output so this one works.
27
+ multiSelect: true
28
+ };
29
+ }, []);
30
+ const uiOptions = useMemo(() => {
31
+ return {
32
+ buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
33
+ };
34
+ }, []);
35
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
36
+ IIIFBrowser,
37
+ {
38
+ debug: true,
39
+ ui: uiOptions,
40
+ vault,
41
+ className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
42
+ output,
43
+ navigation: navigationOptions
44
+ }
45
+ ) });
46
+ }
47
+ export {
48
+ IIIFBrowserCreatorForm as default
49
+ };
@@ -0,0 +1,51 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-browser-form.lazy.tsx
2
+ import {
3
+ PreviewVaultBoundary,
4
+ usePreviewVault
5
+ } from "@manifest-editor/shell";
6
+ import { IIIFBrowser } from "iiif-browser";
7
+ import { useMemo } from "react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function IIIFBrowserCreatorForm(props) {
10
+ const vault = usePreviewVault();
11
+ const output = useMemo(() => {
12
+ return [
13
+ {
14
+ type: "callback",
15
+ label: "Select",
16
+ supportedTypes: [
17
+ "Canvas",
18
+ "CanvasList",
19
+ "CanvasRegion",
20
+ "ImageService",
21
+ "ImageServiceRegion"
22
+ ],
23
+ cb: (resource) => props.runCreate({ output: resource }),
24
+ format: { type: "content-state" }
25
+ }
26
+ ];
27
+ }, [props.runCreate]);
28
+ const navigationOptions = useMemo(() => {
29
+ return {
30
+ canCropImage: true,
31
+ canSelectCanvas: true,
32
+ canSelectManifest: false,
33
+ canSelectCollection: false,
34
+ // @todo fix the output so this one works.
35
+ multiSelect: false
36
+ };
37
+ }, []);
38
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
39
+ IIIFBrowser,
40
+ {
41
+ debug: true,
42
+ vault,
43
+ className: "iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full",
44
+ output,
45
+ navigation: navigationOptions
46
+ }
47
+ ) });
48
+ }
49
+ export {
50
+ IIIFBrowserCreatorForm as default
51
+ };
@@ -0,0 +1,59 @@
1
+ // src/ContentResource/IIIFBrowserCreator/iiif-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 IIIFBrowserCreatorForm(props) {
8
+ const vault = useMemo(() => new Vault(), []);
9
+ const output = useMemo(() => {
10
+ return [
11
+ {
12
+ type: "callback",
13
+ label: "Select",
14
+ supportedTypes: ["Canvas", "CanvasList", "CanvasRegion", "ImageService", "ImageServiceRegion"],
15
+ cb: (resource) => props.runCreate({ output: resource }),
16
+ format: {
17
+ type: "custom",
18
+ format: (resource, parent, vault2) => {
19
+ console.log({ resource });
20
+ const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];
21
+ const resources = [];
22
+ for (const resource2 of resourcesAsArray) {
23
+ resources.push({ resource: vault2.get(resource2), parent: resource2.parent, selector: resource2.selector });
24
+ }
25
+ return { output: resources };
26
+ }
27
+ }
28
+ }
29
+ ];
30
+ }, [props.runCreate]);
31
+ const navigationOptions = useMemo(() => {
32
+ return {
33
+ canCropImage: true,
34
+ canSelectCanvas: true,
35
+ canSelectManifest: false,
36
+ canSelectCollection: false,
37
+ // @todo fix the output so this one works.
38
+ multiSelect: true
39
+ };
40
+ }, []);
41
+ const uiOptions = useMemo(() => {
42
+ return {
43
+ buttonClassName: "bg-me-primary-500 text-white hover:bg-me-primary-600"
44
+ };
45
+ }, []);
46
+ return /* @__PURE__ */ jsx(PreviewVaultBoundary, { children: /* @__PURE__ */ jsx(
47
+ IIIFBrowser,
48
+ {
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
+ export {
58
+ IIIFBrowserCreatorForm as default
59
+ };