@manifest-editor/creators 2.0.3-next.0.e92a6d7 → 2.1.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.
@@ -1,2 +1,2 @@
1
1
  import{useMemo as e}from"react";import{jsx as t}from"react/jsx-runtime";import{PreviewVaultBoundary as n,usePreviewVault as r}from"@manifest-editor/shell";import{IIIFBrowser as i}from"iiif-browser";function a(a){let o=r(),s=e(()=>a.options.initialData||{},[a.options.initialData]),c=e(()=>[{type:`callback`,label:`Select`,supportedTypes:[`Manifest`,`Collection`,`ManifestList`,`CollectionList`,`CollectionItemList`],cb:e=>a.runCreate({output:e}),format:{type:`custom`,format:(e,t,n)=>{let r=Array.isArray(e)?e:[{...e,parent:t}],i=[];for(let e of r)i.push({resource:n.get(e),parent:e.parent,selector:e.selector});return i}}}],[a.runCreate]),l=e(()=>({canCropImage:!1,canSelectCanvas:!1,canSelectManifest:!0,canSelectCollection:!0,multiSelect:!0,...s.iiifBrowserOptions?.navigation||{}}),[s.iiifBrowserOptions?.navigation]);return t(n,{children:t(i,{ui:e(()=>({buttonClassName:`bg-me-primary-500 text-white hover:bg-me-primary-600`,homeLink:`${window.location.origin}/collection.json`,...s.iiifBrowserOptions?.ui||{}}),[s.iiifBrowserOptions?.ui]),vault:o,className:`iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full`,output:c,navigation:l,customPages:s.iiifBrowserOptions?.customPages||{},history:s.iiifBrowserOptions?.history||{}})})}export{a as t};
