@manifest-editor/manifest-preset 1.4.3 → 2.0.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.
- package/dist/components-BXdAFfup.js +2 -0
- package/dist/components-BXdAFfup.js.map +1 -0
- package/dist/components-cGHI3B6O.cjs +1 -0
- package/dist/components.cjs +1 -378
- package/dist/components.d.cts +84 -63
- package/dist/components.d.cts.map +1 -0
- package/dist/components.d.ts +84 -63
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +1 -24
- package/dist/index.cjs +108 -432
- package/dist/index.css +688 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +31 -28
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +31 -28
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +120 -51
- package/dist/index.js.map +1 -0
- package/package.json +36 -37
- package/dist/chunk-SJ3QA4KN.js +0 -425
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{CanvasGrid as e,CanvasList as t,InlineLocaleStringEditor as n,InputContainer as r,createAppActions as i,useInStack as a,useToggleList as o}from"@manifest-editor/editors";import{useConfig as s,useCreator as c,useEditingStack as l,useLayoutActions as u,useLayoutState as d,useManifestEditor as f}from"@manifest-editor/shell";import{LocaleString as p,ManifestMetadata as m,useManifest as h}from"react-iiif-vault";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{ActionButton as y,AddIcon as b,CanvasThumbnailGridItem as x,CreateCanvasIcon as S,IIIFBrowserIcon as C,ManifestOverviewEmptyState as w,Sidebar as T,SidebarContent as E,SidebarHeader as D,ThumbnailGridContainer as O,useFastList as k,useGridOptions as A}from"@manifest-editor/components";import{useLayoutEffect as j}from"react";const M={id:`overview`,label:`Overview`,icon:``,render:()=>_(N,{})};function N(){let{edit:e,open:t}=u(),{structural:n,technical:r}=f(),{items:i}=n,{editorFeatureFlags:{manifestGridOptions:a=!1}}=s(),[o,l]=c({id:r.id.get(),type:`Manifest`},`items`,`Canvas`,void 0,{isPainting:!0}),p=k(i.get(),24),{leftPanel:m}=d(),h=m.current===`left-panel-manifest`,[{size:S},T]=A(`manifest-grid-size`);return!p||p.length===0?_(`div`,{children:_(w,{onCreate:l.create,canCreate:o})}):v(g,{children:[a?v(`div`,{className:`p-2 flex gap-2 justify-between items-center`,children:[T,v(`div`,{className:`flex gap-2`,children:[v(y,{isDisabled:!o,onPress:()=>l.create(),children:[_(b,{className:`text-xl`}),` Add new canvas`]}),_(y,{onPress:()=>l.creator(`@manifest-editor/iiif-browser-creator`),children:_(C,{className:`text-xl`})})]})]}):null,_(O,{wide:!0,size:S,children:p.map(e=>_(x,{id:e.id,onClick:()=>{t({id:`current-canvas`}),h&&t({id:`canvas-listing`,state:{gridView:!0}}),l.edit(e)}},e.id))})]})}const P=({title:e,titleId:t,...n})=>v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:`1em`,height:`1em`,"aria-labelledby":t,...n,children:[e?_(`title`,{id:t,children:e}):null,v(`g`,{fill:`none`,children:[_(`path`,{d:`M0 0h24v24H0V0z`}),_(`path`,{d:`M0 0h24v24H0V0z`,opacity:`.87`})]}),_(`path`,{d:`M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z`,fill:`currentColor`})]}),F={id:`canvas-listing`,label:`Canvases`,icon:_(P,{}),render:(e,t,n)=>_(I,{gridView:e.gridView||localStorage.getItem(`canvas-listing-view-mode`)===`grid`,onChangeGridView:e=>{localStorage.setItem(`canvas-listing-view-mode`,e?`grid`:`list`),t.actions.change(`canvas-listing`,{gridView:e})}})};function I({gridView:e,onChangeGridView:t}){let{structural:n,technical:r}=f(),[i,a]=o(),{items:s}=n,[l,u]=c({id:r.id.get(),type:`Manifest`},`items`,`Canvas`,void 0,{isPainting:!0});return j(()=>{let e=document.querySelector(`[data-canvas-selected="true"]`);e&&e.scrollIntoView({block:`center`})},[k(s.get(),24),e]),v(T,{children:[_(D,{title:`Canvases`,actions:[{icon:_(g,{children:e?_(P,{width:24,height:24}):_(V,{})}),title:e?`List view`:`Grid view`,onClick:()=>{t(!e)}},{icon:_(B,{}),title:`Edit canvases`,toggled:i.items,onClick:()=>a(`items`)},{icon:_(C,{className:`text-2xl`}),title:`IIIF Browser`,onClick:()=>u.creator(`@manifest-editor/iiif-browser-creator`),disabled:!l},{icon:_(S,{}),title:`Add new canvas`,onClick:()=>u.create(),disabled:!l}]}),_(e?R:z,{isEditing:i.items})]})}function L(){let{edit:e,open:t}=u(),n=a(`Canvas`),{technical:r,structural:i}=f(),{items:o}=i,s={id:r.id.get(),type:`Manifest`},l=k(o.get(),24),[d,p]=c(s,`items`,`Canvas`,void 0,{isPainting:!0});return{canvas:n,canvases:l,items:o,canvasActions:p,open:t,edit:e,canCreateCanvas:d}}function R({isEditing:t}){let{canvas:n,items:r,canvasActions:a,open:o}=L(),s=h(),c=l(),u=r.get(),d=n?.resource.source.id,f=u.findIndex(e=>e.id===d),p=f&&f>0?Number(f-1):0;function m(){c.close();let e=r.get();e&&e.length>0?a.edit(e[p]):a.edit(s)}return _(E,{children:_(O,{children:_(e,{id:r.focusId(),list:r.get()||[],inlineHandle:!1,activeId:n?.resource.source.id,reorder:t?e=>r.reorder(e.startIndex,e.endIndex):void 0,onSelect:(e,t)=>{o({id:`current-canvas`}),a.edit(e,t)},createActions:i(r,m)})})})}function z({isEditing:e}){let{canvas:n,items:a,canvasActions:o,open:s}=L(),c=h(),u=l(),d=a.get()||[],f=n?.resource.source.id,p=d.findIndex(e=>e.id===f),m=p&&p>0?Number(p-1):0;function g(){u.close();let e=a.get();e&&e.length>0?o.edit(e[m]):o.edit(c)}return _(E,{className:`p-3`,children:_(r,{$wide:!0,children:_(t,{id:a.focusId(),list:a.get()||[],inlineHandle:!1,activeId:n?.resource.source.id,reorder:e?e=>a.reorder(e.startIndex,e.endIndex):void 0,onSelect:(e,t)=>{s({id:`current-canvas`}),o.edit(e,t)},createActions:i(a,g)})})})}function B(e){return v(`svg`,{className:`text-xl`,xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:[_(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),_(`path`,{d:`M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z`,fill:`currentColor`})]})}function V(){return v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24`,viewBox:`0 0 24 24`,width:`24`,children:[_(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),_(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z`,fill:`currentColor`})]})}function H({title:e,titleId:t,...n}){return v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,"aria-labelledby":t,...n,children:[e?_(`title`,{id:t,children:e}):null,_(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),_(`path`,{d:`M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z`,fill:`currentColor`})]})}const U={id:`left-panel-manifest`,label:`Manifest summary`,icon:_(H,{}),render:(e,t,n)=>_(G,{})};function W(e){return _(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:_(`path`,{fill:`currentColor`,d:`m15 16l-4 4h10v-4zm-2.94-8.81L3 16.25V20h3.75l9.06-9.06zm1.072-1.067l2.539-2.539l3.747 3.748L16.88 9.87z`})})}function G(){let{descriptive:e,technical:t}=f();t.id.get();let r=e.label.get(),i=e.summary.get(),a=e.requiredStatement.get(),o=e.metadata.get(),{open:s}=u();return v(T,{children:[_(D,{title:`Manifest summary`,actions:[{icon:_(W,{className:`text-xl`}),title:`Edit metadata`,onClick:()=>{s(`@manifest-editor/editor`,{currentTab:`@manifest-editor/descriptive-properties`})}}]}),v(E,{className:`p-4`,children:[r?_(n,{as:`h2`,className:`text-lg font-semibold mb-2 [&>a]:underline [&>a]:hover:text-slate-400`,editor:e.label,children:r}):null,i?_(p,{enableDangerouslySetInnerHTML:!0,as:`p`,className:`text-sm text-slate-800 block [&>a]:underline [&>a]:hover:text-slate-400 mb-2`,children:i}):null,_(`hr`,{}),a?v(g,{children:[v(`div`,{className:`py-2 text-black`,children:[_(p,{as:`h4`,className:`font-bold text-black w-full text-sm font-semibold mb-0 [&>a]:underline [&>a]:hover:text-slate-400`,children:a.label}),_(p,{enableDangerouslySetInnerHTML:!0,className:`text-sm [&>a]:underline [&>a]:hover:text-slate-400`,children:a.value})]}),_(`hr`,{})]}):null,o&&o.length===0?_(`div`,{className:`py-2 text-gray-400`,children:`You can add some descriptive metadata for this manifest using the editing panel on the right`}):null,_(m,{allowHtml:!0,classes:{container:`w-full`,row:`border-b border-gray-200 flex flex-col flex-wrap py-2`,label:`font-bold text-black w-full text-sm font-semibold mb-1`,value:`text-sm text-black block [&>span>a]:underline [&>span>a]:hover:text-slate-400`,empty:`text-gray-400`}})]})]})}export{z as a,V as c,L as d,N as f,R as i,B as l,G as n,I as o,M as p,U as r,P as s,H as t,F as u};
|
|
2
|
+
//# sourceMappingURL=components-BXdAFfup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-BXdAFfup.js","names":["manifestOverview: LayoutPanel","canvasListing: LayoutPanel","ListEditIcon","prevCanvasIndex: number","manifestPanel: LayoutPanel"],"sources":["../src/center-panels/manifest-overview.tsx","../src/left-panels/canvas-listing.tsx","../src/left-panels/manifest.tsx"],"sourcesContent":["import {\n ActionButton,\n AddIcon,\n CanvasThumbnailGridItem,\n IIIFBrowserIcon,\n ManifestOverviewEmptyState,\n ThumbnailGridContainer,\n useFastList,\n useGridOptions,\n} from \"@manifest-editor/components\";\nimport { EditableCanvasLabel } from \"@manifest-editor/editors\";\nimport {\n type LayoutPanel,\n useConfig,\n useCreator,\n useLayoutActions,\n useLayoutState,\n useManifestEditor,\n} from \"@manifest-editor/shell\";\nimport { useState } from \"react\";\n\nexport const manifestOverview: LayoutPanel = {\n id: \"overview\",\n label: \"Overview\",\n icon: \"\",\n render: () => <ManifestOverviewCenterPanel />,\n};\n\nexport function ManifestOverviewCenterPanel() {\n const { edit, open } = useLayoutActions();\n const { structural, technical } = useManifestEditor();\n const { items } = structural;\n const {\n editorFeatureFlags: { manifestGridOptions = false },\n } = useConfig();\n const manifestId = technical.id.get();\n const manifest = { id: manifestId, type: \"Manifest\" };\n const [canCreateCanvas, canvasActions] = useCreator(manifest, \"items\", \"Canvas\", undefined, { isPainting: true });\n const canvases = useFastList(items.get(), 24);\n const { leftPanel } = useLayoutState();\n const isEditingManifest = leftPanel.current === \"left-panel-manifest\";\n const [{ size }, gridOptions] = useGridOptions(\"manifest-grid-size\");\n\n if (!canvases || canvases.length === 0) {\n return (\n <div>\n <ManifestOverviewEmptyState onCreate={canvasActions.create} canCreate={canCreateCanvas} />\n </div>\n );\n }\n return (\n <>\n {manifestGridOptions ? (\n <div className=\"p-2 flex gap-2 justify-between items-center\">\n {gridOptions}\n <div className=\"flex gap-2\">\n <ActionButton isDisabled={!canCreateCanvas} onPress={() => canvasActions.create()}>\n <AddIcon className=\"text-xl\" /> Add new canvas\n </ActionButton>\n <ActionButton onPress={() => canvasActions.creator(\"@manifest-editor/iiif-browser-creator\")}>\n <IIIFBrowserIcon className=\"text-xl\" />\n </ActionButton>\n </div>\n </div>\n ) : null}\n <ThumbnailGridContainer wide size={size}>\n {canvases.map((item) => (\n <CanvasThumbnailGridItem\n id={item.id}\n key={item.id}\n onClick={() => {\n open({ id: \"current-canvas\" });\n if (isEditingManifest) {\n open({ id: \"canvas-listing\", state: { gridView: true } });\n }\n canvasActions.edit(item);\n }}\n />\n ))}\n </ThumbnailGridContainer>\n </>\n );\n}\n","import {\n CanvasThumbnailGridItem,\n CreateCanvasIcon,\n IIIFBrowserIcon,\n Sidebar,\n SidebarContent,\n SidebarHeader,\n ThumbnailGridContainer,\n useFastList,\n} from \"@manifest-editor/components\";\nimport { manifestBrowserCreator } from \"@manifest-editor/creators\";\nimport {\n CanvasGrid,\n CanvasList,\n createAppActions,\n InputContainer,\n useInStack,\n useToggleList,\n} from \"@manifest-editor/editors\";\nimport {\n type LayoutPanel,\n useCreator,\n useEditingStack,\n useLayoutActions,\n useManifestEditor,\n} from \"@manifest-editor/shell\";\nimport { type SVGProps, useEffect, useLayoutEffect } from \"react\";\nimport { useCollection, useManifest } from \"react-iiif-vault\";\n\nexport const CanvasListingIcon = ({\n title,\n titleId,\n ...props\n}: SVGProps<SVGSVGElement> & { title?: string; titleId?: string }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"1em\"\n height=\"1em\"\n aria-labelledby={titleId}\n {...props}\n >\n {title ? <title id={titleId}>{title}</title> : null}\n\n <g fill=\"none\">\n <path d=\"M0 0h24v24H0V0z\" />\n <path d=\"M0 0h24v24H0V0z\" opacity=\".87\" />\n </g>\n <path\n d=\"M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport const canvasListing: LayoutPanel = {\n id: \"canvas-listing\",\n label: \"Canvases\",\n icon: <CanvasListingIcon />,\n render: (state, ctx, app) => {\n return (\n <CanvasListing\n gridView={state.gridView || localStorage.getItem(\"canvas-listing-view-mode\") === \"grid\"}\n onChangeGridView={(gridView) => {\n localStorage.setItem(\"canvas-listing-view-mode\", gridView ? \"grid\" : \"list\");\n ctx.actions.change(\"canvas-listing\", { gridView });\n }}\n />\n );\n },\n};\n\nexport function CanvasListing({\n gridView,\n onChangeGridView,\n}: {\n gridView: boolean;\n onChangeGridView: (gridView: boolean) => void;\n}) {\n const { structural, technical } = useManifestEditor();\n const [toggled, toggle] = useToggleList();\n const { items } = structural;\n const manifestId = technical.id.get();\n const manifest = { id: manifestId, type: \"Manifest\" };\n const [canCreateCanvas, canvasActions] = useCreator(manifest, \"items\", \"Canvas\", undefined, { isPainting: true });\n const canvases = useFastList(items.get(), 24);\n\n useLayoutEffect(() => {\n const selected = document.querySelector('[data-canvas-selected=\"true\"]');\n if (selected) {\n selected.scrollIntoView({ block: \"center\" });\n }\n }, [canvases, gridView]);\n\n return (\n <Sidebar>\n <SidebarHeader\n title=\"Canvases\"\n actions={[\n {\n icon: <>{gridView ? <CanvasListingIcon width={24} height={24} /> : <CanvasThumbnailsIcon />}</>,\n title: gridView ? \"List view\" : \"Grid view\",\n onClick: () => {\n onChangeGridView(!gridView);\n },\n },\n {\n icon: <ListEditIcon />,\n title: \"Edit canvases\",\n toggled: toggled.items,\n onClick: () => toggle(\"items\"),\n },\n {\n icon: <IIIFBrowserIcon className=\"text-2xl\" />,\n title: \"IIIF Browser\",\n onClick: () => canvasActions.creator(\"@manifest-editor/iiif-browser-creator\"),\n disabled: !canCreateCanvas,\n },\n {\n icon: <CreateCanvasIcon />,\n title: \"Add new canvas\",\n onClick: () => canvasActions.create(),\n disabled: !canCreateCanvas,\n },\n ]}\n />\n {gridView ? <CanvasGridView isEditing={toggled.items} /> : <CanvasListView isEditing={toggled.items} />}\n </Sidebar>\n );\n}\n\nexport function useEditCanvasItems() {\n const { edit, open } = useLayoutActions();\n const canvas = useInStack(\"Canvas\");\n const { technical, structural } = useManifestEditor();\n const { items } = structural;\n const manifestId = technical.id.get();\n const manifest = { id: manifestId, type: \"Manifest\" };\n const canvases = useFastList(items.get(), 24);\n const [canCreateCanvas, canvasActions] = useCreator(manifest, \"items\", \"Canvas\", undefined, { isPainting: true });\n\n return {\n canvas,\n canvases,\n items,\n canvasActions,\n open,\n edit,\n canCreateCanvas,\n };\n}\n\nexport function CanvasGridView({ isEditing }: { isEditing: boolean }) {\n const { canvas, items, canvasActions, open } = useEditCanvasItems();\n const manifest = useManifest();\n const editingStack = useEditingStack();\n const canvases = items.get();\n const canvasId = canvas?.resource.source.id;\n\n // Find current canvas to get its index before deleting it\n const canvasIndex = canvases.findIndex((canv) => canv.id === canvasId);\n const prevCanvasIndex: number = canvasIndex && canvasIndex > 0 ? Number(canvasIndex - 1) : 0;\n\n function onDeleteCanvas() {\n editingStack.close(); // close the deleted canvas\n const newCanvases = items.get(); // refresh canvases\n\n if (newCanvases && newCanvases.length > 0) {\n canvasActions.edit(newCanvases[prevCanvasIndex]);\n } else {\n canvasActions.edit(manifest);\n }\n }\n\n return (\n <SidebarContent>\n <ThumbnailGridContainer>\n <CanvasGrid\n id={items.focusId()}\n list={items.get() || []}\n inlineHandle={false}\n activeId={canvas?.resource.source.id}\n reorder={isEditing ? (t: any) => items.reorder(t.startIndex, t.endIndex) : undefined}\n onSelect={(item: any, idx: number) => {\n open({ id: \"current-canvas\" });\n canvasActions.edit(item, idx);\n }}\n createActions={createAppActions(items, onDeleteCanvas)}\n />\n </ThumbnailGridContainer>\n </SidebarContent>\n );\n}\n\nexport function CanvasListView({ isEditing }: { isEditing: boolean }) {\n const { canvas, items, canvasActions, open } = useEditCanvasItems();\n const manifest = useManifest();\n const editingStack = useEditingStack();\n const canvases = items.get() || [];\n const canvasId = canvas?.resource.source.id;\n\n // Find current canvas to get its index before deleting it\n const canvasIndex = canvases.findIndex((canv) => canv.id === canvasId);\n const prevCanvasIndex: number = canvasIndex && canvasIndex > 0 ? Number(canvasIndex - 1) : 0;\n\n function onDeleteCanvas() {\n editingStack.close(); // close the deleted canvas\n const newCanvases = items.get(); // refresh canvases\n\n if (newCanvases && newCanvases.length > 0) {\n canvasActions.edit(newCanvases[prevCanvasIndex]);\n } else {\n canvasActions.edit(manifest);\n }\n }\n\n return (\n <SidebarContent className=\"p-3\">\n <InputContainer $wide>\n <CanvasList\n id={items.focusId()}\n list={items.get() || []}\n inlineHandle={false}\n activeId={canvas?.resource.source.id}\n reorder={isEditing ? (t) => items.reorder(t.startIndex, t.endIndex) : undefined}\n onSelect={(item, idx) => {\n open({ id: \"current-canvas\" });\n canvasActions.edit(item, idx);\n }}\n createActions={createAppActions(items, onDeleteCanvas)}\n />\n </InputContainer>\n </SidebarContent>\n );\n}\n\nexport function ListEditIcon(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg className=\"text-xl\" xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path\n d=\"M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport function CanvasThumbnailsIcon() {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path\n d=\"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n","import { Sidebar, SidebarContent, SidebarHeader } from \"@manifest-editor/components\";\nimport { InlineLocaleStringEditor } from \"@manifest-editor/editors\";\nimport { type LayoutPanel, useLayoutActions, useManifestEditor } from \"@manifest-editor/shell\";\nimport type { SVGProps } from \"react\";\nimport { LocaleString, ManifestMetadata } from \"react-iiif-vault\";\n\nexport function ManifestIcon({\n title,\n titleId,\n ...props\n}: SVGProps<SVGSVGElement> & { title?: string; titleId?: string }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" aria-labelledby={titleId} {...props}>\n {title ? <title id={titleId}>{title}</title> : null}\n\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path\n d=\"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport const manifestPanel: LayoutPanel = {\n id: \"left-panel-manifest\",\n label: \"Manifest summary\",\n icon: <ManifestIcon />,\n render: (state, ctx, app) => {\n return <ManifestPanel />;\n },\n};\n\nfunction EditManifestMetadataIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n {/* Icon from Google Material Icons by Material Design Authors - https://github.com/material-icons/material-icons/blob/master/LICENSE */}\n <path\n fill=\"currentColor\"\n d=\"m15 16l-4 4h10v-4zm-2.94-8.81L3 16.25V20h3.75l9.06-9.06zm1.072-1.067l2.539-2.539l3.747 3.748L16.88 9.87z\"\n />\n </svg>\n );\n}\n\nexport function ManifestPanel() {\n const { descriptive, technical } = useManifestEditor();\n const id = technical.id.get();\n const label = descriptive.label.get();\n const summary = descriptive.summary.get();\n const requiredStatement = descriptive.requiredStatement.get();\n const metadata = descriptive.metadata.get();\n const { open } = useLayoutActions();\n\n return (\n <Sidebar>\n <SidebarHeader\n title=\"Manifest summary\"\n actions={[\n {\n icon: <EditManifestMetadataIcon className=\"text-xl\" />,\n title: \"Edit metadata\",\n onClick: () => {\n open(\"@manifest-editor/editor\", {\n currentTab: \"@manifest-editor/descriptive-properties\",\n });\n },\n },\n ]}\n />\n <SidebarContent className=\"p-4\">\n {label ? (\n <InlineLocaleStringEditor\n as=\"h2\"\n className=\"text-lg font-semibold mb-2 [&>a]:underline [&>a]:hover:text-slate-400\"\n editor={descriptive.label}\n >\n {label}\n </InlineLocaleStringEditor>\n ) : null}\n\n {summary ? (\n <LocaleString\n enableDangerouslySetInnerHTML\n as=\"p\"\n className=\"text-sm text-slate-800 block [&>a]:underline [&>a]:hover:text-slate-400 mb-2\"\n >\n {summary}\n </LocaleString>\n ) : null}\n\n <hr />\n {requiredStatement ? (\n <>\n <div className=\"py-2 text-black\">\n <LocaleString\n as=\"h4\"\n className=\"font-bold text-black w-full text-sm font-semibold mb-0 [&>a]:underline [&>a]:hover:text-slate-400\"\n >\n {requiredStatement.label}\n </LocaleString>\n <LocaleString\n enableDangerouslySetInnerHTML\n className=\"text-sm [&>a]:underline [&>a]:hover:text-slate-400\"\n >\n {requiredStatement.value}\n </LocaleString>\n </div>\n\n <hr />\n </>\n ) : null}\n\n {metadata && metadata.length === 0 ? (\n <div className=\"py-2 text-gray-400\">\n You can add some descriptive metadata for this manifest using the editing panel on the right\n </div>\n ) : null}\n\n <ManifestMetadata\n allowHtml\n classes={{\n container: \"w-full\",\n row: \"border-b border-gray-200 flex flex-col flex-wrap py-2\",\n label: \"font-bold text-black w-full text-sm font-semibold mb-1\",\n value: \"text-sm text-black block [&>span>a]:underline [&>span>a]:hover:text-slate-400\",\n empty: \"text-gray-400\",\n }}\n />\n </SidebarContent>\n </Sidebar>\n );\n}\n"],"mappings":"8yBAqBA,MAAaA,EAAgC,CAC3C,GAAI,WACJ,MAAO,WACP,KAAM,GACN,WAAc,EAAC,EAAA,EAAA,CAA8B,CAC9C,CAED,SAAgB,GAA8B,CAC5C,GAAM,CAAE,OAAM,QAAS,GAAkB,CACnC,CAAE,aAAY,aAAc,GAAmB,CAC/C,CAAE,SAAU,EACZ,CACJ,mBAAoB,CAAE,sBAAsB,KAC1C,GAAW,CAGT,CAAC,EAAiB,GAAiB,EADxB,CAAE,GADA,EAAU,GAAG,KAAK,CACF,KAAM,WAAY,CACS,QAAS,SAAU,IAAA,GAAW,CAAE,WAAY,GAAM,CAAC,CAC3G,EAAW,EAAY,EAAM,KAAK,CAAE,GAAG,CACvC,CAAE,aAAc,GAAgB,CAChC,EAAoB,EAAU,UAAY,sBAC1C,CAAC,CAAE,QAAQ,GAAe,EAAe,qBAAqB,CASpE,MAPI,CAAC,GAAY,EAAS,SAAW,EAEjC,EAAC,MAAA,CAAA,SACC,EAAC,EAAA,CAA2B,SAAU,EAAc,OAAQ,UAAW,GAAmB,CAAA,CACtF,CAIR,EAAA,EAAA,CAAA,SAAA,CACG,EACC,EAAC,MAAA,CAAI,UAAU,wDACZ,EACD,EAAC,MAAA,CAAI,UAAU,uBACb,EAAC,EAAA,CAAa,WAAY,CAAC,EAAiB,YAAe,EAAc,QAAQ,WAC/E,EAAC,EAAA,CAAQ,UAAU,UAAA,CAAY,CAAA,kBAAA,EAClB,CACf,EAAC,EAAA,CAAa,YAAe,EAAc,QAAQ,wCAAwC,UACzF,EAAC,EAAA,CAAgB,UAAU,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,KAEH,GAAY,EAAS,SAAW,EAC/B,EAAC,MAAA,CAAI,UAAU,8BAAqB,gGAE9B,CACJ,KAEJ,EAAC,EAAA,CACC,UAAA,GACA,QAAS,CACP,UAAW,SACX,IAAK,wDACL,MAAO,yDACP,MAAO,gFACP,MAAO,gBACR,EACD,GACa,CAAA,CAAA,CACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./index.cjs`);let t=require(`@manifest-editor/editors`),n=require(`@manifest-editor/shell`),r=require(`react-iiif-vault`),i=require(`react/jsx-runtime`),a=require(`@manifest-editor/components`),o=require(`react`);const s={id:`overview`,label:`Overview`,icon:``,render:()=>(0,i.jsx)(c,{})};function c(){let{edit:e,open:t}=(0,n.useLayoutActions)(),{structural:r,technical:o}=(0,n.useManifestEditor)(),{items:s}=r,{editorFeatureFlags:{manifestGridOptions:c=!1}}=(0,n.useConfig)(),[l,u]=(0,n.useCreator)({id:o.id.get(),type:`Manifest`},`items`,`Canvas`,void 0,{isPainting:!0}),d=(0,a.useFastList)(s.get(),24),{leftPanel:f}=(0,n.useLayoutState)(),p=f.current===`left-panel-manifest`,[{size:m},h]=(0,a.useGridOptions)(`manifest-grid-size`);return!d||d.length===0?(0,i.jsx)(`div`,{children:(0,i.jsx)(a.ManifestOverviewEmptyState,{onCreate:u.create,canCreate:l})}):(0,i.jsxs)(i.Fragment,{children:[c?(0,i.jsxs)(`div`,{className:`p-2 flex gap-2 justify-between items-center`,children:[h,(0,i.jsxs)(`div`,{className:`flex gap-2`,children:[(0,i.jsxs)(a.ActionButton,{isDisabled:!l,onPress:()=>u.create(),children:[(0,i.jsx)(a.AddIcon,{className:`text-xl`}),` Add new canvas`]}),(0,i.jsx)(a.ActionButton,{onPress:()=>u.creator(`@manifest-editor/iiif-browser-creator`),children:(0,i.jsx)(a.IIIFBrowserIcon,{className:`text-xl`})})]})]}):null,(0,i.jsx)(a.ThumbnailGridContainer,{wide:!0,size:m,children:d.map(e=>(0,i.jsx)(a.CanvasThumbnailGridItem,{id:e.id,onClick:()=>{t({id:`current-canvas`}),p&&t({id:`canvas-listing`,state:{gridView:!0}}),u.edit(e)}},e.id))})]})}const l=({title:e,titleId:t,...n})=>(0,i.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:`1em`,height:`1em`,"aria-labelledby":t,...n,children:[e?(0,i.jsx)(`title`,{id:t,children:e}):null,(0,i.jsxs)(`g`,{fill:`none`,children:[(0,i.jsx)(`path`,{d:`M0 0h24v24H0V0z`}),(0,i.jsx)(`path`,{d:`M0 0h24v24H0V0z`,opacity:`.87`})]}),(0,i.jsx)(`path`,{d:`M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z`,fill:`currentColor`})]}),u={id:`canvas-listing`,label:`Canvases`,icon:(0,i.jsx)(l,{}),render:(e,t,n)=>(0,i.jsx)(d,{gridView:e.gridView||localStorage.getItem(`canvas-listing-view-mode`)===`grid`,onChangeGridView:e=>{localStorage.setItem(`canvas-listing-view-mode`,e?`grid`:`list`),t.actions.change(`canvas-listing`,{gridView:e})}})};function d({gridView:e,onChangeGridView:r}){let{structural:s,technical:c}=(0,n.useManifestEditor)(),[u,d]=(0,t.useToggleList)(),{items:f}=s,[_,v]=(0,n.useCreator)({id:c.id.get(),type:`Manifest`},`items`,`Canvas`,void 0,{isPainting:!0});return(0,o.useLayoutEffect)(()=>{let e=document.querySelector(`[data-canvas-selected="true"]`);e&&e.scrollIntoView({block:`center`})},[(0,a.useFastList)(f.get(),24),e]),(0,i.jsxs)(a.Sidebar,{children:[(0,i.jsx)(a.SidebarHeader,{title:`Canvases`,actions:[{icon:(0,i.jsx)(i.Fragment,{children:e?(0,i.jsx)(l,{width:24,height:24}):(0,i.jsx)(g,{})}),title:e?`List view`:`Grid view`,onClick:()=>{r(!e)}},{icon:(0,i.jsx)(h,{}),title:`Edit canvases`,toggled:u.items,onClick:()=>d(`items`)},{icon:(0,i.jsx)(a.IIIFBrowserIcon,{className:`text-2xl`}),title:`IIIF Browser`,onClick:()=>v.creator(`@manifest-editor/iiif-browser-creator`),disabled:!_},{icon:(0,i.jsx)(a.CreateCanvasIcon,{}),title:`Add new canvas`,onClick:()=>v.create(),disabled:!_}]}),e?(0,i.jsx)(p,{isEditing:u.items}):(0,i.jsx)(m,{isEditing:u.items})]})}function f(){let{edit:e,open:r}=(0,n.useLayoutActions)(),i=(0,t.useInStack)(`Canvas`),{technical:o,structural:s}=(0,n.useManifestEditor)(),{items:c}=s,l={id:o.id.get(),type:`Manifest`},u=(0,a.useFastList)(c.get(),24),[d,f]=(0,n.useCreator)(l,`items`,`Canvas`,void 0,{isPainting:!0});return{canvas:i,canvases:u,items:c,canvasActions:f,open:r,edit:e,canCreateCanvas:d}}function p({isEditing:e}){let{canvas:o,items:s,canvasActions:c,open:l}=f(),u=(0,r.useManifest)(),d=(0,n.useEditingStack)(),p=s.get(),m=o?.resource.source.id,h=p.findIndex(e=>e.id===m),g=h&&h>0?Number(h-1):0;function _(){d.close();let e=s.get();e&&e.length>0?c.edit(e[g]):c.edit(u)}return(0,i.jsx)(a.SidebarContent,{children:(0,i.jsx)(a.ThumbnailGridContainer,{children:(0,i.jsx)(t.CanvasGrid,{id:s.focusId(),list:s.get()||[],inlineHandle:!1,activeId:o?.resource.source.id,reorder:e?e=>s.reorder(e.startIndex,e.endIndex):void 0,onSelect:(e,t)=>{l({id:`current-canvas`}),c.edit(e,t)},createActions:(0,t.createAppActions)(s,_)})})})}function m({isEditing:e}){let{canvas:o,items:s,canvasActions:c,open:l}=f(),u=(0,r.useManifest)(),d=(0,n.useEditingStack)(),p=s.get()||[],m=o?.resource.source.id,h=p.findIndex(e=>e.id===m),g=h&&h>0?Number(h-1):0;function _(){d.close();let e=s.get();e&&e.length>0?c.edit(e[g]):c.edit(u)}return(0,i.jsx)(a.SidebarContent,{className:`p-3`,children:(0,i.jsx)(t.InputContainer,{$wide:!0,children:(0,i.jsx)(t.CanvasList,{id:s.focusId(),list:s.get()||[],inlineHandle:!1,activeId:o?.resource.source.id,reorder:e?e=>s.reorder(e.startIndex,e.endIndex):void 0,onSelect:(e,t)=>{l({id:`current-canvas`}),c.edit(e,t)},createActions:(0,t.createAppActions)(s,_)})})})}function h(e){return(0,i.jsxs)(`svg`,{className:`text-xl`,xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:[(0,i.jsx)(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),(0,i.jsx)(`path`,{d:`M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z`,fill:`currentColor`})]})}function g(){return(0,i.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24`,viewBox:`0 0 24 24`,width:`24`,children:[(0,i.jsx)(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),(0,i.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z`,fill:`currentColor`})]})}function _({title:e,titleId:t,...n}){return(0,i.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,"aria-labelledby":t,...n,children:[e?(0,i.jsx)(`title`,{id:t,children:e}):null,(0,i.jsx)(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),(0,i.jsx)(`path`,{d:`M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z`,fill:`currentColor`})]})}const v={id:`left-panel-manifest`,label:`Manifest summary`,icon:(0,i.jsx)(_,{}),render:(e,t,n)=>(0,i.jsx)(b,{})};function y(e){return(0,i.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,i.jsx)(`path`,{fill:`currentColor`,d:`m15 16l-4 4h10v-4zm-2.94-8.81L3 16.25V20h3.75l9.06-9.06zm1.072-1.067l2.539-2.539l3.747 3.748L16.88 9.87z`})})}function b(){let{descriptive:e,technical:o}=(0,n.useManifestEditor)();o.id.get();let s=e.label.get(),c=e.summary.get(),l=e.requiredStatement.get(),u=e.metadata.get(),{open:d}=(0,n.useLayoutActions)();return(0,i.jsxs)(a.Sidebar,{children:[(0,i.jsx)(a.SidebarHeader,{title:`Manifest summary`,actions:[{icon:(0,i.jsx)(y,{className:`text-xl`}),title:`Edit metadata`,onClick:()=>{d(`@manifest-editor/editor`,{currentTab:`@manifest-editor/descriptive-properties`})}}]}),(0,i.jsxs)(a.SidebarContent,{className:`p-4`,children:[s?(0,i.jsx)(t.InlineLocaleStringEditor,{as:`h2`,className:`text-lg font-semibold mb-2 [&>a]:underline [&>a]:hover:text-slate-400`,editor:e.label,children:s}):null,c?(0,i.jsx)(r.LocaleString,{enableDangerouslySetInnerHTML:!0,as:`p`,className:`text-sm text-slate-800 block [&>a]:underline [&>a]:hover:text-slate-400 mb-2`,children:c}):null,(0,i.jsx)(`hr`,{}),l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(`div`,{className:`py-2 text-black`,children:[(0,i.jsx)(r.LocaleString,{as:`h4`,className:`font-bold text-black w-full text-sm font-semibold mb-0 [&>a]:underline [&>a]:hover:text-slate-400`,children:l.label}),(0,i.jsx)(r.LocaleString,{enableDangerouslySetInnerHTML:!0,className:`text-sm [&>a]:underline [&>a]:hover:text-slate-400`,children:l.value})]}),(0,i.jsx)(`hr`,{})]}):null,u&&u.length===0?(0,i.jsx)(`div`,{className:`py-2 text-gray-400`,children:`You can add some descriptive metadata for this manifest using the editing panel on the right`}):null,(0,i.jsx)(r.ManifestMetadata,{allowHtml:!0,classes:{container:`w-full`,row:`border-b border-gray-200 flex flex-col flex-wrap py-2`,label:`font-bold text-black w-full text-sm font-semibold mb-1`,value:`text-sm text-black block [&>span>a]:underline [&>span>a]:hover:text-slate-400`,empty:`text-gray-400`}})]})]})}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return u}});
|
package/dist/components.cjs
CHANGED
|
@@ -1,378 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components.tsx
|
|
21
|
-
var components_exports = {};
|
|
22
|
-
__export(components_exports, {
|
|
23
|
-
CanvasGridView: () => CanvasGridView,
|
|
24
|
-
CanvasListView: () => CanvasListView,
|
|
25
|
-
CanvasListing: () => CanvasListing,
|
|
26
|
-
CanvasListingIcon: () => CanvasListingIcon,
|
|
27
|
-
CanvasThumbnailsIcon: () => CanvasThumbnailsIcon,
|
|
28
|
-
ListEditIcon: () => ListEditIcon,
|
|
29
|
-
ManifestIcon: () => ManifestIcon,
|
|
30
|
-
ManifestOverviewCenterPanel: () => ManifestOverviewCenterPanel,
|
|
31
|
-
ManifestPanel: () => ManifestPanel,
|
|
32
|
-
useEditCanvasItems: () => useEditCanvasItems
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(components_exports);
|
|
35
|
-
|
|
36
|
-
// src/center-panels/manifest-overview.tsx
|
|
37
|
-
var import_components = require("@manifest-editor/components");
|
|
38
|
-
var import_shell = require("@manifest-editor/shell");
|
|
39
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
-
function ManifestOverviewCenterPanel() {
|
|
41
|
-
const { edit, open } = (0, import_shell.useLayoutActions)();
|
|
42
|
-
const { structural, technical } = (0, import_shell.useManifestEditor)();
|
|
43
|
-
const { items } = structural;
|
|
44
|
-
const manifestId = technical.id.get();
|
|
45
|
-
const manifest = { id: manifestId, type: "Manifest" };
|
|
46
|
-
const [canCreateCanvas, canvasActions] = (0, import_shell.useCreator)(
|
|
47
|
-
manifest,
|
|
48
|
-
"items",
|
|
49
|
-
"Canvas"
|
|
50
|
-
);
|
|
51
|
-
const canvases = (0, import_components.useFastList)(items.get(), 24);
|
|
52
|
-
if (!canvases || canvases.length === 0) {
|
|
53
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
-
import_components.ManifestOverviewEmptyState,
|
|
55
|
-
{
|
|
56
|
-
onCreate: canvasActions.create,
|
|
57
|
-
canCreate: canCreateCanvas
|
|
58
|
-
}
|
|
59
|
-
) });
|
|
60
|
-
}
|
|
61
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ThumbnailGridContainer, { wide: true, children: canvases.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
-
import_components.CanvasThumbnailGridItem,
|
|
63
|
-
{
|
|
64
|
-
id: item.id,
|
|
65
|
-
onClick: () => {
|
|
66
|
-
open({ id: "current-canvas" });
|
|
67
|
-
open({ id: "canvas-listing", state: { gridView: true } });
|
|
68
|
-
canvasActions.edit(item);
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
item.id
|
|
72
|
-
)) });
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// src/left-panels/canvas-listing.tsx
|
|
76
|
-
var import_components2 = require("@manifest-editor/components");
|
|
77
|
-
var import_editors = require("@manifest-editor/editors");
|
|
78
|
-
var import_shell2 = require("@manifest-editor/shell");
|
|
79
|
-
var import_react = require("react");
|
|
80
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
81
|
-
var CanvasListingIcon = ({
|
|
82
|
-
title,
|
|
83
|
-
titleId,
|
|
84
|
-
...props
|
|
85
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
86
|
-
"svg",
|
|
87
|
-
{
|
|
88
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
89
|
-
viewBox: "0 0 24 24",
|
|
90
|
-
width: "1em",
|
|
91
|
-
height: "1em",
|
|
92
|
-
"aria-labelledby": titleId,
|
|
93
|
-
...props,
|
|
94
|
-
children: [
|
|
95
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { id: titleId, children: title }) : null,
|
|
96
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { fill: "none", children: [
|
|
97
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0 0h24v24H0V0z" }),
|
|
98
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0 0h24v24H0V0z", opacity: ".87" })
|
|
99
|
-
] }),
|
|
100
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
101
|
-
"path",
|
|
102
|
-
{
|
|
103
|
-
d: "M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z",
|
|
104
|
-
fill: "currentColor"
|
|
105
|
-
}
|
|
106
|
-
)
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
function CanvasListing({
|
|
111
|
-
gridView,
|
|
112
|
-
onChangeGridView
|
|
113
|
-
}) {
|
|
114
|
-
const { open } = (0, import_shell2.useLayoutActions)();
|
|
115
|
-
const { structural, technical } = (0, import_shell2.useManifestEditor)();
|
|
116
|
-
const [toggled, toggle] = (0, import_editors.useToggleList)();
|
|
117
|
-
const canvas = (0, import_editors.useInStack)("Canvas");
|
|
118
|
-
const { items } = structural;
|
|
119
|
-
const manifestId = technical.id.get();
|
|
120
|
-
const manifest = { id: manifestId, type: "Manifest" };
|
|
121
|
-
const [canCreateCanvas, canvasActions] = (0, import_shell2.useCreator)(
|
|
122
|
-
manifest,
|
|
123
|
-
"items",
|
|
124
|
-
"Canvas"
|
|
125
|
-
);
|
|
126
|
-
const canvases = (0, import_components2.useFastList)(items.get(), 24);
|
|
127
|
-
(0, import_react.useEffect)(() => {
|
|
128
|
-
if (canvas?.resource.source.id) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
if (items.get().length) {
|
|
132
|
-
open({ id: "current-canvas" });
|
|
133
|
-
canvasActions.edit(items.get()[0]);
|
|
134
|
-
}
|
|
135
|
-
}, []);
|
|
136
|
-
(0, import_react.useLayoutEffect)(() => {
|
|
137
|
-
const selected = document.querySelector('[data-canvas-selected="true"]');
|
|
138
|
-
if (selected) {
|
|
139
|
-
selected.scrollIntoView({ block: "center" });
|
|
140
|
-
}
|
|
141
|
-
}, [canvases, gridView]);
|
|
142
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components2.Sidebar, { children: [
|
|
143
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
144
|
-
import_components2.SidebarHeader,
|
|
145
|
-
{
|
|
146
|
-
title: "Canvases",
|
|
147
|
-
actions: [
|
|
148
|
-
{
|
|
149
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: gridView ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CanvasListingIcon, { width: 24, height: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CanvasThumbnailsIcon, {}) }),
|
|
150
|
-
title: gridView ? "List view" : "Grid view",
|
|
151
|
-
onClick: () => {
|
|
152
|
-
onChangeGridView(!gridView);
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ListEditIcon, {}),
|
|
157
|
-
title: "Edit canvases",
|
|
158
|
-
toggled: toggled.items,
|
|
159
|
-
onClick: () => toggle("items")
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.IIIFBrowserIcon, { className: "text-2xl" }),
|
|
163
|
-
title: "IIIF Browser",
|
|
164
|
-
onClick: () => canvasActions.creator("@manifest-editor/iiif-browser-creator"),
|
|
165
|
-
disabled: !canCreateCanvas
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.CreateCanvasIcon, {}),
|
|
169
|
-
title: "Add new canvas",
|
|
170
|
-
onClick: () => canvasActions.create(),
|
|
171
|
-
disabled: !canCreateCanvas
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
|
-
),
|
|
176
|
-
gridView ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CanvasGridView, { isEditing: toggled.items }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CanvasListView, { isEditing: toggled.items })
|
|
177
|
-
] });
|
|
178
|
-
}
|
|
179
|
-
function useEditCanvasItems() {
|
|
180
|
-
const { edit, open } = (0, import_shell2.useLayoutActions)();
|
|
181
|
-
const canvas = (0, import_editors.useInStack)("Canvas");
|
|
182
|
-
const { technical, structural } = (0, import_shell2.useManifestEditor)();
|
|
183
|
-
const { items } = structural;
|
|
184
|
-
const manifestId = technical.id.get();
|
|
185
|
-
const manifest = { id: manifestId, type: "Manifest" };
|
|
186
|
-
const canvases = (0, import_components2.useFastList)(items.get(), 24);
|
|
187
|
-
const [canCreateCanvas, canvasActions] = (0, import_shell2.useCreator)(
|
|
188
|
-
manifest,
|
|
189
|
-
"items",
|
|
190
|
-
"Canvas"
|
|
191
|
-
);
|
|
192
|
-
return {
|
|
193
|
-
canvas,
|
|
194
|
-
canvases,
|
|
195
|
-
items,
|
|
196
|
-
canvasActions,
|
|
197
|
-
open,
|
|
198
|
-
edit,
|
|
199
|
-
canCreateCanvas
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
function CanvasGridView({ isEditing }) {
|
|
203
|
-
const { canvas, items, canvases, canvasActions, open } = useEditCanvasItems();
|
|
204
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.SidebarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.ThumbnailGridContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
205
|
-
import_editors.CanvasGrid,
|
|
206
|
-
{
|
|
207
|
-
id: items.focusId(),
|
|
208
|
-
list: items.get() || [],
|
|
209
|
-
inlineHandle: false,
|
|
210
|
-
activeId: canvas?.resource.source.id,
|
|
211
|
-
reorder: isEditing ? (t) => items.reorder(t.startIndex, t.endIndex) : void 0,
|
|
212
|
-
onSelect: (item, idx) => {
|
|
213
|
-
open({ id: "current-canvas" });
|
|
214
|
-
canvasActions.edit(item, idx);
|
|
215
|
-
},
|
|
216
|
-
createActions: (0, import_editors.createAppActions)(items)
|
|
217
|
-
}
|
|
218
|
-
) }) });
|
|
219
|
-
}
|
|
220
|
-
function CanvasListView({ isEditing }) {
|
|
221
|
-
const { canvas, items, canvasActions, open } = useEditCanvasItems();
|
|
222
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.SidebarContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_editors.InputContainer, { $wide: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
223
|
-
import_editors.CanvasList,
|
|
224
|
-
{
|
|
225
|
-
id: items.focusId(),
|
|
226
|
-
list: items.get() || [],
|
|
227
|
-
inlineHandle: false,
|
|
228
|
-
activeId: canvas?.resource.source.id,
|
|
229
|
-
reorder: isEditing ? (t) => items.reorder(t.startIndex, t.endIndex) : void 0,
|
|
230
|
-
onSelect: (item, idx) => {
|
|
231
|
-
open({ id: "current-canvas" });
|
|
232
|
-
canvasActions.edit(item, idx);
|
|
233
|
-
},
|
|
234
|
-
createActions: (0, import_editors.createAppActions)(items)
|
|
235
|
-
}
|
|
236
|
-
) }) });
|
|
237
|
-
}
|
|
238
|
-
function ListEditIcon() {
|
|
239
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
240
|
-
"svg",
|
|
241
|
-
{
|
|
242
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
243
|
-
height: "24",
|
|
244
|
-
viewBox: "0 0 24 24",
|
|
245
|
-
width: "24",
|
|
246
|
-
children: [
|
|
247
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
248
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z" })
|
|
249
|
-
]
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
function CanvasThumbnailsIcon() {
|
|
254
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
255
|
-
"svg",
|
|
256
|
-
{
|
|
257
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
258
|
-
height: "24",
|
|
259
|
-
viewBox: "0 0 24 24",
|
|
260
|
-
width: "24",
|
|
261
|
-
children: [
|
|
262
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
263
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
264
|
-
"path",
|
|
265
|
-
{
|
|
266
|
-
d: "M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z",
|
|
267
|
-
fill: "currentColor"
|
|
268
|
-
}
|
|
269
|
-
)
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// src/left-panels/manifest.tsx
|
|
276
|
-
var import_components3 = require("@manifest-editor/components");
|
|
277
|
-
var import_shell3 = require("@manifest-editor/shell");
|
|
278
|
-
var import_react2 = require("react");
|
|
279
|
-
var import_react_iiif_vault = require("react-iiif-vault");
|
|
280
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
281
|
-
function ManifestIcon({
|
|
282
|
-
title,
|
|
283
|
-
titleId,
|
|
284
|
-
...props
|
|
285
|
-
}) {
|
|
286
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
287
|
-
"svg",
|
|
288
|
-
{
|
|
289
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
290
|
-
width: "1em",
|
|
291
|
-
height: "1em",
|
|
292
|
-
"aria-labelledby": titleId,
|
|
293
|
-
...props,
|
|
294
|
-
children: [
|
|
295
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("title", { id: titleId, children: title }) : null,
|
|
296
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
297
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
298
|
-
"path",
|
|
299
|
-
{
|
|
300
|
-
d: "M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z",
|
|
301
|
-
fill: "currentColor"
|
|
302
|
-
}
|
|
303
|
-
)
|
|
304
|
-
]
|
|
305
|
-
}
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
function ManifestPanel() {
|
|
309
|
-
const { edit, open } = (0, import_shell3.useLayoutActions)();
|
|
310
|
-
const { descriptive, technical } = (0, import_shell3.useManifestEditor)();
|
|
311
|
-
const manifestId = technical.id.get();
|
|
312
|
-
const manifest = { id: manifestId, type: "Manifest" };
|
|
313
|
-
const isInitial = (0, import_react2.useRef)(true);
|
|
314
|
-
const label = descriptive.label.get();
|
|
315
|
-
const summary = descriptive.summary.get();
|
|
316
|
-
const requiredStatement = descriptive.requiredStatement.get();
|
|
317
|
-
const metadata = descriptive.metadata.get();
|
|
318
|
-
(0, import_react2.useEffect)(() => {
|
|
319
|
-
edit(manifest);
|
|
320
|
-
open({ id: "overview" });
|
|
321
|
-
isInitial.current = false;
|
|
322
|
-
}, []);
|
|
323
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
324
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
325
|
-
import_react_iiif_vault.LocaleString,
|
|
326
|
-
{
|
|
327
|
-
as: "h2",
|
|
328
|
-
className: "text-lg font-semibold mb-2 [&>a]:underline [&>a]:hover:text-slate-400",
|
|
329
|
-
children: label
|
|
330
|
-
}
|
|
331
|
-
) : null,
|
|
332
|
-
summary ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
333
|
-
import_react_iiif_vault.LocaleString,
|
|
334
|
-
{
|
|
335
|
-
enableDangerouslySetInnerHTML: true,
|
|
336
|
-
as: "p",
|
|
337
|
-
className: "text-sm text-slate-800 block [&>a]:underline [&>a]:hover:text-slate-400 mb-2",
|
|
338
|
-
children: summary
|
|
339
|
-
}
|
|
340
|
-
) : null,
|
|
341
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("hr", {}),
|
|
342
|
-
requiredStatement ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
343
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "py-2 text-black", children: [
|
|
344
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
345
|
-
import_react_iiif_vault.LocaleString,
|
|
346
|
-
{
|
|
347
|
-
as: "h4",
|
|
348
|
-
className: "font-bold text-black w-full text-sm font-semibold mb-0 [&>a]:underline [&>a]:hover:text-slate-400",
|
|
349
|
-
children: requiredStatement.label
|
|
350
|
-
}
|
|
351
|
-
),
|
|
352
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
353
|
-
import_react_iiif_vault.LocaleString,
|
|
354
|
-
{
|
|
355
|
-
enableDangerouslySetInnerHTML: true,
|
|
356
|
-
className: "text-sm [&>a]:underline [&>a]:hover:text-slate-400",
|
|
357
|
-
children: requiredStatement.value
|
|
358
|
-
}
|
|
359
|
-
)
|
|
360
|
-
] }),
|
|
361
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("hr", {})
|
|
362
|
-
] }) : null,
|
|
363
|
-
metadata && metadata.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "py-2 text-gray-400", children: "You can add some descriptive metadata for this manifest using the editing panel on the right" }) : null,
|
|
364
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
365
|
-
import_react_iiif_vault.ManifestMetadata,
|
|
366
|
-
{
|
|
367
|
-
allowHtml: true,
|
|
368
|
-
classes: {
|
|
369
|
-
container: "w-full",
|
|
370
|
-
row: "border-b border-gray-200 flex flex-col flex-wrap py-2",
|
|
371
|
-
label: "font-bold text-black w-full text-sm font-semibold mb-1",
|
|
372
|
-
value: "text-sm text-black block [&>span>a]:underline [&>span>a]:hover:text-slate-400",
|
|
373
|
-
empty: "text-gray-400"
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
)
|
|
377
|
-
] });
|
|
378
|
-
}
|
|
1
|
+
const e=require(`./components-cGHI3B6O.cjs`);exports.CanvasGridView=e.i,exports.CanvasListView=e.a,exports.CanvasListing=e.o,exports.CanvasListingIcon=e.s,exports.CanvasThumbnailsIcon=e.c,exports.ListEditIcon=e.l,exports.ManifestIcon=e.t,exports.ManifestOverviewCenterPanel=e.f,exports.ManifestPanel=e.n,exports.useEditCanvasItems=e.d;
|
package/dist/components.d.cts
CHANGED
|
@@ -1,68 +1,89 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as _manifest_editor_shell0 from "@manifest-editor/shell";
|
|
3
|
+
import { LayoutPanel } from "@manifest-editor/shell";
|
|
4
|
+
import * as _iiif_presentation_32 from "@iiif/presentation-3";
|
|
5
|
+
import * as _manifest_editor_editor_api0 from "@manifest-editor/editor-api";
|
|
6
|
+
import { SVGProps } from "react";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
//#region src/center-panels/manifest-overview.d.ts
|
|
9
|
+
declare function ManifestOverviewCenterPanel(): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/left-panels/canvas-listing.d.ts
|
|
12
|
+
declare const CanvasListingIcon: ({
|
|
13
|
+
title,
|
|
14
|
+
titleId,
|
|
15
|
+
...props
|
|
16
|
+
}: SVGProps<SVGSVGElement> & {
|
|
17
|
+
title?: string;
|
|
18
|
+
titleId?: string;
|
|
19
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare function CanvasListing({
|
|
21
|
+
gridView,
|
|
22
|
+
onChangeGridView
|
|
23
|
+
}: {
|
|
24
|
+
gridView: boolean;
|
|
25
|
+
onChangeGridView: (gridView: boolean) => void;
|
|
26
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
17
27
|
declare function useEditCanvasItems(): {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
open: {
|
|
37
|
-
(id: string, state?: any): void;
|
|
38
|
-
(args: {
|
|
39
|
-
id: string;
|
|
40
|
-
state?: any;
|
|
41
|
-
stacked?: boolean;
|
|
42
|
-
unique?: boolean;
|
|
43
|
-
}): void;
|
|
28
|
+
canvas: _manifest_editor_shell0.EditableResource | undefined;
|
|
29
|
+
canvases: {
|
|
30
|
+
type: string;
|
|
31
|
+
id: string;
|
|
32
|
+
}[];
|
|
33
|
+
items: _manifest_editor_editor_api0.BaseReferenceListEditor<Partial<_iiif_presentation_32.DescriptiveProperties> & Partial<_iiif_presentation_32.TechnicalProperties> & Partial<_iiif_presentation_32.LinkingProperties> & Partial<_iiif_presentation_32.StructuralProperties<unknown>> & Partial<_iiif_presentation_32.NavPlaceExtension & _iiif_presentation_32.TextGranularityExtension>, {
|
|
34
|
+
type: string;
|
|
35
|
+
id: string;
|
|
36
|
+
}>;
|
|
37
|
+
canvasActions: {
|
|
38
|
+
readonly create: (index?: number, initialData?: any) => void;
|
|
39
|
+
readonly edit: (resource: any, index?: number) => void;
|
|
40
|
+
readonly createFiltered: (filter: string, index?: number, initialData?: any) => void;
|
|
41
|
+
readonly creator: (initialCreator: string, initialData?: any) => void;
|
|
42
|
+
readonly buttonProps: {
|
|
43
|
+
"data-action-id": string;
|
|
44
44
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
};
|
|
46
|
+
open: {
|
|
47
|
+
(id: string, state?: any): void;
|
|
48
|
+
(args: {
|
|
49
|
+
id: string;
|
|
50
|
+
state?: any;
|
|
51
|
+
stacked?: boolean;
|
|
52
|
+
unique?: boolean;
|
|
53
|
+
}): void;
|
|
54
|
+
};
|
|
55
|
+
edit: (resource: _iiif_presentation_32.Reference | _iiif_presentation_32.SpecificResource, context?: Omit<_manifest_editor_shell0.EditableResource, "resource">, options?: {
|
|
56
|
+
reset?: boolean;
|
|
57
|
+
property?: string;
|
|
58
|
+
stacked?: boolean | undefined;
|
|
59
|
+
selectedTab?: string;
|
|
60
|
+
forceOpen?: boolean;
|
|
61
|
+
}) => void;
|
|
62
|
+
canCreateCanvas: any;
|
|
52
63
|
};
|
|
53
|
-
declare function CanvasGridView({
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
declare function CanvasGridView({
|
|
65
|
+
isEditing
|
|
66
|
+
}: {
|
|
67
|
+
isEditing: boolean;
|
|
68
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
69
|
+
declare function CanvasListView({
|
|
70
|
+
isEditing
|
|
71
|
+
}: {
|
|
72
|
+
isEditing: boolean;
|
|
73
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
74
|
+
declare function ListEditIcon(props: React.SVGProps<SVGSVGElement>): react_jsx_runtime0.JSX.Element;
|
|
75
|
+
declare function CanvasThumbnailsIcon(): react_jsx_runtime0.JSX.Element;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/left-panels/manifest.d.ts
|
|
78
|
+
declare function ManifestIcon({
|
|
79
|
+
title,
|
|
80
|
+
titleId,
|
|
81
|
+
...props
|
|
82
|
+
}: SVGProps<SVGSVGElement> & {
|
|
83
|
+
title?: string;
|
|
84
|
+
titleId?: string;
|
|
85
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
86
|
+
declare function ManifestPanel(): react_jsx_runtime0.JSX.Element;
|
|
87
|
+
//#endregion
|
|
68
88
|
export { CanvasGridView, CanvasListView, CanvasListing, CanvasListingIcon, CanvasThumbnailsIcon, ListEditIcon, ManifestIcon, ManifestOverviewCenterPanel, ManifestPanel, useEditCanvasItems };
|
|
89
|
+
//# sourceMappingURL=components.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.cts","names":[],"sources":["../src/center-panels/manifest-overview.tsx","../src/left-panels/canvas-listing.tsx","../src/left-panels/manifest.tsx"],"sourcesContent":[],"mappings":";;;;;;;;iBA4BgB,2BAAA,CAAA,GAA2B,kBAAA,CAAA,GAAA,CAAA;;;cCC9B;;;;GAIV,SAAS;;;MAAqD,kBAAA,CAAA,GAAA,CAAA;iBAuCjD,aAAA;;;;ED5CA,QAAA,EAAA,OAAA;;ICkDf,kBAAA,CAAA,GAAA,CAAA;iBAqDe,kBAAA,CAAA;EAtGH,MAAA,EAsGqB,uBAAA,CAAA,gBAAA,GA9EjC,SAAA;EAxB6B,QAAA,EAAA;IAAA,IAAA,EAAA,MAAA;IAIlB,EAAA,EAAA,MAAA;EAAT,CAAA,EAAA;EAA8D,KAAA,sDAAA,QAAA,6CAAA,UAAA,2CAAA,UAAA,yCAAA,UAAA,2CAAA,CAAA,OAAA,CAAA,CAAA,UAAA,yFAAA,CAAA,EAAA;IAoBhE,IAAA,EAAA,MAAA;IAmBe,EAAA,EAAA,MAAA;EACd,CAAA,CAAA;EACA,aAAA,EAAA;IAID,SAAA,MAAA,EAAA,CAAA,KAAA,CAAA,EAAA,MAAA,EAAA,WAAA,CAAA,EAAA,GAAA,EAAA,GA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