dbf-mirador 4.2.3
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/LICENSE +203 -0
- package/README.md +133 -0
- package/dist/CommentSharp-B0J_-jEq.js +325 -0
- package/dist/CommentSharp-B0J_-jEq.js.map +1 -0
- package/dist/FailedImageContext-aQXnWSHN.js +318 -0
- package/dist/FailedImageContext-aQXnWSHN.js.map +1 -0
- package/dist/PluginHook-CFw_6P5c.js +54 -0
- package/dist/PluginHook-CFw_6P5c.js.map +1 -0
- package/dist/WindowCanvasNavigationControls-CUX723BQ.js +242 -0
- package/dist/WindowCanvasNavigationControls-CUX723BQ.js.map +1 -0
- package/dist/action-types-DjIbTE-A.js +74 -0
- package/dist/action-types-DjIbTE-A.js.map +1 -0
- package/dist/canvas-C8oHvXFN.js +41 -0
- package/dist/canvas-C8oHvXFN.js.map +1 -0
- package/dist/canvases-gRqhr-IH.js +3154 -0
- package/dist/canvases-gRqhr-IH.js.map +1 -0
- package/dist/createSvgIcon-Cwt8YPfm.js +2 -0
- package/dist/getters-COus7Mvg.js +2066 -0
- package/dist/getters-COus7Mvg.js.map +1 -0
- package/dist/index.module-CbBRf_R8.js +403 -0
- package/dist/index.module-CbBRf_R8.js.map +1 -0
- package/dist/mirador.es.js +39600 -0
- package/dist/mirador.es.js.map +1 -0
- package/dist/mirador.min.js +334 -0
- package/dist/mirador.min.js.map +1 -0
- package/dist/react-error-boundary.esm-B_pT-oCS.js +67 -0
- package/dist/react-error-boundary.esm-B_pT-oCS.js.map +1 -0
- package/dist/visuallyHidden-DmYvwNdU.js +98 -0
- package/dist/visuallyHidden-DmYvwNdU.js.map +1 -0
- package/dist/window-zelwU7wz.js +138 -0
- package/dist/window-zelwU7wz.js.map +1 -0
- package/package.json +138 -0
- package/src/components/AccessTokenSender.jsx +34 -0
- package/src/components/AnnotationSettings.jsx +31 -0
- package/src/components/AnnotationsOverlay.jsx +328 -0
- package/src/components/App.jsx +34 -0
- package/src/components/AppProviders.jsx +129 -0
- package/src/components/AttributionPanel.jsx +78 -0
- package/src/components/AudioViewer.jsx +39 -0
- package/src/components/BackgroundPluginArea.jsx +9 -0
- package/src/components/Branding.jsx +33 -0
- package/src/components/CanvasAnnotations.jsx +125 -0
- package/src/components/CanvasInfo.jsx +46 -0
- package/src/components/CanvasLayers.jsx +367 -0
- package/src/components/ChangeThemeDialog.jsx +65 -0
- package/src/components/CollapsibleSection.jsx +53 -0
- package/src/components/CollectionDialog.jsx +236 -0
- package/src/components/CollectionInfo.jsx +48 -0
- package/src/components/CompanionArea.jsx +140 -0
- package/src/components/CompanionWindow.jsx +228 -0
- package/src/components/CompanionWindowFactory.jsx +38 -0
- package/src/components/CompanionWindowSection.jsx +11 -0
- package/src/components/CustomPanel.jsx +22 -0
- package/src/components/ErrorContent.jsx +65 -0
- package/src/components/ErrorDialog.jsx +47 -0
- package/src/components/FullScreenButton.jsx +47 -0
- package/src/components/GalleryView.jsx +36 -0
- package/src/components/GalleryViewThumbnail.jsx +160 -0
- package/src/components/IIIFAuthentication.jsx +144 -0
- package/src/components/IIIFDropTarget.jsx +168 -0
- package/src/components/IIIFIFrameCommunication.jsx +45 -0
- package/src/components/IIIFResourceLabel.jsx +26 -0
- package/src/components/IIIFThumbnail.jsx +214 -0
- package/src/components/ImageFailureMessage.jsx +42 -0
- package/src/components/LabelValueMetadata.jsx +46 -0
- package/src/components/LanguageSettings.jsx +46 -0
- package/src/components/LayersPanel.jsx +24 -0
- package/src/components/LocalePicker.jsx +56 -0
- package/src/components/ManifestForm.jsx +79 -0
- package/src/components/ManifestInfo.jsx +67 -0
- package/src/components/ManifestListItem.jsx +209 -0
- package/src/components/ManifestListItemError.jsx +53 -0
- package/src/components/ManifestRelatedLinks.jsx +154 -0
- package/src/components/MinimalWindow.jsx +104 -0
- package/src/components/MiradorMenuButton.jsx +71 -0
- package/src/components/MosaicRenderPreview.jsx +16 -0
- package/src/components/NestedMenu.jsx +42 -0
- package/src/components/NewBrowserWindow.jsx +34 -0
- package/src/components/OpenSeadragonComponent.jsx +258 -0
- package/src/components/OpenSeadragonTileSource.jsx +105 -0
- package/src/components/OpenSeadragonViewer.jsx +161 -0
- package/src/components/PluginHook.jsx +27 -0
- package/src/components/PrimaryWindow.jsx +115 -0
- package/src/components/SanitizedHtml.jsx +37 -0
- package/src/components/ScrollIndicatedDialogContent.jsx +60 -0
- package/src/components/ScrollTo.jsx +61 -0
- package/src/components/SearchHit.jsx +220 -0
- package/src/components/SearchPanel.jsx +80 -0
- package/src/components/SearchPanelControls.jsx +174 -0
- package/src/components/SearchPanelNavigation.jsx +84 -0
- package/src/components/SearchResults.jsx +138 -0
- package/src/components/SelectCollection.jsx +44 -0
- package/src/components/SidebarIndexItem.jsx +11 -0
- package/src/components/SidebarIndexList.jsx +73 -0
- package/src/components/SidebarIndexTableOfContents.jsx +170 -0
- package/src/components/SidebarIndexThumbnail.jsx +22 -0
- package/src/components/TextViewer.jsx +37 -0
- package/src/components/ThumbnailCanvasGrouping.jsx +122 -0
- package/src/components/ThumbnailNavigation.jsx +231 -0
- package/src/components/VideoViewer.jsx +35 -0
- package/src/components/ViewerInfo.jsx +55 -0
- package/src/components/ViewerNavigation.jsx +72 -0
- package/src/components/Window.jsx +150 -0
- package/src/components/WindowAuthenticationBar.jsx +176 -0
- package/src/components/WindowCanvasNavigationControls.jsx +91 -0
- package/src/components/WindowList.jsx +71 -0
- package/src/components/WindowListButton.jsx +57 -0
- package/src/components/WindowSideBar.jsx +48 -0
- package/src/components/WindowSideBarAnnotationsPanel.jsx +51 -0
- package/src/components/WindowSideBarButtons.jsx +151 -0
- package/src/components/WindowSideBarCanvasPanel.jsx +165 -0
- package/src/components/WindowSideBarCollectionPanel.jsx +179 -0
- package/src/components/WindowSideBarInfoPanel.jsx +67 -0
- package/src/components/WindowThumbnailSettings.jsx +130 -0
- package/src/components/WindowTopBar.jsx +125 -0
- package/src/components/WindowTopBarPluginArea.jsx +8 -0
- package/src/components/WindowTopBarPluginMenu.jsx +78 -0
- package/src/components/WindowTopBarTitle.jsx +73 -0
- package/src/components/WindowTopMenu.jsx +81 -0
- package/src/components/WindowTopMenuButton.jsx +49 -0
- package/src/components/WindowViewSettings.jsx +95 -0
- package/src/components/WindowViewer.jsx +26 -0
- package/src/components/Workspace.jsx +124 -0
- package/src/components/WorkspaceAdd.jsx +221 -0
- package/src/components/WorkspaceAddButton.jsx +73 -0
- package/src/components/WorkspaceArea.jsx +66 -0
- package/src/components/WorkspaceControlPanel.jsx +85 -0
- package/src/components/WorkspaceControlPanelButtons.jsx +20 -0
- package/src/components/WorkspaceDialog.jsx +11 -0
- package/src/components/WorkspaceElastic.jsx +88 -0
- package/src/components/WorkspaceElasticWindow.jsx +79 -0
- package/src/components/WorkspaceExport.jsx +99 -0
- package/src/components/WorkspaceImport.jsx +89 -0
- package/src/components/WorkspaceMenu.jsx +126 -0
- package/src/components/WorkspaceMenuButton.jsx +42 -0
- package/src/components/WorkspaceMosaic.jsx +149 -0
- package/src/components/WorkspaceOptionsButton.jsx +35 -0
- package/src/components/WorkspaceOptionsMenu.jsx +112 -0
- package/src/components/WorkspaceSelectionDialog.jsx +165 -0
- package/src/components/ZoomControls.jsx +57 -0
- package/src/components/icons/BookViewIcon.jsx +14 -0
- package/src/components/icons/CanvasIndexIcon.jsx +14 -0
- package/src/components/icons/GalleryViewIcon.jsx +17 -0
- package/src/components/icons/MiradorIcon.jsx +14 -0
- package/src/components/icons/RestoreZoomIcon.jsx +15 -0
- package/src/components/icons/ThumbnailNavigationBottomIcon.jsx +15 -0
- package/src/components/icons/ThumbnailNavigationRightIcon.jsx +16 -0
- package/src/components/icons/WindowMaxIcon.jsx +15 -0
- package/src/components/icons/WindowMinIcon.jsx +15 -0
- package/src/components/icons/WindowOptionsIcon.jsx +16 -0
- package/src/components/icons/WorkspaceTypeElasticIcon.jsx +157 -0
- package/src/components/icons/WorkspaceTypeMosaicIcon.jsx +162 -0
- package/src/components/icons/index.js +27 -0
- package/src/components/index.js +108 -0
- package/src/config/css-ns.js +10 -0
- package/src/config/index.js +2 -0
- package/src/config/settings.js +607 -0
- package/src/containers/AnnotationSettings.js +27 -0
- package/src/containers/AnnotationsOverlay.js +51 -0
- package/src/containers/AppProviders.js +20 -0
- package/src/containers/AttributionPanel.js +20 -0
- package/src/containers/AudioViewer.js +16 -0
- package/src/containers/BackgroundPluginArea.js +4 -0
- package/src/containers/Branding.js +4 -0
- package/src/containers/CanvasAnnotations.js +32 -0
- package/src/containers/CanvasInfo.js +20 -0
- package/src/containers/CanvasLayers.js +25 -0
- package/src/containers/ChangeThemeDialog.js +29 -0
- package/src/containers/CollapsibleSection.js +3 -0
- package/src/containers/CollectionDialog.js +48 -0
- package/src/containers/CollectionInfo.js +29 -0
- package/src/containers/CompanionArea.js +22 -0
- package/src/containers/CompanionWindow.js +40 -0
- package/src/containers/CompanionWindowFactory.js +23 -0
- package/src/containers/CustomPanel.js +13 -0
- package/src/containers/ErrorContent.js +20 -0
- package/src/containers/ErrorDialog.js +28 -0
- package/src/containers/FullScreenButton.js +22 -0
- package/src/containers/GalleryView.js +23 -0
- package/src/containers/GalleryViewThumbnail.js +51 -0
- package/src/containers/IIIFAuthentication.js +86 -0
- package/src/containers/IIIFThumbnail.js +17 -0
- package/src/containers/LabelValueMetadata.js +14 -0
- package/src/containers/LanguageSettings.js +26 -0
- package/src/containers/LayersPanel.js +16 -0
- package/src/containers/LocalePicker.js +3 -0
- package/src/containers/ManifestForm.js +16 -0
- package/src/containers/ManifestInfo.js +29 -0
- package/src/containers/ManifestListItem.js +52 -0
- package/src/containers/ManifestListItemError.js +15 -0
- package/src/containers/ManifestRelatedLinks.js +28 -0
- package/src/containers/MinimalWindow.js +25 -0
- package/src/containers/MiradorMenuButton.js +7 -0
- package/src/containers/MosaicRenderPreview.js +14 -0
- package/src/containers/OpenSeadragonViewer.js +59 -0
- package/src/containers/PrimaryWindow.js +27 -0
- package/src/containers/SanitizedHtml.js +3 -0
- package/src/containers/ScrollIndicatedDialogContent.js +3 -0
- package/src/containers/SearchHit.js +71 -0
- package/src/containers/SearchPanel.js +23 -0
- package/src/containers/SearchPanelControls.js +36 -0
- package/src/containers/SearchPanelNavigation.js +39 -0
- package/src/containers/SearchResults.js +38 -0
- package/src/containers/SelectCollection.js +24 -0
- package/src/containers/SidebarIndexItem.js +8 -0
- package/src/containers/SidebarIndexList.js +28 -0
- package/src/containers/SidebarIndexTableOfContents.js +31 -0
- package/src/containers/SidebarIndexThumbnail.js +18 -0
- package/src/containers/TextViewer.js +19 -0
- package/src/containers/ThumbnailCanvasGrouping.js +29 -0
- package/src/containers/ThumbnailNavigation.js +48 -0
- package/src/containers/VideoViewer.js +16 -0
- package/src/containers/ViewerInfo.js +30 -0
- package/src/containers/ViewerNavigation.js +31 -0
- package/src/containers/Window.js +45 -0
- package/src/containers/WindowAuthenticationBar.js +7 -0
- package/src/containers/WindowCanvasNavigationControls.js +15 -0
- package/src/containers/WindowList.js +30 -0
- package/src/containers/WindowListButton.js +15 -0
- package/src/containers/WindowSideBar.js +20 -0
- package/src/containers/WindowSideBarAnnotationsPanel.js +23 -0
- package/src/containers/WindowSideBarButtons.js +75 -0
- package/src/containers/WindowSideBarCanvasPanel.js +50 -0
- package/src/containers/WindowSideBarCollectionPanel.js +48 -0
- package/src/containers/WindowSideBarInfoPanel.js +35 -0
- package/src/containers/WindowThumbnailSettings.js +31 -0
- package/src/containers/WindowTopBar.js +39 -0
- package/src/containers/WindowTopBarPluginArea.js +8 -0
- package/src/containers/WindowTopBarPluginMenu.js +7 -0
- package/src/containers/WindowTopBarTitle.js +17 -0
- package/src/containers/WindowTopMenu.js +28 -0
- package/src/containers/WindowTopMenuButton.js +7 -0
- package/src/containers/WindowViewSettings.js +30 -0
- package/src/containers/WindowViewer.js +10 -0
- package/src/containers/Workspace.js +36 -0
- package/src/containers/WorkspaceAdd.js +27 -0
- package/src/containers/WorkspaceAddButton.js +30 -0
- package/src/containers/WorkspaceArea.js +21 -0
- package/src/containers/WorkspaceControlPanel.js +10 -0
- package/src/containers/WorkspaceControlPanelButtons.js +7 -0
- package/src/containers/WorkspaceElastic.js +41 -0
- package/src/containers/WorkspaceElasticWindow.js +36 -0
- package/src/containers/WorkspaceExport.js +18 -0
- package/src/containers/WorkspaceImport.js +19 -0
- package/src/containers/WorkspaceMenu.js +30 -0
- package/src/containers/WorkspaceMenuButton.js +10 -0
- package/src/containers/WorkspaceMosaic.js +32 -0
- package/src/containers/WorkspaceOptionsButton.js +7 -0
- package/src/containers/WorkspaceOptionsMenu.js +3 -0
- package/src/containers/WorkspaceSelectionDialog.js +26 -0
- package/src/containers/ZoomControls.js +26 -0
- package/src/containers/index.js +94 -0
- package/src/contexts/FailedImageContext.js +8 -0
- package/src/contexts/FailedImageProvider.jsx +34 -0
- package/src/contexts/FullScreenContext.js +5 -0
- package/src/contexts/LocaleContext.js +5 -0
- package/src/contexts/OpenSeadragonViewerContext.js +5 -0
- package/src/contexts/WorkspaceContext.js +5 -0
- package/src/contexts/index.js +4 -0
- package/src/extend/PluginContext.js +5 -0
- package/src/extend/PluginProvider.jsx +22 -0
- package/src/extend/index.js +9 -0
- package/src/extend/pluginMapping.js +44 -0
- package/src/extend/pluginPreprocessing.js +45 -0
- package/src/extend/pluginValidation.js +58 -0
- package/src/extend/usePlugins.js +13 -0
- package/src/extend/withPlugins.jsx +46 -0
- package/src/hooks/index.js +4 -0
- package/src/hooks/useCanvasWorldService.js +10 -0
- package/src/hooks/useThumbnailService.js +8 -0
- package/src/i18n.js +71 -0
- package/src/index.js +18 -0
- package/src/init.js +20 -0
- package/src/lib/AnnotationFactory.js +23 -0
- package/src/lib/AnnotationItem.js +123 -0
- package/src/lib/AnnotationList.js +31 -0
- package/src/lib/AnnotationPage.js +41 -0
- package/src/lib/AnnotationResource.js +122 -0
- package/src/lib/CanvasAnnotationDisplay.js +148 -0
- package/src/lib/CanvasGroupings.js +55 -0
- package/src/lib/CanvasWorld.js +214 -0
- package/src/lib/CompanionWindowRegistry.js +23 -0
- package/src/lib/FullScreenHandle.jsx +76 -0
- package/src/lib/MiradorCanvas.js +211 -0
- package/src/lib/MiradorManifest.js +44 -0
- package/src/lib/MiradorViewer.jsx +53 -0
- package/src/lib/MosaicLayout.js +77 -0
- package/src/lib/OpenSeadragonCanvasOverlay.js +114 -0
- package/src/lib/ThumbnailFactory.js +310 -0
- package/src/lib/TruncatedHit.js +34 -0
- package/src/lib/asArray.js +11 -0
- package/src/lib/htmlRules.js +28 -0
- package/src/lib/iiif.js +12 -0
- package/src/lib/index.js +23 -0
- package/src/lib/readImageMetadata.js +21 -0
- package/src/lib/svgShapesToPath.js +49 -0
- package/src/locales/README.md +60 -0
- package/src/locales/ar/translation.json +141 -0
- package/src/locales/bg/translation.json +164 -0
- package/src/locales/de/translation.json +169 -0
- package/src/locales/en/translation.json +170 -0
- package/src/locales/et/translation.json +164 -0
- package/src/locales/fa/translation.json +164 -0
- package/src/locales/fr/translation.json +158 -0
- package/src/locales/hr/translation.json +164 -0
- package/src/locales/hu/translation.json +166 -0
- package/src/locales/it/translation.json +162 -0
- package/src/locales/ja/translation.json +156 -0
- package/src/locales/kr/translation.json +162 -0
- package/src/locales/lt/translation.json +153 -0
- package/src/locales/nbNo/translation.json +162 -0
- package/src/locales/nl/translation.json +139 -0
- package/src/locales/pl/translation.json +162 -0
- package/src/locales/ptBr/translation.json +133 -0
- package/src/locales/sr/translation.json +155 -0
- package/src/locales/sv/translation.json +157 -0
- package/src/locales/ta/translation.json +167 -0
- package/src/locales/vi/translation.json +156 -0
- package/src/locales/zhCn/translation.json +163 -0
- package/src/locales/zhTw/translation.json +163 -0
- package/src/plugins/OSDReferences.js +15 -0
- package/src/plugins/index.js +1 -0
- package/src/state/actions/action-types.js +76 -0
- package/src/state/actions/annotation.js +123 -0
- package/src/state/actions/auth.js +109 -0
- package/src/state/actions/canvas.js +65 -0
- package/src/state/actions/catalog.js +22 -0
- package/src/state/actions/companionWindow.js +107 -0
- package/src/state/actions/config.js +49 -0
- package/src/state/actions/elasticLayout.js +10 -0
- package/src/state/actions/errors.js +22 -0
- package/src/state/actions/index.js +19 -0
- package/src/state/actions/infoResponse.js +90 -0
- package/src/state/actions/layers.js +14 -0
- package/src/state/actions/manifest.js +65 -0
- package/src/state/actions/search.js +97 -0
- package/src/state/actions/window.js +209 -0
- package/src/state/actions/workspace.js +84 -0
- package/src/state/createPluggableStore.js +24 -0
- package/src/state/createStore.js +33 -0
- package/src/state/index.js +21 -0
- package/src/state/reducers/accessTokens.js +59 -0
- package/src/state/reducers/annotations.js +48 -0
- package/src/state/reducers/auth.js +43 -0
- package/src/state/reducers/catalog.js +30 -0
- package/src/state/reducers/companionWindows.js +49 -0
- package/src/state/reducers/config.js +39 -0
- package/src/state/reducers/elasticLayout.js +29 -0
- package/src/state/reducers/errors.js +51 -0
- package/src/state/reducers/index.js +15 -0
- package/src/state/reducers/infoResponses.js +61 -0
- package/src/state/reducers/layers.js +23 -0
- package/src/state/reducers/manifests.js +52 -0
- package/src/state/reducers/rootReducer.js +44 -0
- package/src/state/reducers/search.js +145 -0
- package/src/state/reducers/utils.js +45 -0
- package/src/state/reducers/viewers.js +42 -0
- package/src/state/reducers/windows.js +185 -0
- package/src/state/reducers/workspace.js +111 -0
- package/src/state/sagas/annotations.js +48 -0
- package/src/state/sagas/app.js +56 -0
- package/src/state/sagas/auth.js +151 -0
- package/src/state/sagas/iiif.js +233 -0
- package/src/state/sagas/index.js +30 -0
- package/src/state/sagas/windows.js +293 -0
- package/src/state/selectors/annotations.js +138 -0
- package/src/state/selectors/auth.js +100 -0
- package/src/state/selectors/canvases.js +260 -0
- package/src/state/selectors/companionWindows.js +182 -0
- package/src/state/selectors/config.js +100 -0
- package/src/state/selectors/getters.js +90 -0
- package/src/state/selectors/index.js +17 -0
- package/src/state/selectors/layers.js +79 -0
- package/src/state/selectors/manifests.js +433 -0
- package/src/state/selectors/ranges.js +147 -0
- package/src/state/selectors/searches.js +249 -0
- package/src/state/selectors/sequences.js +134 -0
- package/src/state/selectors/thumbnails.js +28 -0
- package/src/state/selectors/utils.js +18 -0
- package/src/state/selectors/viewer.js +19 -0
- package/src/state/selectors/windows.js +98 -0
- package/src/state/selectors/workspace.js +52 -0
- package/src/state/selectors/wrappers.js +15 -0
- package/src/styles/react-mosaic-component.js +288 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import Grid from '@mui/material/Grid';
|
|
5
|
+
import TextField from '@mui/material/TextField';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Provides a form for user input of a manifest url
|
|
10
|
+
* @prop {Function} addResource
|
|
11
|
+
*/
|
|
12
|
+
export function ManifestForm({ addResourcesOpen, addResource, onSubmit = () => {}, onCancel = null }) {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const [formValue, setFormValue] = useState('');
|
|
15
|
+
|
|
16
|
+
/** */
|
|
17
|
+
const handleCancel = () => {
|
|
18
|
+
onCancel();
|
|
19
|
+
setFormValue('');
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** */
|
|
23
|
+
const handleInputChange = (event) => {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
setFormValue(event.target.value);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** */
|
|
29
|
+
const formSubmit = (event) => {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
addResource(formValue);
|
|
32
|
+
onSubmit();
|
|
33
|
+
setFormValue('');
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
if (!addResourcesOpen) return null;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<form onSubmit={formSubmit}>
|
|
40
|
+
<Grid container spacing={2} columns={12} sx={{ mt: 0.5 }}>
|
|
41
|
+
<Grid size={{ sm: 'grow', xs: 12 }}>
|
|
42
|
+
<TextField
|
|
43
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
44
|
+
autoFocus
|
|
45
|
+
fullWidth
|
|
46
|
+
value={formValue}
|
|
47
|
+
id="manifestURL"
|
|
48
|
+
type="text"
|
|
49
|
+
onChange={handleInputChange}
|
|
50
|
+
variant="filled"
|
|
51
|
+
label={t('addManifestUrl')}
|
|
52
|
+
helperText={t('addManifestUrlHelp')}
|
|
53
|
+
slotProps={{
|
|
54
|
+
inputLabel: { shrink: true },
|
|
55
|
+
inputProps: { style: { typography: 'body1' } },
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
</Grid>
|
|
59
|
+
{onCancel && (
|
|
60
|
+
<Grid size="auto">
|
|
61
|
+
<Button onClick={handleCancel}>{t('cancel')}</Button>
|
|
62
|
+
</Grid>
|
|
63
|
+
)}
|
|
64
|
+
<Grid size="auto">
|
|
65
|
+
<Button id="fetchBtn" type="submit" variant="contained" color="primary">
|
|
66
|
+
{t('fetchManifest')}
|
|
67
|
+
</Button>
|
|
68
|
+
</Grid>
|
|
69
|
+
</Grid>
|
|
70
|
+
</form>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
ManifestForm.propTypes = {
|
|
75
|
+
addResource: PropTypes.func.isRequired,
|
|
76
|
+
addResourcesOpen: PropTypes.bool.isRequired,
|
|
77
|
+
onCancel: PropTypes.func,
|
|
78
|
+
onSubmit: PropTypes.func,
|
|
79
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useId } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Typography from '@mui/material/Typography';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import CollapsibleSection from '../containers/CollapsibleSection';
|
|
6
|
+
import SanitizedHtml from '../containers/SanitizedHtml';
|
|
7
|
+
import LabelValueMetadata from '../containers/LabelValueMetadata';
|
|
8
|
+
import { PluginHook } from './PluginHook';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* ManifestInfo
|
|
12
|
+
*/
|
|
13
|
+
export function ManifestInfo({
|
|
14
|
+
manifestDescription = null,
|
|
15
|
+
manifestLabel = null,
|
|
16
|
+
manifestMetadata = [],
|
|
17
|
+
manifestSummary = null,
|
|
18
|
+
...rest
|
|
19
|
+
}) {
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const id = useId();
|
|
22
|
+
const pluginProps = {
|
|
23
|
+
manifestDescription,
|
|
24
|
+
manifestLabel,
|
|
25
|
+
manifestMetadata,
|
|
26
|
+
manifestSummary,
|
|
27
|
+
...rest,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<CollapsibleSection id={`${id}-resource`} label={t('resource')}>
|
|
32
|
+
{manifestLabel && (
|
|
33
|
+
<Typography
|
|
34
|
+
aria-labelledby={`${id}-resource ${id}-resource-heading`}
|
|
35
|
+
id={`${id}-resource-heading`}
|
|
36
|
+
variant="h4"
|
|
37
|
+
component="h5"
|
|
38
|
+
>
|
|
39
|
+
{manifestLabel}
|
|
40
|
+
</Typography>
|
|
41
|
+
)}
|
|
42
|
+
|
|
43
|
+
{manifestDescription && (
|
|
44
|
+
<Typography variant="body1">
|
|
45
|
+
<SanitizedHtml htmlString={manifestDescription} ruleSet="iiif" />
|
|
46
|
+
</Typography>
|
|
47
|
+
)}
|
|
48
|
+
|
|
49
|
+
{manifestSummary && (
|
|
50
|
+
<Typography variant="body1">
|
|
51
|
+
<SanitizedHtml htmlString={manifestSummary} ruleSet="iiif" />
|
|
52
|
+
</Typography>
|
|
53
|
+
)}
|
|
54
|
+
|
|
55
|
+
{manifestMetadata.length > 0 && <LabelValueMetadata labelValuePairs={manifestMetadata} />}
|
|
56
|
+
|
|
57
|
+
<PluginHook targetName="ManifestInfo" {...pluginProps} />
|
|
58
|
+
</CollapsibleSection>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ManifestInfo.propTypes = {
|
|
63
|
+
manifestDescription: PropTypes.string,
|
|
64
|
+
manifestLabel: PropTypes.string,
|
|
65
|
+
manifestMetadata: PropTypes.array,
|
|
66
|
+
manifestSummary: PropTypes.string,
|
|
67
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import ListItem from '@mui/material/ListItem';
|
|
5
|
+
import ButtonBase from '@mui/material/ButtonBase';
|
|
6
|
+
import Grid from '@mui/material/Grid';
|
|
7
|
+
import Typography from '@mui/material/Typography';
|
|
8
|
+
import Skeleton from '@mui/material/Skeleton';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { Img } from 'react-image';
|
|
11
|
+
import ManifestListItemError from '../containers/ManifestListItemError';
|
|
12
|
+
import ns from '../config/css-ns';
|
|
13
|
+
|
|
14
|
+
const Root = styled(ListItem, { name: 'ManifestListItem', slot: 'root' })(({ ownerState, theme }) => ({
|
|
15
|
+
'&:hover,&:focus-within': {
|
|
16
|
+
backgroundColor: theme.palette.action.hover,
|
|
17
|
+
borderLeftColor: ownerState?.active ? theme.palette.primary.main : theme.palette.action.hover,
|
|
18
|
+
},
|
|
19
|
+
borderLeft: '4px solid',
|
|
20
|
+
borderLeftColor: ownerState?.active ? theme.palette.primary.main : 'transparent',
|
|
21
|
+
paddingLeft: theme.spacing(2),
|
|
22
|
+
paddingRight: theme.spacing(2),
|
|
23
|
+
[theme.breakpoints.up('sm')]: {
|
|
24
|
+
paddingLeft: theme.spacing(3),
|
|
25
|
+
paddingRight: theme.spacing(3),
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
const StyledThumbnail = styled(Img, {
|
|
30
|
+
name: 'ManifestListItem',
|
|
31
|
+
slot: 'thumbnail',
|
|
32
|
+
})(({ theme }) => ({
|
|
33
|
+
maxWidth: '100%',
|
|
34
|
+
objectFit: 'contain',
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
const StyledLogo = styled(Img, { name: 'ManifestListItem', slot: 'logo' })(({ theme }) => ({
|
|
38
|
+
height: '2.5rem',
|
|
39
|
+
maxWidth: '100%',
|
|
40
|
+
objectFit: 'contain',
|
|
41
|
+
paddingRight: 1,
|
|
42
|
+
}));
|
|
43
|
+
|
|
44
|
+
/** */
|
|
45
|
+
const Placeholder = () => (
|
|
46
|
+
<Grid container className={ns('manifest-list-item')} sx={{ alignItems: 'center', display: 'flex', width: '100%' }}>
|
|
47
|
+
<Grid size={{ sm: 5, xs: 12 }} sx={{ display: 'flex', justifyContent: 'flex-start', width: '100%', alignItems: 'center' }}>
|
|
48
|
+
<Grid container component="div" sx={{ width: '100%' }}>
|
|
49
|
+
<Grid size={3} sx={{ alignItems: 'center', display: 'flex', justifyContent: 'flex-start' }}>
|
|
50
|
+
<Skeleton variant="rectangular" sx={{ bgcolor: 'grey[300]' }} height={80} width={120} />
|
|
51
|
+
</Grid>
|
|
52
|
+
<Grid size={9} sx={{ alignContent: 'center', paddingLeft: 2 }}>
|
|
53
|
+
<Skeleton sx={{ bgcolor: 'grey[300]' }} variant="text" width={300} />
|
|
54
|
+
</Grid>
|
|
55
|
+
</Grid>
|
|
56
|
+
</Grid>
|
|
57
|
+
|
|
58
|
+
<Grid size={{ sm: 4, xs: 8 }}>
|
|
59
|
+
<Skeleton sx={{ bgcolor: 'grey[300]' }} variant="text" width={150} />
|
|
60
|
+
<Skeleton sx={{ bgcolor: 'grey[300]' }} variant="text" width={70} />
|
|
61
|
+
</Grid>
|
|
62
|
+
|
|
63
|
+
<Grid size={{ sm: 3, xs: 4 }}>
|
|
64
|
+
<Skeleton sx={{ bgcolor: 'grey[300]' }} variant="rectangular" height={60} width={60} />
|
|
65
|
+
</Grid>
|
|
66
|
+
</Grid>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Represents an item in a list of currently-loaded or loading manifests
|
|
71
|
+
* @param {object} props
|
|
72
|
+
* @param {object} [props.manifest = string]
|
|
73
|
+
*/
|
|
74
|
+
export function ManifestListItem({
|
|
75
|
+
fetchManifest,
|
|
76
|
+
isFetching = false,
|
|
77
|
+
addWindow,
|
|
78
|
+
handleClose = () => {},
|
|
79
|
+
active = false,
|
|
80
|
+
buttonRef = undefined,
|
|
81
|
+
manifestId,
|
|
82
|
+
ready = false,
|
|
83
|
+
title = null,
|
|
84
|
+
thumbnail = null,
|
|
85
|
+
manifestLogo = null,
|
|
86
|
+
size = 0,
|
|
87
|
+
provider = null,
|
|
88
|
+
error = null,
|
|
89
|
+
isCollection = false,
|
|
90
|
+
isMultipart = false,
|
|
91
|
+
}) {
|
|
92
|
+
const { t } = useTranslation();
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (!ready && !error && !isFetching && provider !== 'file') fetchManifest(manifestId);
|
|
95
|
+
}, [manifestId, provider, fetchManifest, ready, error, isFetching]);
|
|
96
|
+
|
|
97
|
+
// eslint-disable-next-line prefer-rest-params
|
|
98
|
+
const ownerState = arguments[0];
|
|
99
|
+
|
|
100
|
+
/** */
|
|
101
|
+
const handleOpenButtonClick = () => {
|
|
102
|
+
addWindow({ manifestId });
|
|
103
|
+
handleClose();
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
if (error) {
|
|
107
|
+
return (
|
|
108
|
+
<Root ownerState={ownerState} divider selected={active} className={active ? 'active' : ''} data-manifestid={manifestId}>
|
|
109
|
+
<ManifestListItemError manifestId={manifestId} />
|
|
110
|
+
</Root>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<Root
|
|
116
|
+
ownerState={ownerState}
|
|
117
|
+
divider
|
|
118
|
+
selected={active}
|
|
119
|
+
className={active ? 'active' : ''}
|
|
120
|
+
data-manifestid={manifestId}
|
|
121
|
+
data-active={active}
|
|
122
|
+
sx={{ width: '100%' }}
|
|
123
|
+
>
|
|
124
|
+
{ready ? (
|
|
125
|
+
<Grid container className={ns('manifest-list-item')} sx={{ alignItems: 'center', width: '100%' }}>
|
|
126
|
+
<Grid size={{ sm: 5, xs: 12 }}>
|
|
127
|
+
<ButtonBase
|
|
128
|
+
ref={buttonRef}
|
|
129
|
+
className={ns('manifest-list-item-title')}
|
|
130
|
+
onClick={handleOpenButtonClick}
|
|
131
|
+
sx={{ alignItems: 'center', justifyContent: 'flex-start', width: '100%' }}
|
|
132
|
+
>
|
|
133
|
+
<Grid container component="div" sx={{ width: '100%' }}>
|
|
134
|
+
<Grid size={3} sx={{ alignItems: 'center', display: 'flex', justifyContent: 'flex-start' }}>
|
|
135
|
+
{thumbnail ? (
|
|
136
|
+
<StyledThumbnail
|
|
137
|
+
className={[ns('manifest-list-item-thumb')]}
|
|
138
|
+
src={[thumbnail]}
|
|
139
|
+
alt=""
|
|
140
|
+
height="80"
|
|
141
|
+
unloader={
|
|
142
|
+
<Skeleton variant="rectangular" animation={false} sx={{ bgcolor: 'grey[300]' }} height={80} width={120} />
|
|
143
|
+
}
|
|
144
|
+
/>
|
|
145
|
+
) : (
|
|
146
|
+
<Skeleton sx={{ bgcolor: 'grey[300]' }} variant="rectangular" height={80} width={120} />
|
|
147
|
+
)}
|
|
148
|
+
</Grid>
|
|
149
|
+
<Grid size={9} sx={{ alignContent: 'center', paddingLeft: 2 }}>
|
|
150
|
+
{isCollection && (
|
|
151
|
+
<Typography component="div" variant="overline" sx={{ textAlign: 'left' }}>
|
|
152
|
+
{t(isMultipart ? 'multipartCollection' : 'collection')}
|
|
153
|
+
</Typography>
|
|
154
|
+
)}
|
|
155
|
+
<Typography component="div" variant="h6" sx={{ textAlign: 'left' }}>
|
|
156
|
+
{title || manifestId}
|
|
157
|
+
</Typography>
|
|
158
|
+
</Grid>
|
|
159
|
+
</Grid>
|
|
160
|
+
</ButtonBase>
|
|
161
|
+
</Grid>
|
|
162
|
+
|
|
163
|
+
<Grid size={{ sm: 4, xs: 8 }}>
|
|
164
|
+
<Typography className={ns('manifest-list-item-provider')}>{provider}</Typography>
|
|
165
|
+
<Typography>{t('numItems', { count: size, number: size })}</Typography>
|
|
166
|
+
</Grid>
|
|
167
|
+
|
|
168
|
+
<Grid size={{ sm: 3, xs: 4 }}>
|
|
169
|
+
{manifestLogo && (
|
|
170
|
+
<StyledLogo
|
|
171
|
+
src={[manifestLogo]}
|
|
172
|
+
alt=""
|
|
173
|
+
role="presentation"
|
|
174
|
+
unloader={
|
|
175
|
+
<Skeleton variant="rectangular" animation={false} sx={{ bgcolor: 'grey[300]' }} height={60} width={60} />
|
|
176
|
+
}
|
|
177
|
+
/>
|
|
178
|
+
)}
|
|
179
|
+
</Grid>
|
|
180
|
+
</Grid>
|
|
181
|
+
) : (
|
|
182
|
+
<Placeholder />
|
|
183
|
+
)}
|
|
184
|
+
</Root>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
ManifestListItem.propTypes = {
|
|
189
|
+
active: PropTypes.bool,
|
|
190
|
+
addWindow: PropTypes.func.isRequired,
|
|
191
|
+
buttonRef: PropTypes.elementType,
|
|
192
|
+
error: PropTypes.oneOfType([
|
|
193
|
+
PropTypes.string,
|
|
194
|
+
PropTypes.bool,
|
|
195
|
+
PropTypes.oneOf([null]), // for null
|
|
196
|
+
]),
|
|
197
|
+
fetchManifest: PropTypes.func.isRequired,
|
|
198
|
+
handleClose: PropTypes.func,
|
|
199
|
+
isCollection: PropTypes.bool,
|
|
200
|
+
isFetching: PropTypes.bool,
|
|
201
|
+
isMultipart: PropTypes.bool,
|
|
202
|
+
manifestId: PropTypes.string.isRequired,
|
|
203
|
+
manifestLogo: PropTypes.string,
|
|
204
|
+
provider: PropTypes.string,
|
|
205
|
+
ready: PropTypes.bool,
|
|
206
|
+
size: PropTypes.number,
|
|
207
|
+
thumbnail: PropTypes.string,
|
|
208
|
+
title: PropTypes.string,
|
|
209
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
import ErrorIcon from '@mui/icons-material/ErrorOutlineSharp';
|
|
4
|
+
import Grid from '@mui/material/Grid';
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ManifestListItemError renders a component displaying a
|
|
10
|
+
* message to the user about a problem loading a manifest
|
|
11
|
+
*/
|
|
12
|
+
export function ManifestListItemError({ manifestId, onDismissClick, onTryAgainClick }) {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
return (
|
|
15
|
+
<Grid container sx={{ alignItems: 'center', width: '100%' }}>
|
|
16
|
+
<Grid container size={{ sm: 5, xs: 12 }} sx={{ alignItems: 'center' }}>
|
|
17
|
+
<ErrorIcon
|
|
18
|
+
sx={{
|
|
19
|
+
color: 'error.main',
|
|
20
|
+
height: '2rem',
|
|
21
|
+
marginRight: '0.5rem',
|
|
22
|
+
width: '2rem',
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
<Typography>{t('manifestError')}</Typography>
|
|
26
|
+
<Typography sx={{ wordBreak: 'break-all' }}>{manifestId}</Typography>
|
|
27
|
+
</Grid>
|
|
28
|
+
|
|
29
|
+
<Grid container size={{ sm: 7, xs: 12 }}>
|
|
30
|
+
<Button
|
|
31
|
+
onClick={() => {
|
|
32
|
+
onDismissClick(manifestId);
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
{t('dismiss')}
|
|
36
|
+
</Button>
|
|
37
|
+
<Button
|
|
38
|
+
onClick={() => {
|
|
39
|
+
onTryAgainClick(manifestId);
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
{t('tryAgain')}
|
|
43
|
+
</Button>
|
|
44
|
+
</Grid>
|
|
45
|
+
</Grid>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
ManifestListItemError.propTypes = {
|
|
50
|
+
manifestId: PropTypes.string.isRequired,
|
|
51
|
+
onDismissClick: PropTypes.func.isRequired,
|
|
52
|
+
onTryAgainClick: PropTypes.func.isRequired,
|
|
53
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { useId } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import Typography from '@mui/material/Typography';
|
|
5
|
+
import Link from '@mui/material/Link';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import CollapsibleSection from '../containers/CollapsibleSection';
|
|
9
|
+
import ns from '../config/css-ns';
|
|
10
|
+
import { PluginHook } from './PluginHook';
|
|
11
|
+
|
|
12
|
+
const StyledDl = styled('dl')(({ theme }) => ({
|
|
13
|
+
'& dd': {
|
|
14
|
+
marginBottom: '.5em',
|
|
15
|
+
marginLeft: '0',
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* ManifestRelatedLinks
|
|
21
|
+
*/
|
|
22
|
+
export function ManifestRelatedLinks({
|
|
23
|
+
homepage = null,
|
|
24
|
+
manifestUrl = null,
|
|
25
|
+
related = null,
|
|
26
|
+
renderings = null,
|
|
27
|
+
seeAlso = null,
|
|
28
|
+
...rest
|
|
29
|
+
}) {
|
|
30
|
+
const { t } = useTranslation();
|
|
31
|
+
const id = useId();
|
|
32
|
+
const titleId = useId();
|
|
33
|
+
|
|
34
|
+
const pluginProps = {
|
|
35
|
+
homepage,
|
|
36
|
+
manifestUrl,
|
|
37
|
+
related,
|
|
38
|
+
renderings,
|
|
39
|
+
seeAlso,
|
|
40
|
+
t,
|
|
41
|
+
...rest,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<CollapsibleSection aria-labelledby={titleId} id={id} label={t('related')}>
|
|
46
|
+
<Typography aria-labelledby={`${id} ${titleId}`} id={titleId} variant="h4" component="h5">
|
|
47
|
+
{t('links')}
|
|
48
|
+
</Typography>
|
|
49
|
+
<StyledDl className={classNames(ns('label-value-metadata'))}>
|
|
50
|
+
{homepage && (
|
|
51
|
+
<>
|
|
52
|
+
<Typography variant="subtitle2" component="dt">
|
|
53
|
+
{t('iiif_homepage')}
|
|
54
|
+
</Typography>
|
|
55
|
+
{homepage.map((page) => (
|
|
56
|
+
<Typography key={page.value} variant="body1" component="dd">
|
|
57
|
+
<Link target="_blank" rel="noopener noreferrer" href={page.value}>
|
|
58
|
+
{page.label || page.value}
|
|
59
|
+
</Link>
|
|
60
|
+
</Typography>
|
|
61
|
+
))}
|
|
62
|
+
</>
|
|
63
|
+
)}
|
|
64
|
+
{renderings && renderings.length > 0 && (
|
|
65
|
+
<>
|
|
66
|
+
<Typography variant="subtitle2" component="dt">
|
|
67
|
+
{t('iiif_renderings')}
|
|
68
|
+
</Typography>
|
|
69
|
+
{renderings.map((rendering) => (
|
|
70
|
+
<Typography key={rendering.value} variant="body1" component="dd">
|
|
71
|
+
<Link target="_blank" rel="noopener noreferrer" href={rendering.value}>
|
|
72
|
+
{rendering.label || rendering.value}
|
|
73
|
+
</Link>
|
|
74
|
+
</Typography>
|
|
75
|
+
))}
|
|
76
|
+
</>
|
|
77
|
+
)}
|
|
78
|
+
{related && (
|
|
79
|
+
<>
|
|
80
|
+
<Typography variant="subtitle2" component="dt">
|
|
81
|
+
{t('iiif_related')}
|
|
82
|
+
</Typography>
|
|
83
|
+
{related.map((relatedItem) => (
|
|
84
|
+
<Typography key={relatedItem.value} variant="body1" component="dd">
|
|
85
|
+
<Link target="_blank" rel="noopener noreferrer" href={relatedItem.value}>
|
|
86
|
+
{relatedItem.label || relatedItem.value}
|
|
87
|
+
</Link>
|
|
88
|
+
{relatedItem.format && <Typography component="span">{` (${relatedItem.format})`}</Typography>}
|
|
89
|
+
</Typography>
|
|
90
|
+
))}
|
|
91
|
+
</>
|
|
92
|
+
)}
|
|
93
|
+
{seeAlso && (
|
|
94
|
+
<>
|
|
95
|
+
<Typography variant="subtitle2" component="dt">
|
|
96
|
+
{t('iiif_seeAlso')}
|
|
97
|
+
</Typography>
|
|
98
|
+
{seeAlso.map((seeAlsoItem) => (
|
|
99
|
+
<Typography key={seeAlsoItem.value} variant="body1" component="dd">
|
|
100
|
+
<Link target="_blank" rel="noopener noreferrer" href={seeAlsoItem.value}>
|
|
101
|
+
{seeAlsoItem.label || seeAlsoItem.value}
|
|
102
|
+
</Link>
|
|
103
|
+
{seeAlsoItem.format && <Typography component="span">{` (${seeAlsoItem.format})`}</Typography>}
|
|
104
|
+
</Typography>
|
|
105
|
+
))}
|
|
106
|
+
</>
|
|
107
|
+
)}
|
|
108
|
+
{manifestUrl && (
|
|
109
|
+
<>
|
|
110
|
+
<Typography variant="subtitle2" component="dt">
|
|
111
|
+
{t('iiif_manifest')}
|
|
112
|
+
</Typography>
|
|
113
|
+
<Typography variant="body1" component="dd">
|
|
114
|
+
<Link target="_blank" rel="noopener noreferrer" href={manifestUrl}>
|
|
115
|
+
{manifestUrl}
|
|
116
|
+
</Link>
|
|
117
|
+
</Typography>
|
|
118
|
+
</>
|
|
119
|
+
)}
|
|
120
|
+
</StyledDl>
|
|
121
|
+
<PluginHook targetName="ManifestRelatedLinks" {...pluginProps} />
|
|
122
|
+
</CollapsibleSection>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
ManifestRelatedLinks.propTypes = {
|
|
127
|
+
homepage: PropTypes.arrayOf(
|
|
128
|
+
PropTypes.shape({
|
|
129
|
+
label: PropTypes.string,
|
|
130
|
+
value: PropTypes.string,
|
|
131
|
+
}),
|
|
132
|
+
),
|
|
133
|
+
manifestUrl: PropTypes.string,
|
|
134
|
+
related: PropTypes.arrayOf(
|
|
135
|
+
PropTypes.shape({
|
|
136
|
+
format: PropTypes.string,
|
|
137
|
+
label: PropTypes.string,
|
|
138
|
+
value: PropTypes.string,
|
|
139
|
+
}),
|
|
140
|
+
),
|
|
141
|
+
renderings: PropTypes.arrayOf(
|
|
142
|
+
PropTypes.shape({
|
|
143
|
+
label: PropTypes.string,
|
|
144
|
+
value: PropTypes.string,
|
|
145
|
+
}),
|
|
146
|
+
),
|
|
147
|
+
seeAlso: PropTypes.arrayOf(
|
|
148
|
+
PropTypes.shape({
|
|
149
|
+
format: PropTypes.string,
|
|
150
|
+
label: PropTypes.string,
|
|
151
|
+
value: PropTypes.string,
|
|
152
|
+
}),
|
|
153
|
+
),
|
|
154
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import MenuIcon from '@mui/icons-material/MenuSharp';
|
|
4
|
+
import cn from 'classnames';
|
|
5
|
+
import Paper from '@mui/material/Paper';
|
|
6
|
+
import AppBar from '@mui/material/AppBar';
|
|
7
|
+
import Toolbar from '@mui/material/Toolbar';
|
|
8
|
+
import Typography from '@mui/material/Typography';
|
|
9
|
+
import CloseIcon from '@mui/icons-material/CloseSharp';
|
|
10
|
+
import { useTranslation } from 'react-i18next';
|
|
11
|
+
import MiradorMenuButton from '../containers/MiradorMenuButton';
|
|
12
|
+
import ns from '../config/css-ns';
|
|
13
|
+
|
|
14
|
+
const StyledMiradorMenuButton = styled(MiradorMenuButton)(() => ({
|
|
15
|
+
marginLeft: 'auto',
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
/** */
|
|
19
|
+
export function MinimalWindow({
|
|
20
|
+
allowClose = true,
|
|
21
|
+
allowWindowSideBar = true,
|
|
22
|
+
ariaLabel = true,
|
|
23
|
+
children = null,
|
|
24
|
+
label = '',
|
|
25
|
+
removeWindow = () => {},
|
|
26
|
+
windowId,
|
|
27
|
+
}) {
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
return (
|
|
30
|
+
<Paper
|
|
31
|
+
component="section"
|
|
32
|
+
elevation={1}
|
|
33
|
+
id={windowId}
|
|
34
|
+
className={cn(ns('placeholder-window'))}
|
|
35
|
+
sx={{
|
|
36
|
+
backgroundColor: 'shades.dark',
|
|
37
|
+
borderRadius: 0,
|
|
38
|
+
display: 'flex',
|
|
39
|
+
flexDirection: 'column',
|
|
40
|
+
height: '100%',
|
|
41
|
+
minHeight: 0,
|
|
42
|
+
overflow: 'hidden',
|
|
43
|
+
width: '100%',
|
|
44
|
+
}}
|
|
45
|
+
aria-label={label && ariaLabel ? t('window', { label }) : null}
|
|
46
|
+
>
|
|
47
|
+
<AppBar position="relative" color="default" enableColorOnDark>
|
|
48
|
+
<Toolbar
|
|
49
|
+
disableGutters
|
|
50
|
+
className={cn(ns('window-top-bar'))}
|
|
51
|
+
sx={{
|
|
52
|
+
backgroundColor: 'shades.main',
|
|
53
|
+
borderTop: '2px solid transparent',
|
|
54
|
+
minHeight: 32,
|
|
55
|
+
paddingLeft: 0.5,
|
|
56
|
+
paddingRight: 0.5,
|
|
57
|
+
}}
|
|
58
|
+
variant="dense"
|
|
59
|
+
>
|
|
60
|
+
{allowWindowSideBar && (
|
|
61
|
+
<MiradorMenuButton aria-label={t('toggleWindowSideBar')} disabled>
|
|
62
|
+
<MenuIcon />
|
|
63
|
+
</MiradorMenuButton>
|
|
64
|
+
)}
|
|
65
|
+
<Typography
|
|
66
|
+
variant="h2"
|
|
67
|
+
noWrap
|
|
68
|
+
sx={{
|
|
69
|
+
color: 'inherit',
|
|
70
|
+
flexGrow: 1,
|
|
71
|
+
paddingLeft: 0.5,
|
|
72
|
+
typography: 'h6',
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
{label}
|
|
76
|
+
</Typography>
|
|
77
|
+
{allowClose && removeWindow && (
|
|
78
|
+
<StyledMiradorMenuButton
|
|
79
|
+
aria-label={t('closeWindow')}
|
|
80
|
+
className={cn(ns('window-close'))}
|
|
81
|
+
onClick={removeWindow}
|
|
82
|
+
TooltipProps={{
|
|
83
|
+
tabIndex: ariaLabel ? 0 : -1,
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
<CloseIcon />
|
|
87
|
+
</StyledMiradorMenuButton>
|
|
88
|
+
)}
|
|
89
|
+
</Toolbar>
|
|
90
|
+
</AppBar>
|
|
91
|
+
{children}
|
|
92
|
+
</Paper>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
MinimalWindow.propTypes = {
|
|
97
|
+
allowClose: PropTypes.bool,
|
|
98
|
+
allowWindowSideBar: PropTypes.bool,
|
|
99
|
+
ariaLabel: PropTypes.bool,
|
|
100
|
+
children: PropTypes.node,
|
|
101
|
+
label: PropTypes.string,
|
|
102
|
+
removeWindow: PropTypes.func,
|
|
103
|
+
windowId: PropTypes.string.isRequired,
|
|
104
|
+
};
|