2
- //# sourceMappingURL=manifest-browser-form.lazy-BTnOj81t.js.map
2
+ //# sourceMappingURL=manifest-browser-form.lazy-CUJKdJ0m.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-browser-form.lazy-BTnOj81t.js","names":["initialData: ManifestBrowserCreatorInitialData","resource","vault"],"sources":["../src/Manifest/ManifestBrowserCreator/manifest-browser-form.lazy.tsx"],"sourcesContent":["import type { CreatorContext } from \"@manifest-editor/creator-api\";\nimport { PreviewVaultBoundary, usePreviewVault } from \"@manifest-editor/shell\";\nimport { IIIFBrowser, type IIIFBrowserProps } from \"iiif-browser\";\nimport { useMemo } from \"react\";\n\nexport interface ManifestBrowserCreatorInitialData {\n iiifBrowserOptions?: Partial<IIIFBrowserProps>;\n}\n\nexport default function ManifestBrowserCreatorForm(props: CreatorContext) {\n const vault = usePreviewVault();\n const initialData: ManifestBrowserCreatorInitialData = useMemo(() => {\n return props.options.initialData || {};\n }, [props.options.initialData]);\n\n const output = useMemo(() => {\n return [\n {\n type: \"callback\",\n label: \"Select\",\n supportedTypes: [\n \"Manifest\",\n \"Collection\",\n \"ManifestList\",\n \"CollectionList\",\n \"CollectionItemList\",\n ],\n cb: (resource) => props.runCreate({ output: resource }),\n format: {\n type: \"custom\",\n format: (resource, parent, vault) => {\n const resourcesAsArray = Array.isArray(resource)\n ? resource\n : [{ ...resource, parent }];\n const resources = [];\n for (const resource of resourcesAsArray) {\n resources.push({\n resource: vault.get(resource),\n parent: resource.parent,\n selector: resource.selector,\n });\n }\n return resources;\n },\n },\n },\n ] as IIIFBrowserProps[\"output\"];\n }, [props.runCreate]);\n\n const navigationOptions = useMemo(() => {\n return {\n canCropImage: false,\n canSelectCanvas: false,\n canSelectManifest: true,\n canSelectCollection: true,\n multiSelect: true,\n ...(initialData.iiifBrowserOptions?.navigation || {}),\n };\n }, [initialData.iiifBrowserOptions?.navigation]);\n\n const uiOptions = useMemo(() => {\n return {\n buttonClassName: \"bg-me-primary-500 text-white hover:bg-me-primary-600\",\n homeLink: `${window.location.origin}/collection.json`,\n ...(initialData.iiifBrowserOptions?.ui || {}),\n } as IIIFBrowserProps[\"ui\"];\n }, [initialData.iiifBrowserOptions?.ui]);\n\n return (\n <PreviewVaultBoundary>\n <IIIFBrowser\n ui={uiOptions}\n vault={vault}\n className=\"iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full\"\n output={output}\n navigation={navigationOptions}\n customPages={(initialData.iiifBrowserOptions?.customPages || {})}\n history={initialData.iiifBrowserOptions?.history || {}}\n />\n </PreviewVaultBoundary>\n );\n}\n"],"mappings":"sMASA,SAAwB,EAA2B,EAAuB,CACxE,IAAM,EAAQ,GAAiB,CACzBA,EAAiD,MAC9C,EAAM,QAAQ,aAAe,EAAE,CACrC,CAAC,EAAM,QAAQ,YAAY,CAAC,CAEzB,EAAS,MACN,CACL,CACE,KAAM,WACN,MAAO,SACP,eAAgB,CACd,WACA,aACA,eACA,iBACA,qBACD,CACD,GAAK,GAAa,EAAM,UAAU,CAAE,OAAQ,EAAU,CAAC,CACvD,OAAQ,CACN,KAAM,SACN,QAAS,EAAU,EAAQ,IAAU,CACnC,IAAM,EAAmB,MAAM,QAAQ,EAAS,CAC5C,EACA,CAAC,CAAE,GAAG,EAAU,SAAQ,CAAC,CACvB,EAAY,EAAE,CACpB,IAAK,IAAMC,KAAY,EACrB,EAAU,KAAK,CACb,SAAUC,EAAM,IAAID,EAAS,CAC7B,OAAQA,EAAS,OACjB,SAAUA,EAAS,SACpB,CAAC,CAEJ,OAAO,GAEV,CACF,CACF,CACA,CAAC,EAAM,UAAU,CAAC,CAEf,EAAoB,OACjB,CACL,aAAc,GACd,gBAAiB,GACjB,kBAAmB,GACnB,oBAAqB,GACrB,YAAa,GACb,GAAI,EAAY,oBAAoB,YAAc,EAAE,CACrD,EACA,CAAC,EAAY,oBAAoB,WAAW,CAAC,CAUhD,OACE,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CACC,GAXY,OACT,CACL,gBAAiB,uDACjB,SAAU,GAAG,OAAO,SAAS,OAAO,kBACpC,GAAI,EAAY,oBAAoB,IAAM,EAAE,CAC7C,EACA,CAAC,EAAY,oBAAoB,GAAG,CAAC,CAM3B,QACP,UAAU,6FACF,SACR,WAAY,EACZ,YAAc,EAAY,oBAAoB,aAAe,EAAE,CAC/D,QAAS,EAAY,oBAAoB,SAAW,EAAE,EACtD,CAAA,CACmB"}
1
+ {"version":3,"file":"manifest-browser-form.lazy-CUJKdJ0m.js","names":["initialData: ManifestBrowserCreatorInitialData","resource","vault"],"sources":["../src/Manifest/ManifestBrowserCreator/manifest-browser-form.lazy.tsx"],"sourcesContent":["import type { CreatorContext } from \"@manifest-editor/creator-api\";\nimport { PreviewVaultBoundary, usePreviewVault } from \"@manifest-editor/shell\";\nimport { IIIFBrowser, type IIIFBrowserProps } from \"iiif-browser\";\nimport { useMemo } from \"react\";\n\nexport interface ManifestBrowserCreatorInitialData {\n iiifBrowserOptions?: Partial<IIIFBrowserProps>;\n}\n\nexport default function ManifestBrowserCreatorForm(props: CreatorContext) {\n const vault = usePreviewVault();\n const initialData: ManifestBrowserCreatorInitialData = useMemo(() => {\n return props.options.initialData || {};\n }, [props.options.initialData]);\n\n const output = useMemo(() => {\n return [\n {\n type: \"callback\",\n label: \"Select\",\n supportedTypes: [\n \"Manifest\",\n \"Collection\",\n \"ManifestList\",\n \"CollectionList\",\n \"CollectionItemList\",\n ],\n cb: (resource) => props.runCreate({ output: resource }),\n format: {\n type: \"custom\",\n format: (resource, parent, vault) => {\n const resourcesAsArray = Array.isArray(resource)\n ? resource\n : [{ ...resource, parent }];\n const resources = [];\n for (const resource of resourcesAsArray) {\n resources.push({\n resource: vault.get(resource),\n parent: resource.parent,\n selector: resource.selector,\n });\n }\n return resources;\n },\n },\n },\n ] as IIIFBrowserProps[\"output\"];\n }, [props.runCreate]);\n\n const navigationOptions = useMemo(() => {\n return {\n canCropImage: false,\n canSelectCanvas: false,\n canSelectManifest: true,\n canSelectCollection: true,\n multiSelect: true,\n ...(initialData.iiifBrowserOptions?.navigation || {}),\n };\n }, [initialData.iiifBrowserOptions?.navigation]);\n\n const uiOptions = useMemo(() => {\n return {\n buttonClassName: \"bg-me-primary-500 text-white hover:bg-me-primary-600\",\n homeLink: `${window.location.origin}/collection.json`,\n ...(initialData.iiifBrowserOptions?.ui || {}),\n } as IIIFBrowserProps[\"ui\"];\n }, [initialData.iiifBrowserOptions?.ui]);\n\n return (\n <PreviewVaultBoundary>\n <IIIFBrowser\n ui={uiOptions}\n vault={vault}\n className=\"iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full\"\n output={output}\n navigation={navigationOptions}\n customPages={(initialData.iiifBrowserOptions?.customPages || {})}\n history={initialData.iiifBrowserOptions?.history || {}}\n />\n </PreviewVaultBoundary>\n );\n}\n"],"mappings":"sMASA,SAAwB,EAA2B,EAAuB,CACxE,IAAM,EAAQ,GAAiB,CACzBA,EAAiD,MAC9C,EAAM,QAAQ,aAAe,EAAE,CACrC,CAAC,EAAM,QAAQ,YAAY,CAAC,CAEzB,EAAS,MACN,CACL,CACE,KAAM,WACN,MAAO,SACP,eAAgB,CACd,WACA,aACA,eACA,iBACA,qBACD,CACD,GAAK,GAAa,EAAM,UAAU,CAAE,OAAQ,EAAU,CAAC,CACvD,OAAQ,CACN,KAAM,SACN,QAAS,EAAU,EAAQ,IAAU,CACnC,IAAM,EAAmB,MAAM,QAAQ,EAAS,CAC5C,EACA,CAAC,CAAE,GAAG,EAAU,SAAQ,CAAC,CACvB,EAAY,EAAE,CACpB,IAAK,IAAMC,KAAY,EACrB,EAAU,KAAK,CACb,SAAUC,EAAM,IAAID,EAAS,CAC7B,OAAQA,EAAS,OACjB,SAAUA,EAAS,SACpB,CAAC,CAEJ,OAAO,GAEV,CACF,CACF,CACA,CAAC,EAAM,UAAU,CAAC,CAEf,EAAoB,OACjB,CACL,aAAc,GACd,gBAAiB,GACjB,kBAAmB,GACnB,oBAAqB,GACrB,YAAa,GACb,GAAI,EAAY,oBAAoB,YAAc,EAAE,CACrD,EACA,CAAC,EAAY,oBAAoB,WAAW,CAAC,CAUhD,OACE,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CACC,GAXY,OACT,CACL,gBAAiB,uDACjB,SAAU,GAAG,OAAO,SAAS,OAAO,kBACpC,GAAI,EAAY,oBAAoB,IAAM,EAAE,CAC7C,EACA,CAAC,EAAY,oBAAoB,GAAG,CAAC,CAM3B,QACP,UAAU,6FACF,SACR,WAAY,EACZ,YAAc,EAAY,oBAAoB,aAAe,EAAE,CAC/D,QAAS,EAAY,oBAAoB,SAAW,EAAE,EACtD,CAAA,CACmB"}
@@ -0,0 +1 @@
1
+ const e=require(`./manifest-browser-form.lazy-CMV49j5Z.cjs`);exports.default=e.t;
@@ -0,0 +1 @@
1
+ import{t as e}from"./manifest-browser-form.lazy-CUJKdJ0m.js";export{e as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manifest-editor/creators",
3
- "version": "2.0.3-next.0.e92a6d7",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
6
6
  "repository": {
@@ -41,21 +41,21 @@
41
41
  "@iiif/parser": "2.2.8",
42
42
  "@iiif/presentation-3": "^2.2.3",
43
43
  "@iiif/presentation-3-normalized": "^0.9.7",
44
- "@manifest-editor/components": "2.0.3-next.0.e92a6d7",
45
- "@manifest-editor/creator-api": "2.0.3-next.0.e92a6d7",
46
- "@manifest-editor/editor-api": "2.0.3-next.0.e92a6d7",
47
- "@manifest-editor/editors": "2.0.3-next.0.e92a6d7",
48
- "@manifest-editor/shell": "2.0.3-next.0.e92a6d7",
44
+ "@manifest-editor/components": "2.1.0",
45
+ "@manifest-editor/creator-api": "2.1.0",
46
+ "@manifest-editor/editor-api": "2.1.0",
47
+ "@manifest-editor/editors": "2.1.0",
48
+ "@manifest-editor/shell": "2.1.0",
49
49
  "iiif-browser": "2.0.5-next.95a29ac",
50
50
  "react": "19.2.0",
51
51
  "react-dom": "19.2.0",
52
52
  "react-error-boundary": "^4.0.13",
53
- "react-iiif-vault": "2.0.6",
53
+ "react-iiif-vault": "2.0.11",
54
54
  "styled-components": "6.1.8"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@atlas-viewer/iiif-image-api": "^2.2.0",
58
- "@manifest-editor/ui": "2.0.2",
58
+ "@manifest-editor/ui": "2.1.0",
59
59
  "@repo/eslint-config": "",
60
60
  "@types/react": "^18.3.3",
61
61
  "@types/react-dom": "^18.3.0",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "e92a6d7aa6c0edada0521d17e21f3cd5defba447"
70
+ "gitHead": "96fdf3010c854efc620205ad43a3e361fea56691"
71
71
  }
@@ -1 +0,0 @@
1
- const e=require(`./manifest-browser-form.lazy-DqPd_M1o.cjs`);exports.default=e.t;
@@ -1 +0,0 @@
1
- import{t as e}from"./manifest-browser-form.lazy-BTnOj81t.js";export{e as default};