@manifest-editor/manifest-preset 2.0.2 → 2.0.3-next.0.d7011cd
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-BFzkaXZY.js +2 -0
- package/dist/components-BFzkaXZY.js.map +1 -0
- package/dist/components-C2KptOSb.cjs +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +10 -10
- package/dist/components.d.cts.map +1 -1
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +7 -7
- package/dist/components-DH-SLuuf.js +0 -2
- package/dist/components-DH-SLuuf.js.map +0 -1
- package/dist/components-Dd5DhBd8.cjs +0 -1
|
@@ -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{useApp as s,useConfig as c,useCreator as l,useEditingStack as u,useLayoutActions as d,useLayoutState as f,useManifestEditor as p}from"@manifest-editor/shell";import{LocaleString as m,ManifestMetadata as h,useManifest as g}from"react-iiif-vault";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{ActionButton as b,AddIcon as x,CanvasThumbnailGridItem as S,CreateCanvasIcon as C,IIIFBrowserIcon as w,ManifestOverviewEmptyState as T,Sidebar as E,SidebarContent as D,SidebarHeader as O,ThumbnailGridContainer as k,useFastList as A,useGridOptions as j}from"@manifest-editor/components";import{useLayoutEffect as M}from"react";const N={id:`overview`,label:`Overview`,icon:``,render:()=>v(P,{})};function P(){let{metadata:e}=s(),{edit:t,open:n}=d(),{structural:r,technical:i}=p(),{items:a}=r,{editorFeatureFlags:{manifestGridOptions:o=!1}}=c(),[u,m]=l({id:i.id.get(),type:`Manifest`},`items`,`Canvas`,void 0,{isPainting:!0}),h=A(a.get(),24),{leftPanel:g}=f(),C=g.current===`left-panel-manifest`,[{size:E},D]=j(`manifest-grid-size`),O=e.id===`exhibition-editor`?(e,t)=>m.createFiltered(`exhibition-slide`,e,t):m.create;return!h||h.length===0?v(`div`,{children:v(T,{onCreate:O,canCreate:u})}):y(_,{children:[o?y(`div`,{className:`p-2 flex gap-2 justify-between items-center`,children:[D,y(`div`,{className:`flex gap-2`,children:[y(b,{isDisabled:!u,onPress:()=>O(),children:[v(x,{className:`text-xl`}),` Add new canvas`]}),v(b,{onPress:()=>m.creator(`@manifest-editor/iiif-browser-creator`),children:v(w,{className:`text-xl`})})]})]}):null,v(k,{wide:!0,size:E,children:h.map(e=>v(S,{id:e.id,onClick:()=>{n({id:`current-canvas`}),C&&n({id:`canvas-listing`,state:{gridView:!0}}),m.edit(e)}},e.id))})]})}const F=({title:e,titleId:t,...n})=>y(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:`1em`,height:`1em`,"aria-labelledby":t,...n,children:[e?v(`title`,{id:t,children:e}):null,y(`g`,{fill:`none`,children:[v(`path`,{d:`M0 0h24v24H0V0z`}),v(`path`,{d:`M0 0h24v24H0V0z`,opacity:`.87`})]}),v(`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`})]}),I={id:`canvas-listing`,label:`Canvases`,icon:v(F,{}),render:(e,t,n)=>v(L,{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 L({gridView:e,onChangeGridView:t}){let{structural:n,technical:r}=p(),[i,a]=o(),{items:s}=n,[c,u]=l({id:r.id.get(),type:`Manifest`},`items`,`Canvas`,void 0,{isPainting:!0});return M(()=>{let e=document.querySelector(`[data-canvas-selected="true"]`);e&&e.scrollIntoView({block:`center`})},[A(s.get(),24),e]),y(E,{children:[v(O,{title:`Canvases`,actions:[{icon:v(_,{children:e?v(F,{width:24,height:24}):v(H,{})}),title:e?`List view`:`Grid view`,onClick:()=>{t(!e)}},{icon:v(V,{}),title:`Edit canvases`,toggled:i.items,onClick:()=>a(`items`)},{icon:v(w,{className:`text-2xl`}),title:`IIIF Browser`,onClick:()=>u.creator(`@manifest-editor/iiif-browser-creator`),disabled:!c},{icon:v(C,{}),title:`Add new canvas`,onClick:()=>u.create(),disabled:!c}]}),v(e?z:B,{isEditing:i.items})]})}function R(){let{edit:e,open:t}=d(),n=a(`Canvas`),{technical:r,structural:i}=p(),{items:o}=i,s={id:r.id.get(),type:`Manifest`},c=A(o.get(),24),[u,f]=l(s,`items`,`Canvas`,void 0,{isPainting:!0});return{canvas:n,canvases:c,items:o,canvasActions:f,open:t,edit:e,canCreateCanvas:u}}function z({isEditing:t}){let{canvas:n,items:r,canvasActions:a,open:o}=R(),s=g(),c=u(),l=r.get(),d=n?.resource.source.id,f=l.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 v(D,{children:v(k,{children:v(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 B({isEditing:e}){let{canvas:n,items:a,canvasActions:o,open:s}=R(),c=g(),l=u(),d=a.get()||[],f=n?.resource.source.id,p=d.findIndex(e=>e.id===f),m=p&&p>0?Number(p-1):0;function h(){l.close();let e=a.get();e&&e.length>0?o.edit(e[m]):o.edit(c)}return v(D,{className:`p-3`,children:v(r,{$wide:!0,children:v(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,h)})})})}function V(e){return y(`svg`,{className:`text-xl`,xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:[v(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),v(`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 H(){return y(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24`,viewBox:`0 0 24 24`,width:`24`,children:[v(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),v(`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 U({title:e,titleId:t,...n}){return y(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,"aria-labelledby":t,...n,children:[e?v(`title`,{id:t,children:e}):null,v(`path`,{d:`M0 0h24v24H0V0z`,fill:`none`}),v(`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 W={id:`left-panel-manifest`,label:`Manifest summary`,icon:v(U,{}),render:(e,t,n)=>v(K,{})};function G(e){return v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:v(`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 K(){let{descriptive:e,technical:t}=p();t.id.get();let r=e.label.get(),i=e.summary.get(),a=e.requiredStatement.get(),o=e.metadata.get(),{open:s}=d();return y(E,{children:[v(O,{title:`Manifest summary`,actions:[{icon:v(G,{className:`text-xl`}),title:`Edit metadata`,onClick:()=>{s(`@manifest-editor/editor`,{currentTab:`@manifest-editor/descriptive-properties`})}}]}),y(D,{className:`p-4`,children:[r?v(n,{as:`h2`,className:`text-lg font-semibold mb-2 [&>a]:underline [&>a]:hover:text-slate-400`,editor:e.label,children:r}):null,i?v(m,{enableDangerouslySetInnerHTML:!0,as:`p`,className:`text-sm text-slate-800 block [&>a]:underline [&>a]:hover:text-slate-400 mb-2`,children:i}):null,v(`hr`,{}),a?y(_,{children:[y(`div`,{className:`py-2 text-black`,children:[v(m,{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}),v(m,{enableDangerouslySetInnerHTML:!0,className:`text-sm [&>a]:underline [&>a]:hover:text-slate-400`,children:a.value})]}),v(`hr`,{})]}):null,o&&o.length===0?v(`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,v(h,{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{B as a,H as c,R as d,P as f,z as i,V as l,K as n,L as o,N as p,W as r,F as s,U as t,I as u};
|
|
2
|
+
//# sourceMappingURL=components-BFzkaXZY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-BFzkaXZY.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 useApp,\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 { metadata } = useApp();\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 const createCanvas =\n metadata.id === \"exhibition-editor\"\n ? (index: any, data: any) => {\n return canvasActions.createFiltered(\"exhibition-slide\", index, data);\n }\n : canvasActions.create;\n\n if (!canvases || canvases.length === 0) {\n return (\n <div>\n <ManifestOverviewEmptyState onCreate={createCanvas} 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={() => createCanvas()}>\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":"0zBAsBA,MAAaA,EAAgC,CAC3C,GAAI,WACJ,MAAO,WACP,KAAM,GACN,WAAc,EAAC,EAAA,EAAA,CAA8B,CAC9C,CAED,SAAgB,GAA8B,CAC5C,GAAM,CAAE,YAAa,GAAQ,CACvB,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,CAE9D,EACJ,EAAS,KAAO,qBACX,EAAY,IACJ,EAAc,eAAe,mBAAoB,EAAO,EAAK,CAEtE,EAAc,OASpB,MAPI,CAAC,GAAY,EAAS,SAAW,EAEjC,EAAC,MAAA,CAAA,SACC,EAAC,EAAA,CAA2B,SAAU,EAAc,UAAW,GAAmB,CAAA,CAC9E,CAIR,EAAA,EAAA,CAAA,SAAA,CACG,EACC,EAAC,MAAA,CAAI,UAAU,wDACZ,EACD,EAAC,MAAA,CAAI,UA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E,EAAC,MAAA,CAAI,UAAU,4BACb,EAAC,EAAA,CACC,GAAG,KACH,UAAU,6GAET,EAAkB,OACN,CACf,EAAC,EAAA,CACC,8BAAA,GACA,UAAU,8DAET,EAAkB,OACN,CAAA,EACX,CAEN,EAAC,KAAA,EAAA,CAAK,CAAA,CAAA,CACL,CACD,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{metadata:e}=(0,n.useApp)(),{edit:t,open:r}=(0,n.useLayoutActions)(),{structural:o,technical:s}=(0,n.useManifestEditor)(),{items:c}=o,{editorFeatureFlags:{manifestGridOptions:l=!1}}=(0,n.useConfig)(),[u,d]=(0,n.useCreator)({id:s.id.get(),type:`Manifest`},`items`,`Canvas`,void 0,{isPainting:!0}),f=(0,a.useFastList)(c.get(),24),{leftPanel:p}=(0,n.useLayoutState)(),m=p.current===`left-panel-manifest`,[{size:h},g]=(0,a.useGridOptions)(`manifest-grid-size`),_=e.id===`exhibition-editor`?(e,t)=>d.createFiltered(`exhibition-slide`,e,t):d.create;return!f||f.length===0?(0,i.jsx)(`div`,{children:(0,i.jsx)(a.ManifestOverviewEmptyState,{onCreate:_,canCreate:u})}):(0,i.jsxs)(i.Fragment,{children:[l?(0,i.jsxs)(`div`,{className:`p-2 flex gap-2 justify-between items-center`,children:[g,(0,i.jsxs)(`div`,{className:`flex gap-2`,children:[(0,i.jsxs)(a.ActionButton,{isDisabled:!u,onPress:()=>_(),children:[(0,i.jsx)(a.AddIcon,{className:`text-xl`}),` Add new canvas`]}),(0,i.jsx)(a.ActionButton,{onPress:()=>d.creator(`@manifest-editor/iiif-browser-creator`),children:(0,i.jsx)(a.IIIFBrowserIcon,{className:`text-xl`})})]})]}):null,(0,i.jsx)(a.ThumbnailGridContainer,{wide:!0,size:h,children:f.map(e=>(0,i.jsx)(a.CanvasThumbnailGridItem,{id:e.id,onClick:()=>{r({id:`current-canvas`}),m&&r({id:`canvas-listing`,state:{gridView:!0}}),d.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 +1 @@
|
|
|
1
|
-
const e=require(`./components-
|
|
1
|
+
const e=require(`./components-C2KptOSb.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,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import * as _manifest_editor_shell0 from "@manifest-editor/shell";
|
|
3
3
|
import { LayoutPanel } from "@manifest-editor/shell";
|
|
4
4
|
import * as _iiif_presentation_32 from "@iiif/presentation-3";
|
|
@@ -6,7 +6,7 @@ import * as _manifest_editor_editor_api0 from "@manifest-editor/editor-api";
|
|
|
6
6
|
import { SVGProps } from "react";
|
|
7
7
|
|
|
8
8
|
//#region src/center-panels/manifest-overview.d.ts
|
|
9
|
-
declare function ManifestOverviewCenterPanel():
|
|
9
|
+
declare function ManifestOverviewCenterPanel(): react_jsx_runtime0.JSX.Element;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/left-panels/canvas-listing.d.ts
|
|
12
12
|
declare const CanvasListingIcon: ({
|
|
@@ -16,14 +16,14 @@ declare const CanvasListingIcon: ({
|
|
|
16
16
|
}: SVGProps<SVGSVGElement> & {
|
|
17
17
|
title?: string;
|
|
18
18
|
titleId?: string;
|
|
19
|
-
}) =>
|
|
19
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
20
20
|
declare function CanvasListing({
|
|
21
21
|
gridView,
|
|
22
22
|
onChangeGridView
|
|
23
23
|
}: {
|
|
24
24
|
gridView: boolean;
|
|
25
25
|
onChangeGridView: (gridView: boolean) => void;
|
|
26
|
-
}):
|
|
26
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
27
27
|
declare function useEditCanvasItems(): {
|
|
28
28
|
canvas: _manifest_editor_shell0.EditableResource | undefined;
|
|
29
29
|
canvases: {
|
|
@@ -65,14 +65,14 @@ declare function CanvasGridView({
|
|
|
65
65
|
isEditing
|
|
66
66
|
}: {
|
|
67
67
|
isEditing: boolean;
|
|
68
|
-
}):
|
|
68
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
69
69
|
declare function CanvasListView({
|
|
70
70
|
isEditing
|
|
71
71
|
}: {
|
|
72
72
|
isEditing: boolean;
|
|
73
|
-
}):
|
|
74
|
-
declare function ListEditIcon(props: React.SVGProps<SVGSVGElement>):
|
|
75
|
-
declare function CanvasThumbnailsIcon():
|
|
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
76
|
//#endregion
|
|
77
77
|
//#region src/left-panels/manifest.d.ts
|
|
78
78
|
declare function ManifestIcon({
|
|
@@ -82,8 +82,8 @@ declare function ManifestIcon({
|
|
|
82
82
|
}: SVGProps<SVGSVGElement> & {
|
|
83
83
|
title?: string;
|
|
84
84
|
titleId?: string;
|
|
85
|
-
}):
|
|
86
|
-
declare function ManifestPanel():
|
|
85
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
86
|
+
declare function ManifestPanel(): react_jsx_runtime0.JSX.Element;
|
|
87
87
|
//#endregion
|
|
88
88
|
export { CanvasGridView, CanvasListView, CanvasListing, CanvasListingIcon, CanvasThumbnailsIcon, ListEditIcon, ManifestIcon, ManifestOverviewCenterPanel, ManifestPanel, useEditCanvasItems };
|
|
89
89
|
//# sourceMappingURL=components.d.cts.map
|
|
@@ -1 +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":";;;;;;;;
|
|
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":";;;;;;;;iBA6BgB,2BAAA,CAAA,GAA2B,kBAAA,CAAA,GAAA,CAAA;;;cCA9B;;;;GAIV,SAAS;;;MAAqD,kBAAA,CAAA,GAAA,CAAA;iBAuCjD,aAAA;;;;ED3CA,QAAA,EAAA,OAAA;;ICiDf,kBAAA,CAAA,GAAA,CAAA;iBAqDe,kBAAA,CAAA;EAtGH,MAAA,EAsGqB,uBAAA,CAAA,gBAAA,GA9EjC,SAAA;EAxBiC,QAAA,EAAA;IAAA,IAAA,EAAA,MAAA;IAItB,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,GAqLg/R,OArLh/R,CAAA,GAAA,CAAA,GAAA,SAAA;IAAA,SAAA,IAAA,EAAA,CAAA,QAAA,EAAA,GAAA,EAAA,KAAA,CAAA,EAAA,MAAA,EAAA,GAAA,IAAA;IAqDe,SAAA,cAAkB,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EAAA,MAAA,EAAA,WAAA,CAAA,EAAA,GAAA,EAAA,GAgIqnS,OAhIrnS,CAAA,GAAA,CAAA,GAAA,SAAA;IAAA,SAAA,OAAA,EAAA,CAAA,cAAA,EAAA,MAAA,EAAA,WAAA,CAAA,EAAA,GAAA,EAAA,GAgIktS,OAhIltS,CAAA,GAAA,CAAA,GAAA,SAAA;;;;;;;;;;;;;EAgI+8R,CAAA;EAAsK,IAAA,EAAA,CAAA,QAAA,EAA6F,qBAAA,CAAA,SAAA,yCAA7F,EAAA,OAAA,CAAA,MAAA,2CAAA,UAAA,CAAA,EAAA,QAAA,EAAA;IAA6F,KAAA,CAAA,EAAA,OAAA;IAAA,QAAA,CAAA,EAAA,MAAA;;;;;EA3GpuS,eAAA,EAAc,GAAA;AA0C9B,CAAA;AA0CgB,iBApFA,cAAA,CAoFY;EAAA;CAAA,EAAA;EAAuB,SAAA,EAAA,OAAA;CAAf,CAAA,EApFgC,kBAAA,CAAA,GAAA,CAAA,OAoF1B;AAAuB,iBA1CjD,cAAA,CA0CiD;EAAA;AAYjE,CAZiE,EAAA;EAAA,SAAA,EAAA,OAAA;AAYjE,CAAA,CAAA,EAtDoE,kBAAA,CAAA,GAAA,CAAA,OAsDhC;iBAZpB,YAAA,QAAoB,KAAA,CAAM,SAAS,iBAAc,kBAAA,CAAA,GAAA,CAAA;iBAYjD,oBAAA,CAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA;;;iBClPpB,YAAA;;;;GAIb,SAAS;;;IAAqD,kBAAA,CAAA,GAAA,CAAA;iBAmCjD,aAAA,CAAA,GAAa,kBAAA,CAAA,GAAA,CAAA"}
|
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","names":[],"sources":["../src/center-panels/manifest-overview.tsx","../src/left-panels/canvas-listing.tsx","../src/left-panels/manifest.tsx"],"sourcesContent":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"components.d.ts","names":[],"sources":["../src/center-panels/manifest-overview.tsx","../src/left-panels/canvas-listing.tsx","../src/left-panels/manifest.tsx"],"sour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AA,MAAA,2CAAA,UAAA,CAAA,EAAA,QAAA,EAAA;IAA6F,KAAA,CAAA,EAAA,OAAA;IAAA,QAAA,CAAA,EAAA,MAAA;;;;;EA3GpuS,eAAA,EAAc,GAAA;AA0C9B,CAAA;AA0CgB,iBApFA,cAAA,CAoFY;EAAA;CAAA,EAAA;EAAuB,SAAA,EAAA,OAAA;CAAf,CAAA,EApFgC,kBAAA,CAAA,GAAA,CAAA,OAoF1B;AAAuB,iBA1CjD,cAAA,CA0CiD;EAAA;AAYjE,CAZiE,EAAA;EAAA,SAAA,EAAA,OAAA;AAYjE,CAAA,CAAA,EAtDoE,kBAAA,CAAA,GAAA,CAAA,OAsDhC;iBAZpB,YAAA,QAAoB,KAAA,CAAM,SAAS,iBAAc,kBAAA,CAAA,GAAA,CAAA;iBAYjD,oBAAA,CAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA;;;iBClPpB,YAAA;;;;GAIb,SAAS;;;IAAqD,kBAAA,CAAA,GAAA,CAAA;iBAmCjD,aAAA,CAAA,GAAa,kBAAA,CAAA,GAAA,CAAA"}
|
package/dist/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,s as c,t as l}from"./components-
|
|
1
|
+
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,s as c,t as l}from"./components-BFzkaXZY.js";export{i as CanvasGridView,e as CanvasListView,s as CanvasListing,c as CanvasListingIcon,t as CanvasThumbnailsIcon,a as ListEditIcon,l as ManifestIcon,r as ManifestOverviewCenterPanel,o as ManifestPanel,n as useEditCanvasItems};
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./components-Dd5DhBd8.cjs`);let l=require(`@manifest-editor/creators`),u=require(`@manifest-editor/editors`),d=require(`@manifest-editor/shell`),f=require(`react-iiif-vault`),p=require(`zustand`),m=require(`react/jsx-runtime`),h=require(`@manifest-editor/components`),g=require(`@iiif/helpers`),_=require(`@iiif/parser`),v=require(`react`);v=s(v);let y=require(`react-aria-components`),b=require(`@iiif/helpers/vault/actions`),x=require(`@manifest-editor/editor-api`),S=require(`react-aria`),C=require(`tailwind-merge`),w=require(`styled-components`);w=s(w);let T=require(`react-dom`);const E={id:`@manifest-editor/canvas-annotations`,label:`Canvas annotations`,render:()=>(0,m.jsx)(D,{})};function D(){let e=(0,f.useCanvas)(),t=(0,p.useStore)((0,d.useAtlasStore)(),e=>e.tool.enabled),{leftPanel:n}=(0,d.useLayoutState)(),r=n.current===`@manifest-editor/canvas-annotation-listing`,i=e?.annotations[0];return!e||t||!i||!r?null:(0,m.jsx)(f.AnnotationPageContext,{annotationPage:i.id,children:(0,m.jsx)(u.ViewerAnnotationPage,{})})}const O=({title:e,...t})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,height:`1em`,width:`1em`,...t,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z`}),e?(0,m.jsx)(`title`,{children:e}):null]});function k(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M17 4v16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-4-2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 18H4V4h9zm8-14v12c.83 0 1.5-.67 1.5-1.5v-9c0-.83-.67-1.5-1.5-1.5`})})}function A(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M4 18V6zm2-2v-5h9v5zm-2 4q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v6h-2V6H4v12h9v2zm12.5-8V9.5H9V8h9v4zM18 22v-3h-3v-2h3v-3h2v3h3v2h-3v3z`})})}function j(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20z`})})}function M(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`m12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z`})})}function N(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H3V5h18zM5 10h9v2H5zm0-3h9v2H5z`})})}function P(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M11.95 18q.525 0 .888-.363t.362-.887t-.362-.888t-.888-.362t-.887.363t-.363.887t.363.888t.887.362m.05 4q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m.1-12.3q.625 0 1.088.4t.462 1q0 .55-.337.975t-.763.8q-.575.5-1.012 1.1t-.438 1.35q0 .35.263.588t.612.237q.375 0 .638-.25t.337-.625q.1-.525.45-.937t.75-.788q.575-.55.988-1.2t.412-1.45q0-1.275-1.037-2.087T12.1 6q-.95 0-1.812.4T8.975 7.625q-.175.3-.112.638t.337.512q.35.2.725.125t.625-.425q.275-.375.688-.575t.862-.2`})})}function ee(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M11 16.175V5q0-.425.288-.712T12 4t.713.288T13 5v11.175l4.9-4.9q.3-.3.7-.288t.7.313q.275.3.287.7t-.287.7l-6.6 6.6q-.15.15-.325.213t-.375.062t-.375-.062t-.325-.213l-6.6-6.6q-.275-.275-.275-.687T4.7 11.3q.3-.3.713-.3t.712.3z`})})}function F(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`m11 7.825l-4.9 4.9q-.3.3-.7.288t-.7-.313q-.275-.3-.288-.7t.288-.7l6.6-6.6q.15-.15.325-.212T12 4.425t.375.063t.325.212l6.6 6.6q.275.275.275.688t-.275.712q-.3.3-.712.3t-.713-.3L13 7.825V19q0 .425-.288.713T12 20t-.712-.288T11 19z`})})}const I=(0,p.create)(e=>({isSplitting:!1,setIsSplitting:t=>e({isSplitting:t}),splitEffect:()=>()=>{e({isSplitting:!1})}})),te=(0,v.memo)(function(e){let t=(0,f.useRange)({id:e.range.id}),{dragProps:n}=(0,S.useDrag)({isDisabled:!e.dragState,getItems(){return[{"text/plain":JSON.stringify(e.dragState)}]}}),r=(0,f.useVault)(),i=(0,v.useMemo)(()=>{if(!t)return[];let e=(0,g.createRangeHelper)(r).findAllCanvasesInRange(t),n=[],i=[];for(let t of e)n.includes(t.id)||(n.push(t.id),i.push(t));return i},[t,r]);return i.length===0?(0,m.jsx)(`div`,{children:`EMPTY`}):(0,m.jsxs)(`div`,{...n,className:(0,C.twMerge)(`grid relative grid-cols-2 grid-rows-2 aspect-square overflow-hidden w-full gap-1 p-1 bg-gray-300 rounded-md`,i.length===1&&`grid-cols-1 grid-rows-1`,i.length===2&&`grid-cols-1 grid-rows-2`,i.length===3&&`grid-cols-2 grid-rows-2`,i.length===4&&`grid-cols-2 grid-rows-2`),children:[(0,m.jsx)(`div`,{className:`absolute bottom-2 left-2 bg-white/80 p-1 rounded z-20 flex items-center justify-center text-black/50`,children:(0,m.jsx)(h.RangesIcon,{className:`w-5 h-5`})}),i.slice(0,4).map((t,n)=>(0,m.jsx)(h.CanvasThumbnailGridItem,{className:(0,C.twMerge)(`rounded`,i.length===3&&n===2&&`col-span-2`),hideLabel:!0,id:t.id,onClick:e.onClick},n))]})});function L(){let e=(0,f.useRange)(),t=(0,f.useVault)(),n=(0,d.useInlineCreator)();return e?(0,m.jsxs)(`div`,{className:`p-5 `,children:[(0,m.jsxs)(`div`,{className:`flex gap-5 items-baseline`,children:[(0,m.jsxs)(`div`,{className:`flex items-baseline gap-3 mb-3`,children:[(0,m.jsx)(`h3`,{className:`text-xl font-bold `,children:`Canvases at this level`}),(0,m.jsxs)(`span`,{children:[`(`,e.items?.length||0,` `,e.items?.length>1?`canvases`:`canvas`,`)`]})]}),(0,m.jsx)(`div`,{className:`flex gap-2 mb-8`,children:(0,m.jsx)(h.ActionButton,{onPress:async()=>{let r=new x.EditorInstance({reference:{id:e.id,type:`Range`},vault:t}).structural.items.getWithoutTracking(),i=await n.create(`@manifest-editor/range-with-items`,{type:`Range`,label:{en:[`Range 1`]},items:[]},{parent:{property:`items`,resource:{id:e.id,type:`Range`},atIndex:0}});t.dispatch((0,b.moveEntities)({subjects:{type:`slice`,startIndex:1,length:r.length},from:{id:e.id,type:`Range`,key:`items`},to:{id:i.id,type:`Range`,key:`items`}}))},children:`Move into new sub-range`})})]}),(0,m.jsx)(`div`,{className:`grid grid-md gap-3`,children:(e.items||[]).map(t=>{let n=(0,_.toRef)(t);return n.type===`Range`?(0,m.jsx)(te,{range:n},n.id):(0,m.jsx)(f.CanvasContext,{canvas:n.id,children:(0,m.jsx)(h.CanvasThumbnailGridItem,{dragState:{item:n.id,parent:{id:e.id}},id:n.id})},n.id)})})]}):null}function ne({extraClasses:e}){return(0,m.jsxs)(`div`,{className:(0,C.twMerge)(`rounded p-4 bg-white/40 text-sm text-gray-700 flex flex-row gap-5 items-center`,e),children:[(0,m.jsx)(`div`,{className:`opacity-30`,children:(0,m.jsx)(k,{className:`h-24 w-24`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-xl mb-3`,children:`Empty range`}),(0,m.jsxs)(`p`,{children:[`This range does not yet have any canvases. `,(0,m.jsx)(`br`,{}),`If you want to offer navigation to canvases, you can edit the range and add content.`]})]})]})}const R=[{placement:`center`,title:`Working with IIIF ranges`,content:`IIIF uses Ranges to represent logical structure in a digitised object. The range or Table of Contents can then aid users in navigating that content. This short tour shows you the main tools for creating and managing ranges in the Manifest Editor.`,target:`body`},{target:`#range-listing-sidebar`,title:`Range structure`,content:`Browse and navigate your range. Use Edit mode to add more range items, drag to reorder or use the ••• menu to insert empty range items or to delete from the range.`,placement:`right-start`},{target:`#split-range`,title:`Split a range`,content:`Using the splittling mode, you can build and manage the contents of your range. Hover over a canvas to preview, then click to create a new range with canvases from that point onward move into the new range.`},{target:`#edit-ranges`,title:`Edit or reorder ranges`,content:`Toggle Edit to reveal the ••• menu and drag handles for each item in range. Insert an empty range, expand or collapse the structure or delete items. Drag to reorder or move content between range items.`},{target:`#card-view`,title:`Switch view`,content:`Card view provides a simple visual overview of the range. Tree view shows the full hierarchy and allows precise drag and drop options.`},{target:`#grid-options`,title:`Adjust grid size`,content:`Change the canvas thumbnail size to suit your workflow.`},{target:`#launch_range_tour`,title:`That’s it!`,content:(0,m.jsxs)(m.Fragment,{children:[`Now you know the basics of working with ranges. You can restart this tour anytime from the Help menu. Alternatively, you can view the`,` `,(0,m.jsx)(`a`,{className:`text-me-600 underline`,href:`https://manifest-editor-docs.netlify.app/docs/creating-ranges`,target:`_blank`,rel:`noopener noreferrer`,children:`Creating Ranges guide`})]})}];function z(){let[e,t]=(0,v.useState)(!1);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(h.ActionButton,{id:`launch_range_tour`,primary:e,onPress:()=>{t(!0)},children:(0,m.jsx)(P,{className:`text-xl`})}),(0,m.jsx)(h.OnboardingTour,{forceStart:e,onClose:()=>t(!1),id:`range-listing-tour`,steps:R},e?`range-listing-tour`:`default`)]})}const B=({title:e,...t})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z`,fill:`currentColor`}),e?(0,m.jsx)(`title`,{children:e}):null]}),V=({title:e,...t})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M19 13H5v-2h14v2z`,fill:`currentColor`}),e?(0,m.jsx)(`title`,{children:e}):null]}),H=({title:e,...t})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`,fill:`currentColor`}),e?(0,m.jsx)(`title`,{children:e}):null]}),U=({style:e})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1rem`,viewBox:`0 0 24 24`,width:`1rem`,fill:`#000000`,style:e,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`})]}),W=w.default.button`
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./components-C2KptOSb.cjs`);let l=require(`@manifest-editor/creators`),u=require(`@manifest-editor/editors`),d=require(`@manifest-editor/shell`),f=require(`react-iiif-vault`),p=require(`zustand`),m=require(`react/jsx-runtime`),h=require(`@manifest-editor/components`),g=require(`@iiif/helpers`),_=require(`@iiif/parser`),v=require(`react`);v=s(v);let y=require(`react-aria-components`),b=require(`@iiif/helpers/vault/actions`),x=require(`@manifest-editor/editor-api`),S=require(`react-aria`),C=require(`tailwind-merge`),w=require(`styled-components`);w=s(w);let T=require(`react-dom`);const E={id:`@manifest-editor/canvas-annotations`,label:`Canvas annotations`,render:()=>(0,m.jsx)(D,{})};function D(){let e=(0,f.useCanvas)(),t=(0,p.useStore)((0,d.useAtlasStore)(),e=>e.tool.enabled),{leftPanel:n}=(0,d.useLayoutState)(),r=n.current===`@manifest-editor/canvas-annotation-listing`,i=e?.annotations[0];return!e||t||!i||!r?null:(0,m.jsx)(f.AnnotationPageContext,{annotationPage:i.id,children:(0,m.jsx)(u.ViewerAnnotationPage,{})})}const O=({title:e,...t})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,height:`1em`,width:`1em`,...t,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z`}),e?(0,m.jsx)(`title`,{children:e}):null]});function k(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M17 4v16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-4-2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 18H4V4h9zm8-14v12c.83 0 1.5-.67 1.5-1.5v-9c0-.83-.67-1.5-1.5-1.5`})})}function A(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M4 18V6zm2-2v-5h9v5zm-2 4q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v6h-2V6H4v12h9v2zm12.5-8V9.5H9V8h9v4zM18 22v-3h-3v-2h3v-3h2v3h3v2h-3v3z`})})}function j(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20z`})})}function M(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`m12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z`})})}function N(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H3V5h18zM5 10h9v2H5zm0-3h9v2H5z`})})}function P(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M11.95 18q.525 0 .888-.363t.362-.887t-.362-.888t-.888-.362t-.887.363t-.363.887t.363.888t.887.362m.05 4q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m.1-12.3q.625 0 1.088.4t.462 1q0 .55-.337.975t-.763.8q-.575.5-1.012 1.1t-.438 1.35q0 .35.263.588t.612.237q.375 0 .638-.25t.337-.625q.1-.525.45-.937t.75-.788q.575-.55.988-1.2t.412-1.45q0-1.275-1.037-2.087T12.1 6q-.95 0-1.812.4T8.975 7.625q-.175.3-.112.638t.337.512q.35.2.725.125t.625-.425q.275-.375.688-.575t.862-.2`})})}function ee(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`M11 16.175V5q0-.425.288-.712T12 4t.713.288T13 5v11.175l4.9-4.9q.3-.3.7-.288t.7.313q.275.3.287.7t-.287.7l-6.6 6.6q-.15.15-.325.213t-.375.062t-.375-.062t-.325-.213l-6.6-6.6q-.275-.275-.275-.687T4.7 11.3q.3-.3.713-.3t.712.3z`})})}function F(e){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:(0,m.jsx)(`path`,{fill:`currentColor`,d:`m11 7.825l-4.9 4.9q-.3.3-.7.288t-.7-.313q-.275-.3-.288-.7t.288-.7l6.6-6.6q.15-.15.325-.212T12 4.425t.375.063t.325.212l6.6 6.6q.275.275.275.688t-.275.712q-.3.3-.712.3t-.713-.3L13 7.825V19q0 .425-.288.713T12 20t-.712-.288T11 19z`})})}const I=(0,p.create)(e=>({isSplitting:!1,setIsSplitting:t=>e({isSplitting:t}),splitEffect:()=>()=>{e({isSplitting:!1})}})),te=(0,v.memo)(function(e){let t=(0,f.useRange)({id:e.range.id}),{dragProps:n}=(0,S.useDrag)({isDisabled:!e.dragState,getItems(){return[{"text/plain":JSON.stringify(e.dragState)}]}}),r=(0,f.useVault)(),i=(0,v.useMemo)(()=>{if(!t)return[];let e=(0,g.createRangeHelper)(r).findAllCanvasesInRange(t),n=[],i=[];for(let t of e)n.includes(t.id)||(n.push(t.id),i.push(t));return i},[t,r]);return i.length===0?(0,m.jsx)(`div`,{children:`EMPTY`}):(0,m.jsxs)(`div`,{...n,className:(0,C.twMerge)(`grid relative grid-cols-2 grid-rows-2 aspect-square overflow-hidden w-full gap-1 p-1 bg-gray-300 rounded-md`,i.length===1&&`grid-cols-1 grid-rows-1`,i.length===2&&`grid-cols-1 grid-rows-2`,i.length===3&&`grid-cols-2 grid-rows-2`,i.length===4&&`grid-cols-2 grid-rows-2`),children:[(0,m.jsx)(`div`,{className:`absolute bottom-2 left-2 bg-white/80 p-1 rounded z-20 flex items-center justify-center text-black/50`,children:(0,m.jsx)(h.RangesIcon,{className:`w-5 h-5`})}),i.slice(0,4).map((t,n)=>(0,m.jsx)(h.CanvasThumbnailGridItem,{className:(0,C.twMerge)(`rounded`,i.length===3&&n===2&&`col-span-2`),hideLabel:!0,id:t.id,onClick:e.onClick},n))]})});function L(){let e=(0,f.useRange)(),t=(0,f.useVault)(),n=(0,d.useInlineCreator)();return e?(0,m.jsxs)(`div`,{className:`p-5 `,children:[(0,m.jsxs)(`div`,{className:`flex gap-5 items-baseline`,children:[(0,m.jsxs)(`div`,{className:`flex items-baseline gap-3 mb-3`,children:[(0,m.jsx)(`h3`,{className:`text-xl font-bold `,children:`Canvases at this level`}),(0,m.jsxs)(`span`,{children:[`(`,e.items?.length||0,` `,e.items?.length>1?`canvases`:`canvas`,`)`]})]}),(0,m.jsx)(`div`,{className:`flex gap-2 mb-8`,children:(0,m.jsx)(h.ActionButton,{onPress:async()=>{let r=new x.EditorInstance({reference:{id:e.id,type:`Range`},vault:t}).structural.items.getWithoutTracking(),i=await n.create(`@manifest-editor/range-with-items`,{type:`Range`,label:{en:[`Range 1`]},items:[]},{parent:{property:`items`,resource:{id:e.id,type:`Range`},atIndex:0}});t.dispatch((0,b.moveEntities)({subjects:{type:`slice`,startIndex:1,length:r.length},from:{id:e.id,type:`Range`,key:`items`},to:{id:i.id,type:`Range`,key:`items`}}))},children:`Move into new sub-range`})})]}),(0,m.jsx)(`div`,{className:`grid grid-md gap-3`,children:(e.items||[]).map(t=>{let n=(0,_.toRef)(t);return n.type===`Range`?(0,m.jsx)(te,{range:n},n.id):(0,m.jsx)(f.CanvasContext,{canvas:n.id,children:(0,m.jsx)(h.CanvasThumbnailGridItem,{dragState:{item:n.id,parent:{id:e.id}},id:n.id})},n.id)})})]}):null}function ne({extraClasses:e}){return(0,m.jsxs)(`div`,{className:(0,C.twMerge)(`rounded p-4 bg-white/40 text-sm text-gray-700 flex flex-row gap-5 items-center`,e),children:[(0,m.jsx)(`div`,{className:`opacity-30`,children:(0,m.jsx)(k,{className:`h-24 w-24`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`text-xl mb-3`,children:`Empty range`}),(0,m.jsxs)(`p`,{children:[`This range does not yet have any canvases. `,(0,m.jsx)(`br`,{}),`If you want to offer navigation to canvases, you can edit the range and add content.`]})]})]})}const R=[{placement:`center`,title:`Working with IIIF ranges`,content:`IIIF uses Ranges to represent logical structure in a digitised object. The range or Table of Contents can then aid users in navigating that content. This short tour shows you the main tools for creating and managing ranges in the Manifest Editor.`,target:`body`},{target:`#range-listing-sidebar`,title:`Range structure`,content:`Browse and navigate your range. Use Edit mode to add more range items, drag to reorder or use the ••• menu to insert empty range items or to delete from the range.`,placement:`right-start`},{target:`#split-range`,title:`Split a range`,content:`Using the splittling mode, you can build and manage the contents of your range. Hover over a canvas to preview, then click to create a new range with canvases from that point onward move into the new range.`},{target:`#edit-ranges`,title:`Edit or reorder ranges`,content:`Toggle Edit to reveal the ••• menu and drag handles for each item in range. Insert an empty range, expand or collapse the structure or delete items. Drag to reorder or move content between range items.`},{target:`#card-view`,title:`Switch view`,content:`Card view provides a simple visual overview of the range. Tree view shows the full hierarchy and allows precise drag and drop options.`},{target:`#grid-options`,title:`Adjust grid size`,content:`Change the canvas thumbnail size to suit your workflow.`},{target:`#launch_range_tour`,title:`That’s it!`,content:(0,m.jsxs)(m.Fragment,{children:[`Now you know the basics of working with ranges. You can restart this tour anytime from the Help menu. Alternatively, you can view the`,` `,(0,m.jsx)(`a`,{className:`text-me-600 underline`,href:`https://manifest-editor-docs.netlify.app/docs/creating-ranges`,target:`_blank`,rel:`noopener noreferrer`,children:`Creating Ranges guide`})]})}];function z(){let[e,t]=(0,v.useState)(!1);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(h.ActionButton,{id:`launch_range_tour`,primary:e,onPress:()=>{t(!0)},children:(0,m.jsx)(P,{className:`text-xl`})}),(0,m.jsx)(h.OnboardingTour,{forceStart:e,onClose:()=>t(!1),id:`range-listing-tour`,steps:R},e?`range-listing-tour`:`default`)]})}const B=({title:e,...t})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z`,fill:`currentColor`}),e?(0,m.jsx)(`title`,{children:e}):null]}),V=({title:e,...t})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M19 13H5v-2h14v2z`,fill:`currentColor`}),e?(0,m.jsx)(`title`,{children:e}):null]}),H=({title:e,...t})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`,fill:`currentColor`}),e?(0,m.jsx)(`title`,{children:e}):null]}),U=({style:e})=>(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1rem`,viewBox:`0 0 24 24`,width:`1rem`,fill:`#000000`,style:e,children:[(0,m.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,m.jsx)(`path`,{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`})]}),W=w.default.button`
|
|
2
2
|
padding: 0.8em;
|
|
3
3
|
font-size: 1em;
|
|
4
4
|
line-height: 1em;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as e,p as t,r as n,s as r,u as i}from"./components-DH-SLuuf.js";import{allCreators as a}from"@manifest-editor/creators";import{AnnotationCreationPopup as o,AnnotationPreview as s,CanvasPanelEditor as c,CanvasTargetContext as l,HTMLAnnotationEditor as u,InlineLabelEditor as d,InlineLocaleStringEditor as f,ViewerAnnotationPage as p,allEditors as m,useAnnotationEditor as h,useAnnotationInfo as g,useInStack as _}from"@manifest-editor/editors";import{ExportPanel as v,baseCreator as y,baseEditor as b,useAtlasStore as ee,useConfig as x,useCreator as te,useCustomContextMenu as ne,useEditingResource as re,useEditingStack as S,useGenericEditor as ie,useInlineCreator as C,useLayoutActions as w,useLayoutState as ae,useManifestEditor as T}from"@manifest-editor/shell";import{AnnotationContext as oe,AnnotationPageContext as se,CanvasContext as E,CanvasPanel as ce,LocaleString as D,RangeContext as le,useAnnotation as ue,useAnnotationPage as de,useAtlasStore as fe,useCanvas as O,useManifest as pe,useRange as k,useRenderingStrategy as me,useRequestAnnotation as he,useVault as A,useVaultSelector as ge,useViewerPreset as _e}from"react-iiif-vault";import{create as ve,useStore as j}from"zustand";import{Fragment as M,jsx as N,jsxs as P}from"react/jsx-runtime";import{ActionButton as F,AddIcon as I,AddImageIcon as ye,BackIcon as be,CanvasThumbnailGridItem as xe,CheckIcon as Se,DeleteForeverIcon as Ce,DeleteIcon as we,EditTextIcon as Te,EmptyState as Ee,HTMLAnnotationBodyRender as De,InfoMessage as Oe,ListEditIcon as ke,ListResizeDragHandle as Ae,ListingIcon as je,MoreMenuButton as Me,MoreMenuIcon as Ne,OnboardingTour as Pe,RangesIcon as Fe,SelectionCheckbox as Ie,Sidebar as Le,SidebarContent as Re,SidebarHeader as ze,TargetIcon as Be,WarningMessage as Ve,useGridOptions as He,useLoadMoreItems as Ue,useLocalStorage as We}from"@manifest-editor/components";import{createRangeHelper as Ge,getValue as L}from"@iiif/helpers";import{toRef as R}from"@iiif/parser";import{memo as Ke,useCallback as z,useEffect as B,useMemo as V,useRef as H,useState as U}from"react";import{Button as W,Collection as qe,Disclosure as Je,DisclosurePanel as Ye,GridList as Xe,GridListItem as Ze,Heading as Qe,Menu as G,MenuItem as K,MenuTrigger as q,Popover as J,Separator as $e,Tree as et,TreeItem as tt,TreeItemContent as nt,useDragAndDrop as rt}from"react-aria-components";import{moveEntities as Y}from"@iiif/helpers/vault/actions";import{EditorInstance as X}from"@manifest-editor/editor-api";import{useDrag as it,useDrop as at}from"react-aria";import{twJoin as ot,twMerge as Z}from"tailwind-merge";import Q,{css as st}from"styled-components";import{flushSync as ct}from"react-dom";const lt={id:`@manifest-editor/canvas-annotations`,label:`Canvas annotations`,render:()=>N(ut,{})};function ut(){let e=O(),t=j(ee(),e=>e.tool.enabled),{leftPanel:n}=ae(),r=n.current===`@manifest-editor/canvas-annotation-listing`,i=e?.annotations[0];return!e||t||!i||!r?null:N(se,{annotationPage:i.id,children:N(p,{})})}const dt=({title:e,...t})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,height:`1em`,width:`1em`,...t,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z`}),e?N(`title`,{children:e}):null]});function ft(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M17 4v16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-4-2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 18H4V4h9zm8-14v12c.83 0 1.5-.67 1.5-1.5v-9c0-.83-.67-1.5-1.5-1.5`})})}function pt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M4 18V6zm2-2v-5h9v5zm-2 4q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v6h-2V6H4v12h9v2zm12.5-8V9.5H9V8h9v4zM18 22v-3h-3v-2h3v-3h2v3h3v2h-3v3z`})})}function mt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20z`})})}function ht(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`m12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z`})})}function gt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H3V5h18zM5 10h9v2H5zm0-3h9v2H5z`})})}function _t(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M11.95 18q.525 0 .888-.363t.362-.887t-.362-.888t-.888-.362t-.887.363t-.363.887t.363.888t.887.362m.05 4q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m.1-12.3q.625 0 1.088.4t.462 1q0 .55-.337.975t-.763.8q-.575.5-1.012 1.1t-.438 1.35q0 .35.263.588t.612.237q.375 0 .638-.25t.337-.625q.1-.525.45-.937t.75-.788q.575-.55.988-1.2t.412-1.45q0-1.275-1.037-2.087T12.1 6q-.95 0-1.812.4T8.975 7.625q-.175.3-.112.638t.337.512q.35.2.725.125t.625-.425q.275-.375.688-.575t.862-.2`})})}function vt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M11 16.175V5q0-.425.288-.712T12 4t.713.288T13 5v11.175l4.9-4.9q.3-.3.7-.288t.7.313q.275.3.287.7t-.287.7l-6.6 6.6q-.15.15-.325.213t-.375.062t-.375-.062t-.325-.213l-6.6-6.6q-.275-.275-.275-.687T4.7 11.3q.3-.3.713-.3t.712.3z`})})}function yt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`m11 7.825l-4.9 4.9q-.3.3-.7.288t-.7-.313q-.275-.3-.288-.7t.288-.7l6.6-6.6q.15-.15.325-.212T12 4.425t.375.063t.325.212l6.6 6.6q.275.275.275.688t-.275.712q-.3.3-.712.3t-.713-.3L13 7.825V19q0 .425-.288.713T12 20t-.712-.288T11 19z`})})}const bt=ve(e=>({isSplitting:!1,setIsSplitting:t=>e({isSplitting:t}),splitEffect:()=>()=>{e({isSplitting:!1})}})),xt=Ke(function(e){let t=k({id:e.range.id}),{dragProps:n}=it({isDisabled:!e.dragState,getItems(){return[{"text/plain":JSON.stringify(e.dragState)}]}}),r=A(),i=V(()=>{if(!t)return[];let e=Ge(r).findAllCanvasesInRange(t),n=[],i=[];for(let t of e)n.includes(t.id)||(n.push(t.id),i.push(t));return i},[t,r]);return i.length===0?N(`div`,{children:`EMPTY`}):P(`div`,{...n,className:Z(`grid relative grid-cols-2 grid-rows-2 aspect-square overflow-hidden w-full gap-1 p-1 bg-gray-300 rounded-md`,i.length===1&&`grid-cols-1 grid-rows-1`,i.length===2&&`grid-cols-1 grid-rows-2`,i.length===3&&`grid-cols-2 grid-rows-2`,i.length===4&&`grid-cols-2 grid-rows-2`),children:[N(`div`,{className:`absolute bottom-2 left-2 bg-white/80 p-1 rounded z-20 flex items-center justify-center text-black/50`,children:N(Fe,{className:`w-5 h-5`})}),i.slice(0,4).map((t,n)=>N(xe,{className:Z(`rounded`,i.length===3&&n===2&&`col-span-2`),hideLabel:!0,id:t.id,onClick:e.onClick},n))]})});function St(){let e=k(),t=A(),n=C();return e?P(`div`,{className:`p-5 `,children:[P(`div`,{className:`flex gap-5 items-baseline`,children:[P(`div`,{className:`flex items-baseline gap-3 mb-3`,children:[N(`h3`,{className:`text-xl font-bold `,children:`Canvases at this level`}),P(`span`,{children:[`(`,e.items?.length||0,` `,e.items?.length>1?`canvases`:`canvas`,`)`]})]}),N(`div`,{className:`flex gap-2 mb-8`,children:N(F,{onPress:async()=>{let r=new X({reference:{id:e.id,type:`Range`},vault:t}).structural.items.getWithoutTracking(),i=await n.create(`@manifest-editor/range-with-items`,{type:`Range`,label:{en:[`Range 1`]},items:[]},{parent:{property:`items`,resource:{id:e.id,type:`Range`},atIndex:0}});t.dispatch(Y({subjects:{type:`slice`,startIndex:1,length:r.length},from:{id:e.id,type:`Range`,key:`items`},to:{id:i.id,type:`Range`,key:`items`}}))},children:`Move into new sub-range`})})]}),N(`div`,{className:`grid grid-md gap-3`,children:(e.items||[]).map(t=>{let n=R(t);return n.type===`Range`?N(xt,{range:n},n.id):N(E,{canvas:n.id,children:N(xe,{dragState:{item:n.id,parent:{id:e.id}},id:n.id})},n.id)})})]}):null}function Ct({extraClasses:e}){return P(`div`,{className:Z(`rounded p-4 bg-white/40 text-sm text-gray-700 flex flex-row gap-5 items-center`,e),children:[N(`div`,{className:`opacity-30`,children:N(ft,{className:`h-24 w-24`})}),P(`div`,{children:[N(`h3`,{className:`text-xl mb-3`,children:`Empty range`}),P(`p`,{children:[`This range does not yet have any canvases. `,N(`br`,{}),`If you want to offer navigation to canvases, you can edit the range and add content.`]})]})]})}const wt=[{placement:`center`,title:`Working with IIIF ranges`,content:`IIIF uses Ranges to represent logical structure in a digitised object. The range or Table of Contents can then aid users in navigating that content. This short tour shows you the main tools for creating and managing ranges in the Manifest Editor.`,target:`body`},{target:`#range-listing-sidebar`,title:`Range structure`,content:`Browse and navigate your range. Use Edit mode to add more range items, drag to reorder or use the ••• menu to insert empty range items or to delete from the range.`,placement:`right-start`},{target:`#split-range`,title:`Split a range`,content:`Using the splittling mode, you can build and manage the contents of your range. Hover over a canvas to preview, then click to create a new range with canvases from that point onward move into the new range.`},{target:`#edit-ranges`,title:`Edit or reorder ranges`,content:`Toggle Edit to reveal the ••• menu and drag handles for each item in range. Insert an empty range, expand or collapse the structure or delete items. Drag to reorder or move content between range items.`},{target:`#card-view`,title:`Switch view`,content:`Card view provides a simple visual overview of the range. Tree view shows the full hierarchy and allows precise drag and drop options.`},{target:`#grid-options`,title:`Adjust grid size`,content:`Change the canvas thumbnail size to suit your workflow.`},{target:`#launch_range_tour`,title:`That’s it!`,content:P(M,{children:[`Now you know the basics of working with ranges. You can restart this tour anytime from the Help menu. Alternatively, you can view the`,` `,N(`a`,{className:`text-me-600 underline`,href:`https://manifest-editor-docs.netlify.app/docs/creating-ranges`,target:`_blank`,rel:`noopener noreferrer`,children:`Creating Ranges guide`})]})}];function Tt(){let[e,t]=U(!1);return P(M,{children:[N(F,{id:`launch_range_tour`,primary:e,onPress:()=>{t(!0)},children:N(_t,{className:`text-xl`})}),N(Pe,{forceStart:e,onClose:()=>t(!1),id:`range-listing-tour`,steps:wt},e?`range-listing-tour`:`default`)]})}const Et=({title:e,...t})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z`,fill:`currentColor`}),e?N(`title`,{children:e}):null]}),Dt=({title:e,...t})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M19 13H5v-2h14v2z`,fill:`currentColor`}),e?N(`title`,{children:e}):null]}),Ot=({title:e,...t})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`,fill:`currentColor`}),e?N(`title`,{children:e}):null]}),kt=({style:e})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1rem`,viewBox:`0 0 24 24`,width:`1rem`,fill:`#000000`,style:e,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`})]}),At=Q.button`
|
|
1
|
+
import{d as e,p as t,r as n,s as r,u as i}from"./components-BFzkaXZY.js";import{allCreators as a}from"@manifest-editor/creators";import{AnnotationCreationPopup as o,AnnotationPreview as s,CanvasPanelEditor as c,CanvasTargetContext as l,HTMLAnnotationEditor as u,InlineLabelEditor as d,InlineLocaleStringEditor as f,ViewerAnnotationPage as p,allEditors as m,useAnnotationEditor as h,useAnnotationInfo as g,useInStack as _}from"@manifest-editor/editors";import{ExportPanel as v,baseCreator as y,baseEditor as b,useAtlasStore as ee,useConfig as x,useCreator as te,useCustomContextMenu as ne,useEditingResource as re,useEditingStack as S,useGenericEditor as ie,useInlineCreator as C,useLayoutActions as w,useLayoutState as ae,useManifestEditor as T}from"@manifest-editor/shell";import{AnnotationContext as oe,AnnotationPageContext as se,CanvasContext as E,CanvasPanel as ce,LocaleString as D,RangeContext as le,useAnnotation as ue,useAnnotationPage as de,useAtlasStore as fe,useCanvas as O,useManifest as pe,useRange as k,useRenderingStrategy as me,useRequestAnnotation as he,useVault as A,useVaultSelector as ge,useViewerPreset as _e}from"react-iiif-vault";import{create as ve,useStore as j}from"zustand";import{Fragment as M,jsx as N,jsxs as P}from"react/jsx-runtime";import{ActionButton as F,AddIcon as I,AddImageIcon as ye,BackIcon as be,CanvasThumbnailGridItem as xe,CheckIcon as Se,DeleteForeverIcon as Ce,DeleteIcon as we,EditTextIcon as Te,EmptyState as Ee,HTMLAnnotationBodyRender as De,InfoMessage as Oe,ListEditIcon as ke,ListResizeDragHandle as Ae,ListingIcon as je,MoreMenuButton as Me,MoreMenuIcon as Ne,OnboardingTour as Pe,RangesIcon as Fe,SelectionCheckbox as Ie,Sidebar as Le,SidebarContent as Re,SidebarHeader as ze,TargetIcon as Be,WarningMessage as Ve,useGridOptions as He,useLoadMoreItems as Ue,useLocalStorage as We}from"@manifest-editor/components";import{createRangeHelper as Ge,getValue as L}from"@iiif/helpers";import{toRef as R}from"@iiif/parser";import{memo as Ke,useCallback as z,useEffect as B,useMemo as V,useRef as H,useState as U}from"react";import{Button as W,Collection as qe,Disclosure as Je,DisclosurePanel as Ye,GridList as Xe,GridListItem as Ze,Heading as Qe,Menu as G,MenuItem as K,MenuTrigger as q,Popover as J,Separator as $e,Tree as et,TreeItem as tt,TreeItemContent as nt,useDragAndDrop as rt}from"react-aria-components";import{moveEntities as Y}from"@iiif/helpers/vault/actions";import{EditorInstance as X}from"@manifest-editor/editor-api";import{useDrag as it,useDrop as at}from"react-aria";import{twJoin as ot,twMerge as Z}from"tailwind-merge";import Q,{css as st}from"styled-components";import{flushSync as ct}from"react-dom";const lt={id:`@manifest-editor/canvas-annotations`,label:`Canvas annotations`,render:()=>N(ut,{})};function ut(){let e=O(),t=j(ee(),e=>e.tool.enabled),{leftPanel:n}=ae(),r=n.current===`@manifest-editor/canvas-annotation-listing`,i=e?.annotations[0];return!e||t||!i||!r?null:N(se,{annotationPage:i.id,children:N(p,{})})}const dt=({title:e,...t})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,height:`1em`,width:`1em`,...t,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z`}),e?N(`title`,{children:e}):null]});function ft(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M17 4v16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-4-2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 18H4V4h9zm8-14v12c.83 0 1.5-.67 1.5-1.5v-9c0-.83-.67-1.5-1.5-1.5`})})}function pt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M4 18V6zm2-2v-5h9v5zm-2 4q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v6h-2V6H4v12h9v2zm12.5-8V9.5H9V8h9v4zM18 22v-3h-3v-2h3v-3h2v3h3v2h-3v3z`})})}function mt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20z`})})}function ht(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`m12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z`})})}function gt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H3V5h18zM5 10h9v2H5zm0-3h9v2H5z`})})}function _t(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M11.95 18q.525 0 .888-.363t.362-.887t-.362-.888t-.888-.362t-.887.363t-.363.887t.363.888t.887.362m.05 4q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m.1-12.3q.625 0 1.088.4t.462 1q0 .55-.337.975t-.763.8q-.575.5-1.012 1.1t-.438 1.35q0 .35.263.588t.612.237q.375 0 .638-.25t.337-.625q.1-.525.45-.937t.75-.788q.575-.55.988-1.2t.412-1.45q0-1.275-1.037-2.087T12.1 6q-.95 0-1.812.4T8.975 7.625q-.175.3-.112.638t.337.512q.35.2.725.125t.625-.425q.275-.375.688-.575t.862-.2`})})}function vt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`M11 16.175V5q0-.425.288-.712T12 4t.713.288T13 5v11.175l4.9-4.9q.3-.3.7-.288t.7.313q.275.3.287.7t-.287.7l-6.6 6.6q-.15.15-.325.213t-.375.062t-.375-.062t-.325-.213l-6.6-6.6q-.275-.275-.275-.687T4.7 11.3q.3-.3.713-.3t.712.3z`})})}function yt(e){return N(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:N(`path`,{fill:`currentColor`,d:`m11 7.825l-4.9 4.9q-.3.3-.7.288t-.7-.313q-.275-.3-.288-.7t.288-.7l6.6-6.6q.15-.15.325-.212T12 4.425t.375.063t.325.212l6.6 6.6q.275.275.275.688t-.275.712q-.3.3-.712.3t-.713-.3L13 7.825V19q0 .425-.288.713T12 20t-.712-.288T11 19z`})})}const bt=ve(e=>({isSplitting:!1,setIsSplitting:t=>e({isSplitting:t}),splitEffect:()=>()=>{e({isSplitting:!1})}})),xt=Ke(function(e){let t=k({id:e.range.id}),{dragProps:n}=it({isDisabled:!e.dragState,getItems(){return[{"text/plain":JSON.stringify(e.dragState)}]}}),r=A(),i=V(()=>{if(!t)return[];let e=Ge(r).findAllCanvasesInRange(t),n=[],i=[];for(let t of e)n.includes(t.id)||(n.push(t.id),i.push(t));return i},[t,r]);return i.length===0?N(`div`,{children:`EMPTY`}):P(`div`,{...n,className:Z(`grid relative grid-cols-2 grid-rows-2 aspect-square overflow-hidden w-full gap-1 p-1 bg-gray-300 rounded-md`,i.length===1&&`grid-cols-1 grid-rows-1`,i.length===2&&`grid-cols-1 grid-rows-2`,i.length===3&&`grid-cols-2 grid-rows-2`,i.length===4&&`grid-cols-2 grid-rows-2`),children:[N(`div`,{className:`absolute bottom-2 left-2 bg-white/80 p-1 rounded z-20 flex items-center justify-center text-black/50`,children:N(Fe,{className:`w-5 h-5`})}),i.slice(0,4).map((t,n)=>N(xe,{className:Z(`rounded`,i.length===3&&n===2&&`col-span-2`),hideLabel:!0,id:t.id,onClick:e.onClick},n))]})});function St(){let e=k(),t=A(),n=C();return e?P(`div`,{className:`p-5 `,children:[P(`div`,{className:`flex gap-5 items-baseline`,children:[P(`div`,{className:`flex items-baseline gap-3 mb-3`,children:[N(`h3`,{className:`text-xl font-bold `,children:`Canvases at this level`}),P(`span`,{children:[`(`,e.items?.length||0,` `,e.items?.length>1?`canvases`:`canvas`,`)`]})]}),N(`div`,{className:`flex gap-2 mb-8`,children:N(F,{onPress:async()=>{let r=new X({reference:{id:e.id,type:`Range`},vault:t}).structural.items.getWithoutTracking(),i=await n.create(`@manifest-editor/range-with-items`,{type:`Range`,label:{en:[`Range 1`]},items:[]},{parent:{property:`items`,resource:{id:e.id,type:`Range`},atIndex:0}});t.dispatch(Y({subjects:{type:`slice`,startIndex:1,length:r.length},from:{id:e.id,type:`Range`,key:`items`},to:{id:i.id,type:`Range`,key:`items`}}))},children:`Move into new sub-range`})})]}),N(`div`,{className:`grid grid-md gap-3`,children:(e.items||[]).map(t=>{let n=R(t);return n.type===`Range`?N(xt,{range:n},n.id):N(E,{canvas:n.id,children:N(xe,{dragState:{item:n.id,parent:{id:e.id}},id:n.id})},n.id)})})]}):null}function Ct({extraClasses:e}){return P(`div`,{className:Z(`rounded p-4 bg-white/40 text-sm text-gray-700 flex flex-row gap-5 items-center`,e),children:[N(`div`,{className:`opacity-30`,children:N(ft,{className:`h-24 w-24`})}),P(`div`,{children:[N(`h3`,{className:`text-xl mb-3`,children:`Empty range`}),P(`p`,{children:[`This range does not yet have any canvases. `,N(`br`,{}),`If you want to offer navigation to canvases, you can edit the range and add content.`]})]})]})}const wt=[{placement:`center`,title:`Working with IIIF ranges`,content:`IIIF uses Ranges to represent logical structure in a digitised object. The range or Table of Contents can then aid users in navigating that content. This short tour shows you the main tools for creating and managing ranges in the Manifest Editor.`,target:`body`},{target:`#range-listing-sidebar`,title:`Range structure`,content:`Browse and navigate your range. Use Edit mode to add more range items, drag to reorder or use the ••• menu to insert empty range items or to delete from the range.`,placement:`right-start`},{target:`#split-range`,title:`Split a range`,content:`Using the splittling mode, you can build and manage the contents of your range. Hover over a canvas to preview, then click to create a new range with canvases from that point onward move into the new range.`},{target:`#edit-ranges`,title:`Edit or reorder ranges`,content:`Toggle Edit to reveal the ••• menu and drag handles for each item in range. Insert an empty range, expand or collapse the structure or delete items. Drag to reorder or move content between range items.`},{target:`#card-view`,title:`Switch view`,content:`Card view provides a simple visual overview of the range. Tree view shows the full hierarchy and allows precise drag and drop options.`},{target:`#grid-options`,title:`Adjust grid size`,content:`Change the canvas thumbnail size to suit your workflow.`},{target:`#launch_range_tour`,title:`That’s it!`,content:P(M,{children:[`Now you know the basics of working with ranges. You can restart this tour anytime from the Help menu. Alternatively, you can view the`,` `,N(`a`,{className:`text-me-600 underline`,href:`https://manifest-editor-docs.netlify.app/docs/creating-ranges`,target:`_blank`,rel:`noopener noreferrer`,children:`Creating Ranges guide`})]})}];function Tt(){let[e,t]=U(!1);return P(M,{children:[N(F,{id:`launch_range_tour`,primary:e,onPress:()=>{t(!0)},children:N(_t,{className:`text-xl`})}),N(Pe,{forceStart:e,onClose:()=>t(!1),id:`range-listing-tour`,steps:wt},e?`range-listing-tour`:`default`)]})}const Et=({title:e,...t})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z`,fill:`currentColor`}),e?N(`title`,{children:e}):null]}),Dt=({title:e,...t})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M19 13H5v-2h14v2z`,fill:`currentColor`}),e?N(`title`,{children:e}):null]}),Ot=({title:e,...t})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,viewBox:`0 0 24 24`,...t,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`,fill:`currentColor`}),e?N(`title`,{children:e}):null]}),kt=({style:e})=>P(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1rem`,viewBox:`0 0 24 24`,width:`1rem`,fill:`#000000`,style:e,children:[N(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),N(`path`,{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`})]}),At=Q.button`
|
|
2
2
|
padding: 0.8em;
|
|
3
3
|
font-size: 1em;
|
|
4
4
|
line-height: 1em;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manifest-editor/manifest-preset",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-next.0.d7011cd",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
|
|
6
6
|
"repository": {
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"@iiif/parser": "2.2.8",
|
|
46
46
|
"@iiif/presentation-3": "^2.2.3",
|
|
47
47
|
"@iiif/presentation-3-normalized": "^0.9.7",
|
|
48
|
-
"@manifest-editor/components": "2.0.
|
|
49
|
-
"@manifest-editor/creators": "2.0.
|
|
50
|
-
"@manifest-editor/editor-api": "2.0.
|
|
51
|
-
"@manifest-editor/editors": "2.0.
|
|
52
|
-
"@manifest-editor/shell": "2.0.
|
|
48
|
+
"@manifest-editor/components": "2.0.3-next.0.d7011cd",
|
|
49
|
+
"@manifest-editor/creators": "2.0.3-next.0.d7011cd",
|
|
50
|
+
"@manifest-editor/editor-api": "2.0.3-next.0.d7011cd",
|
|
51
|
+
"@manifest-editor/editors": "2.0.3-next.0.d7011cd",
|
|
52
|
+
"@manifest-editor/shell": "2.0.3-next.0.d7011cd",
|
|
53
53
|
"react": "19.2.0",
|
|
54
54
|
"react-aria": "^3.38.1",
|
|
55
55
|
"react-aria-components": "^1.12",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "d7011cdc67f000698511fa002a26a66bc3ebd892"
|
|
78
78
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
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-DH-SLuuf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components-DH-SLuuf.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 }}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|
@@ -1 +0,0 @@
|
|
|
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}});
|