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,151 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import Badge from '@mui/material/Badge';
|
|
4
|
+
import Tabs from '@mui/material/Tabs';
|
|
5
|
+
import Tab from '@mui/material/Tab';
|
|
6
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
7
|
+
import InfoIcon from '@mui/icons-material/InfoSharp';
|
|
8
|
+
import AnnotationIcon from '@mui/icons-material/CommentSharp';
|
|
9
|
+
import AttributionIcon from '@mui/icons-material/CopyrightSharp';
|
|
10
|
+
import LayersIcon from '@mui/icons-material/LayersSharp';
|
|
11
|
+
import SearchIcon from '@mui/icons-material/SearchSharp';
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
13
|
+
import CanvasIndexIcon from './icons/CanvasIndexIcon';
|
|
14
|
+
import { usePlugins } from '../extend/usePlugins';
|
|
15
|
+
|
|
16
|
+
const Root = styled(Tabs, { name: 'WindowSideBarButtons', slot: 'root' })({
|
|
17
|
+
'& .MuiTabs-flexContainer': {
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
},
|
|
20
|
+
'&.MuiTabs-indicator': {
|
|
21
|
+
display: 'none',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const StyledTabButton = styled(Tab, { name: 'WindowSideBarButtons', slot: 'button' })(({ theme }) => ({
|
|
26
|
+
'&.Mui-selected': {
|
|
27
|
+
borderRight: '2px solid',
|
|
28
|
+
borderRightColor: theme.palette.primary.main,
|
|
29
|
+
},
|
|
30
|
+
'&.MuiTab-root': {
|
|
31
|
+
'&:active': {
|
|
32
|
+
backgroundColor: theme.palette.action.active,
|
|
33
|
+
},
|
|
34
|
+
'&:focus': {
|
|
35
|
+
'@media (hover: none)': {
|
|
36
|
+
backgroundColor: 'transparent',
|
|
37
|
+
},
|
|
38
|
+
backgroundColor: theme.palette.action.hover,
|
|
39
|
+
textDecoration: 'none',
|
|
40
|
+
// Reset on touch devices, it doesn't add specificity
|
|
41
|
+
},
|
|
42
|
+
'&:hover': {
|
|
43
|
+
'@media (hover: none)': {
|
|
44
|
+
backgroundColor: 'transparent',
|
|
45
|
+
},
|
|
46
|
+
backgroundColor: theme.palette.action.hover,
|
|
47
|
+
textDecoration: 'none',
|
|
48
|
+
// Reset on touch devices, it doesn't add specificity
|
|
49
|
+
},
|
|
50
|
+
borderRight: '2px solid transparent',
|
|
51
|
+
minWidth: 'auto',
|
|
52
|
+
},
|
|
53
|
+
fill: 'currentcolor',
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
/** */
|
|
57
|
+
function TabButton({ value, ...tabProps }) {
|
|
58
|
+
const { t } = useTranslation();
|
|
59
|
+
return (
|
|
60
|
+
<Tooltip title={t('openCompanionWindow', { context: value })}>
|
|
61
|
+
<StyledTabButton {...tabProps} value={value} aria-label={t('openCompanionWindow', { context: value })} disableRipple />
|
|
62
|
+
</Tooltip>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
TabButton.propTypes = {
|
|
67
|
+
value: PropTypes.string.isRequired,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
export function WindowSideBarButtons({
|
|
74
|
+
addCompanionWindow,
|
|
75
|
+
hasAnnotations = false,
|
|
76
|
+
hasAnyAnnotations = false,
|
|
77
|
+
hasAnyLayers = false,
|
|
78
|
+
hasCurrentLayers = false,
|
|
79
|
+
hasSearchResults = false,
|
|
80
|
+
hasSearchService = false,
|
|
81
|
+
panels = [],
|
|
82
|
+
sideBarPanel = 'closed',
|
|
83
|
+
}) {
|
|
84
|
+
const { t } = useTranslation();
|
|
85
|
+
const { PluginComponents } = usePlugins('WindowSideBarButtons');
|
|
86
|
+
/** */
|
|
87
|
+
const handleChange = (event, value) => {
|
|
88
|
+
addCompanionWindow(value);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<Root
|
|
93
|
+
value={sideBarPanel === 'closed' ? false : sideBarPanel}
|
|
94
|
+
onChange={handleChange}
|
|
95
|
+
variant="fullWidth"
|
|
96
|
+
indicatorColor="primary"
|
|
97
|
+
textColor="primary"
|
|
98
|
+
orientation="vertical"
|
|
99
|
+
>
|
|
100
|
+
{panels.info && <TabButton value="info" icon={<InfoIcon />} />}
|
|
101
|
+
{panels.attribution && <TabButton value="attribution" icon={<AttributionIcon />} />}
|
|
102
|
+
{panels.canvas && <TabButton value="canvas" icon={<CanvasIndexIcon />} />}
|
|
103
|
+
{panels.annotations && (hasAnnotations || hasAnyAnnotations) && (
|
|
104
|
+
<TabButton
|
|
105
|
+
value="annotations"
|
|
106
|
+
icon={
|
|
107
|
+
<Badge overlap="rectangular" color="notification" invisible={!hasAnnotations} variant="dot">
|
|
108
|
+
<AnnotationIcon />
|
|
109
|
+
</Badge>
|
|
110
|
+
}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
{panels.search && hasSearchService && (
|
|
114
|
+
<TabButton
|
|
115
|
+
value="search"
|
|
116
|
+
icon={
|
|
117
|
+
<Badge overlap="rectangular" color="notification" invisible={!hasSearchResults} variant="dot">
|
|
118
|
+
<SearchIcon />
|
|
119
|
+
</Badge>
|
|
120
|
+
}
|
|
121
|
+
/>
|
|
122
|
+
)}
|
|
123
|
+
{panels.layers && hasAnyLayers && (
|
|
124
|
+
<TabButton
|
|
125
|
+
value="layers"
|
|
126
|
+
icon={
|
|
127
|
+
<Badge overlap="rectangular" color="notification" invisible={!hasCurrentLayers} variant="dot">
|
|
128
|
+
<LayersIcon />
|
|
129
|
+
</Badge>
|
|
130
|
+
}
|
|
131
|
+
/>
|
|
132
|
+
)}
|
|
133
|
+
{PluginComponents &&
|
|
134
|
+
PluginComponents.map((PluginComponent) => (
|
|
135
|
+
<TabButton key={PluginComponent.value} value={PluginComponent.value} icon={<PluginComponent />} />
|
|
136
|
+
))}
|
|
137
|
+
</Root>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
WindowSideBarButtons.propTypes = {
|
|
142
|
+
addCompanionWindow: PropTypes.func.isRequired,
|
|
143
|
+
hasAnnotations: PropTypes.bool,
|
|
144
|
+
hasAnyAnnotations: PropTypes.bool,
|
|
145
|
+
hasAnyLayers: PropTypes.bool,
|
|
146
|
+
hasCurrentLayers: PropTypes.bool,
|
|
147
|
+
hasSearchResults: PropTypes.bool,
|
|
148
|
+
hasSearchService: PropTypes.bool,
|
|
149
|
+
panels: PropTypes.objectOf(PropTypes.bool),
|
|
150
|
+
sideBarPanel: PropTypes.string,
|
|
151
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { useId, useRef } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import Tabs from '@mui/material/Tabs';
|
|
5
|
+
import Tab from '@mui/material/Tab';
|
|
6
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
7
|
+
import Button from '@mui/material/Button';
|
|
8
|
+
import ItemListIcon from '@mui/icons-material/ReorderSharp';
|
|
9
|
+
import TocIcon from '@mui/icons-material/SortSharp';
|
|
10
|
+
import ThumbnailListIcon from '@mui/icons-material/ViewListSharp';
|
|
11
|
+
import Typography from '@mui/material/Typography';
|
|
12
|
+
import ArrowForwardIcon from '@mui/icons-material/ArrowForwardSharp';
|
|
13
|
+
import FormControl from '@mui/material/FormControl';
|
|
14
|
+
import Select from '@mui/material/Select';
|
|
15
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
16
|
+
import { useTranslation } from 'react-i18next';
|
|
17
|
+
import CompanionWindow from '../containers/CompanionWindow';
|
|
18
|
+
import SidebarIndexList from '../containers/SidebarIndexList';
|
|
19
|
+
import SidebarIndexTableOfContents from '../containers/SidebarIndexTableOfContents';
|
|
20
|
+
import { IIIFResourceLabel } from './IIIFResourceLabel';
|
|
21
|
+
|
|
22
|
+
const StyledBreak = styled('div')(() => ({
|
|
23
|
+
flexBasis: '100%',
|
|
24
|
+
height: 0,
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* a panel showing the canvases for a given manifest
|
|
29
|
+
*/
|
|
30
|
+
export function WindowSideBarCanvasPanel({
|
|
31
|
+
collection = null,
|
|
32
|
+
id,
|
|
33
|
+
showMultipart,
|
|
34
|
+
sequenceId = null,
|
|
35
|
+
sequences = [],
|
|
36
|
+
variant,
|
|
37
|
+
showToc = false,
|
|
38
|
+
updateSequence,
|
|
39
|
+
updateVariant,
|
|
40
|
+
windowId,
|
|
41
|
+
}) {
|
|
42
|
+
const { t } = useTranslation();
|
|
43
|
+
const containerRef = useRef();
|
|
44
|
+
const tabPanelId = useId();
|
|
45
|
+
|
|
46
|
+
/** */
|
|
47
|
+
const handleSequenceChange = (event) => {
|
|
48
|
+
updateSequence(event.target.value);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** */
|
|
52
|
+
const handleVariantChange = (event, value) => {
|
|
53
|
+
updateVariant(value);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
let listComponent;
|
|
57
|
+
|
|
58
|
+
if (variant === 'tableOfContents') {
|
|
59
|
+
listComponent = <SidebarIndexTableOfContents id={id} containerRef={containerRef} windowId={windowId} />;
|
|
60
|
+
} else {
|
|
61
|
+
listComponent = <SidebarIndexList id={id} containerRef={containerRef} windowId={windowId} />;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<CompanionWindow
|
|
66
|
+
title={t('canvasIndex')}
|
|
67
|
+
id={id}
|
|
68
|
+
windowId={windowId}
|
|
69
|
+
ref={containerRef}
|
|
70
|
+
titleControls={
|
|
71
|
+
<>
|
|
72
|
+
{sequences && sequences.length > 1 && (
|
|
73
|
+
<FormControl>
|
|
74
|
+
<Select
|
|
75
|
+
MenuProps={{
|
|
76
|
+
anchorOrigin: {
|
|
77
|
+
horizontal: 'left',
|
|
78
|
+
vertical: 'bottom',
|
|
79
|
+
},
|
|
80
|
+
}}
|
|
81
|
+
displayEmpty
|
|
82
|
+
value={sequenceId}
|
|
83
|
+
onChange={handleSequenceChange}
|
|
84
|
+
name="sequenceId"
|
|
85
|
+
sx={{
|
|
86
|
+
'&.MuiSelect-select': {
|
|
87
|
+
'&:focus': {
|
|
88
|
+
backgroundColor: 'background.paper',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
backgroundColor: 'background.paper',
|
|
92
|
+
}}
|
|
93
|
+
data-testid="sequence-select"
|
|
94
|
+
>
|
|
95
|
+
{sequences.map((s, i) => (
|
|
96
|
+
<MenuItem value={s.id} key={s.id}>
|
|
97
|
+
<Typography variant="body2">
|
|
98
|
+
<IIIFResourceLabel resource={s} />
|
|
99
|
+
</Typography>
|
|
100
|
+
</MenuItem>
|
|
101
|
+
))}
|
|
102
|
+
</Select>
|
|
103
|
+
</FormControl>
|
|
104
|
+
)}
|
|
105
|
+
<StyledBreak />
|
|
106
|
+
<Tabs value={variant} onChange={handleVariantChange} variant="fullWidth" indicatorColor="primary" textColor="primary">
|
|
107
|
+
{showToc && (
|
|
108
|
+
<Tooltip title={t('tableOfContentsList')} value="tableOfContents">
|
|
109
|
+
<Tab
|
|
110
|
+
sx={{ minWidth: 'auto' }}
|
|
111
|
+
value="tableOfContents"
|
|
112
|
+
aria-label={t('tableOfContentsList')}
|
|
113
|
+
aria-controls={tabPanelId}
|
|
114
|
+
icon={<TocIcon style={{ transform: 'scale(-1, 1)' }} />}
|
|
115
|
+
/>
|
|
116
|
+
</Tooltip>
|
|
117
|
+
)}
|
|
118
|
+
<Tooltip title={t('itemList')} value="item">
|
|
119
|
+
<Tab
|
|
120
|
+
sx={{ minWidth: 'auto' }}
|
|
121
|
+
value="item"
|
|
122
|
+
aria-label={t('itemList')}
|
|
123
|
+
aria-controls={tabPanelId}
|
|
124
|
+
icon={<ItemListIcon />}
|
|
125
|
+
/>
|
|
126
|
+
</Tooltip>
|
|
127
|
+
<Tooltip title={t('thumbnailList')} value="thumbnail">
|
|
128
|
+
<Tab
|
|
129
|
+
sx={{ minWidth: 'auto' }}
|
|
130
|
+
value="thumbnail"
|
|
131
|
+
aria-label={t('thumbnailList')}
|
|
132
|
+
aria-controls={tabPanelId}
|
|
133
|
+
icon={<ThumbnailListIcon />}
|
|
134
|
+
/>
|
|
135
|
+
</Tooltip>
|
|
136
|
+
</Tabs>
|
|
137
|
+
</>
|
|
138
|
+
}
|
|
139
|
+
>
|
|
140
|
+
<div id={tabPanelId}>
|
|
141
|
+
{collection && (
|
|
142
|
+
<Button fullWidth onClick={showMultipart} endIcon={<ArrowForwardIcon />}>
|
|
143
|
+
<Typography sx={{ textTransform: 'none' }}>
|
|
144
|
+
<IIIFResourceLabel resource={collection} />
|
|
145
|
+
</Typography>
|
|
146
|
+
</Button>
|
|
147
|
+
)}
|
|
148
|
+
{listComponent}
|
|
149
|
+
</div>
|
|
150
|
+
</CompanionWindow>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
WindowSideBarCanvasPanel.propTypes = {
|
|
155
|
+
collection: PropTypes.object,
|
|
156
|
+
id: PropTypes.string.isRequired,
|
|
157
|
+
sequenceId: PropTypes.string,
|
|
158
|
+
sequences: PropTypes.arrayOf(PropTypes.object),
|
|
159
|
+
showMultipart: PropTypes.func.isRequired,
|
|
160
|
+
showToc: PropTypes.bool,
|
|
161
|
+
updateSequence: PropTypes.func.isRequired,
|
|
162
|
+
updateVariant: PropTypes.func.isRequired,
|
|
163
|
+
variant: PropTypes.oneOf(['item', 'thumbnail', 'tableOfContents']).isRequired,
|
|
164
|
+
windowId: PropTypes.string.isRequired,
|
|
165
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import List from '@mui/material/List';
|
|
3
|
+
import ListItem from '@mui/material/ListItem';
|
|
4
|
+
import ListItemButton from '@mui/material/ListItemButton';
|
|
5
|
+
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
6
|
+
import ListItemText from '@mui/material/ListItemText';
|
|
7
|
+
import MenuList from '@mui/material/MenuList';
|
|
8
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
9
|
+
import Typography from '@mui/material/Typography';
|
|
10
|
+
import Skeleton from '@mui/material/Skeleton';
|
|
11
|
+
import ArrowUpwardIcon from '@mui/icons-material/ArrowUpwardSharp';
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
13
|
+
import CompanionWindow from '../containers/CompanionWindow';
|
|
14
|
+
import IIIFThumbnail from '../containers/IIIFThumbnail';
|
|
15
|
+
import { IIIFResourceLabel } from './IIIFResourceLabel';
|
|
16
|
+
|
|
17
|
+
/** */
|
|
18
|
+
function Item({ manifest, canvasNavigation, variant, ...otherProps }) {
|
|
19
|
+
return (
|
|
20
|
+
<MenuItem
|
|
21
|
+
divider
|
|
22
|
+
component="li"
|
|
23
|
+
variant="multiline"
|
|
24
|
+
sx={{
|
|
25
|
+
alignItems: 'flex-start',
|
|
26
|
+
paddingRight: 1,
|
|
27
|
+
}}
|
|
28
|
+
{...otherProps}
|
|
29
|
+
>
|
|
30
|
+
{variant === 'thumbnail' && (
|
|
31
|
+
<ListItemIcon>
|
|
32
|
+
<IIIFThumbnail resource={manifest} maxHeight={canvasNavigation.height} maxWidth={canvasNavigation.width} />
|
|
33
|
+
</ListItemIcon>
|
|
34
|
+
)}
|
|
35
|
+
<ListItemText>
|
|
36
|
+
<IIIFResourceLabel resource={manifest} />
|
|
37
|
+
</ListItemText>
|
|
38
|
+
</MenuItem>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Item.propTypes = {
|
|
43
|
+
canvasNavigation: PropTypes.shape({
|
|
44
|
+
height: PropTypes.number,
|
|
45
|
+
width: PropTypes.number,
|
|
46
|
+
}).isRequired,
|
|
47
|
+
manifest: PropTypes.object.isRequired,
|
|
48
|
+
variant: PropTypes.string.isRequired,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** */
|
|
52
|
+
export function WindowSideBarCollectionPanel({
|
|
53
|
+
canvasNavigation,
|
|
54
|
+
collectionPath = [],
|
|
55
|
+
collection = null,
|
|
56
|
+
id,
|
|
57
|
+
isFetching = false,
|
|
58
|
+
manifestId,
|
|
59
|
+
parentCollection = null,
|
|
60
|
+
updateCompanionWindow,
|
|
61
|
+
updateWindow,
|
|
62
|
+
variant = null,
|
|
63
|
+
windowId,
|
|
64
|
+
}) {
|
|
65
|
+
const { t } = useTranslation();
|
|
66
|
+
/** */
|
|
67
|
+
const isMultipart = (() => {
|
|
68
|
+
if (!collection) return false;
|
|
69
|
+
|
|
70
|
+
const behaviors = collection.getProperty('behavior');
|
|
71
|
+
|
|
72
|
+
if (!behaviors) return false;
|
|
73
|
+
|
|
74
|
+
if (Array.isArray(behaviors)) return behaviors.includes('multi-part');
|
|
75
|
+
|
|
76
|
+
return behaviors === 'multi-part';
|
|
77
|
+
})();
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<CompanionWindow
|
|
81
|
+
title={t(isMultipart ? 'multipartCollection' : 'collection')}
|
|
82
|
+
windowId={windowId}
|
|
83
|
+
id={id}
|
|
84
|
+
titleControls={
|
|
85
|
+
<>
|
|
86
|
+
{parentCollection && (
|
|
87
|
+
<List>
|
|
88
|
+
<ListItemButton onClick={() => updateCompanionWindow({ collectionPath: collectionPath.slice(0, -1) })}>
|
|
89
|
+
<ListItemIcon>
|
|
90
|
+
<ArrowUpwardIcon />
|
|
91
|
+
</ListItemIcon>
|
|
92
|
+
<ListItemText
|
|
93
|
+
slotProps={{
|
|
94
|
+
primary: { variant: 'body1' },
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
<IIIFResourceLabel resource={parentCollection} />
|
|
98
|
+
</ListItemText>
|
|
99
|
+
</ListItemButton>
|
|
100
|
+
</List>
|
|
101
|
+
)}
|
|
102
|
+
<Typography variant="h6">
|
|
103
|
+
{collection && <IIIFResourceLabel resource={collection} />}
|
|
104
|
+
{isFetching && <Skeleton variant="text" />}
|
|
105
|
+
</Typography>
|
|
106
|
+
</>
|
|
107
|
+
}
|
|
108
|
+
>
|
|
109
|
+
<MenuList>
|
|
110
|
+
{isFetching && (
|
|
111
|
+
<MenuItem>
|
|
112
|
+
<ListItemText>
|
|
113
|
+
<Skeleton variant="text" />
|
|
114
|
+
<Skeleton variant="text" />
|
|
115
|
+
<Skeleton variant="text" />
|
|
116
|
+
</ListItemText>
|
|
117
|
+
</MenuItem>
|
|
118
|
+
)}
|
|
119
|
+
{collection &&
|
|
120
|
+
collection.getCollections().map((manifest) => {
|
|
121
|
+
/** select the new manifest and go back to the normal index */
|
|
122
|
+
const onClick = () => {
|
|
123
|
+
// close collection
|
|
124
|
+
updateCompanionWindow({ collectionPath: [...collectionPath, manifest.id] });
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<Item
|
|
129
|
+
key={manifest.id}
|
|
130
|
+
onClick={onClick}
|
|
131
|
+
canvasNavigation={canvasNavigation}
|
|
132
|
+
manifest={manifest}
|
|
133
|
+
variant={variant}
|
|
134
|
+
selected={manifestId === manifest.id}
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
})}
|
|
138
|
+
{collection &&
|
|
139
|
+
collection.getManifests().map((manifest) => {
|
|
140
|
+
/** select the new manifest and go back to the normal index */
|
|
141
|
+
const onClick = () => {
|
|
142
|
+
// select new manifest
|
|
143
|
+
updateWindow({ canvasId: null, collectionPath, manifestId: manifest.id });
|
|
144
|
+
// close collection
|
|
145
|
+
updateCompanionWindow({ multipart: false });
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<Item
|
|
150
|
+
key={manifest.id}
|
|
151
|
+
onClick={onClick}
|
|
152
|
+
canvasNavigation={canvasNavigation}
|
|
153
|
+
manifest={manifest}
|
|
154
|
+
variant={variant}
|
|
155
|
+
selected={manifestId === manifest.id}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
})}
|
|
159
|
+
</MenuList>
|
|
160
|
+
</CompanionWindow>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
WindowSideBarCollectionPanel.propTypes = {
|
|
165
|
+
canvasNavigation: PropTypes.shape({
|
|
166
|
+
height: PropTypes.number,
|
|
167
|
+
width: PropTypes.number,
|
|
168
|
+
}).isRequired,
|
|
169
|
+
collection: PropTypes.object,
|
|
170
|
+
collectionPath: PropTypes.arrayOf(PropTypes.string),
|
|
171
|
+
id: PropTypes.string.isRequired,
|
|
172
|
+
isFetching: PropTypes.bool,
|
|
173
|
+
manifestId: PropTypes.string.isRequired,
|
|
174
|
+
parentCollection: PropTypes.object,
|
|
175
|
+
updateCompanionWindow: PropTypes.func.isRequired,
|
|
176
|
+
updateWindow: PropTypes.func.isRequired,
|
|
177
|
+
variant: PropTypes.string,
|
|
178
|
+
windowId: PropTypes.string.isRequired,
|
|
179
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import CompanionWindow from '../containers/CompanionWindow';
|
|
4
|
+
import { CompanionWindowSection } from './CompanionWindowSection';
|
|
5
|
+
import CanvasInfo from '../containers/CanvasInfo';
|
|
6
|
+
import LocalePicker from '../containers/LocalePicker';
|
|
7
|
+
import ManifestInfo from '../containers/ManifestInfo';
|
|
8
|
+
import CollectionInfo from '../containers/CollectionInfo';
|
|
9
|
+
import ManifestRelatedLinks from '../containers/ManifestRelatedLinks';
|
|
10
|
+
import ns from '../config/css-ns';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* WindowSideBarInfoPanel
|
|
14
|
+
*/
|
|
15
|
+
export function WindowSideBarInfoPanel({
|
|
16
|
+
windowId,
|
|
17
|
+
id,
|
|
18
|
+
canvasIds = [],
|
|
19
|
+
collectionPath = [],
|
|
20
|
+
locale = '',
|
|
21
|
+
setLocale = undefined,
|
|
22
|
+
availableLocales = [],
|
|
23
|
+
showLocalePicker = false,
|
|
24
|
+
}) {
|
|
25
|
+
const { t } = useTranslation();
|
|
26
|
+
return (
|
|
27
|
+
<CompanionWindow
|
|
28
|
+
title={t('aboutThisItem')}
|
|
29
|
+
paperClassName={ns('window-sidebar-info-panel')}
|
|
30
|
+
windowId={windowId}
|
|
31
|
+
id={id}
|
|
32
|
+
titleControls={
|
|
33
|
+
showLocalePicker && <LocalePicker locale={locale} setLocale={setLocale} availableLocales={availableLocales} />
|
|
34
|
+
}
|
|
35
|
+
>
|
|
36
|
+
{canvasIds.map((canvasId, index) => (
|
|
37
|
+
<CompanionWindowSection key={canvasId}>
|
|
38
|
+
<CanvasInfo canvasId={canvasId} companionWindowId={id} index={index} totalSize={canvasIds.length} windowId={windowId} />
|
|
39
|
+
</CompanionWindowSection>
|
|
40
|
+
))}
|
|
41
|
+
{collectionPath.length > 0 && (
|
|
42
|
+
<CompanionWindowSection>
|
|
43
|
+
<CollectionInfo companionWindowId={id} windowId={windowId} />
|
|
44
|
+
</CompanionWindowSection>
|
|
45
|
+
)}
|
|
46
|
+
|
|
47
|
+
<CompanionWindowSection>
|
|
48
|
+
<ManifestInfo companionWindowId={id} windowId={windowId} />
|
|
49
|
+
</CompanionWindowSection>
|
|
50
|
+
|
|
51
|
+
<CompanionWindowSection>
|
|
52
|
+
<ManifestRelatedLinks companionWindowId={id} windowId={windowId} />
|
|
53
|
+
</CompanionWindowSection>
|
|
54
|
+
</CompanionWindow>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
WindowSideBarInfoPanel.propTypes = {
|
|
59
|
+
availableLocales: PropTypes.arrayOf(PropTypes.string),
|
|
60
|
+
canvasIds: PropTypes.arrayOf(PropTypes.string),
|
|
61
|
+
collectionPath: PropTypes.arrayOf(PropTypes.string),
|
|
62
|
+
id: PropTypes.string.isRequired,
|
|
63
|
+
locale: PropTypes.string,
|
|
64
|
+
setLocale: PropTypes.func,
|
|
65
|
+
showLocalePicker: PropTypes.bool,
|
|
66
|
+
windowId: PropTypes.string.isRequired,
|
|
67
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
3
|
+
import ListSubheader from '@mui/material/ListSubheader';
|
|
4
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
5
|
+
import MenuList from '@mui/material/MenuList';
|
|
6
|
+
import ThumbnailsOffIcon from '@mui/icons-material/CropDinSharp';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import ThumbnailNavigationBottomIcon from './icons/ThumbnailNavigationBottomIcon';
|
|
10
|
+
import ThumbnailNavigationRightIcon from './icons/ThumbnailNavigationRightIcon';
|
|
11
|
+
|
|
12
|
+
const ThumbnailOption = styled(MenuItem, { name: 'WindowThumbnailSettings', slot: 'option' })(({ selected, theme }) => ({
|
|
13
|
+
'& .MuiFormControlLabel-label': {
|
|
14
|
+
borderBottom: '2px solid transparent',
|
|
15
|
+
...(selected && {
|
|
16
|
+
borderBottomColor: theme.palette.secondary.main,
|
|
17
|
+
}),
|
|
18
|
+
'&.Mui-selected': {
|
|
19
|
+
backgroundColor: 'transparent !important',
|
|
20
|
+
},
|
|
21
|
+
'&.Mui-selected.Mui-focusVisible': {
|
|
22
|
+
backgroundColor: `${(theme.vars || theme).palette.action.focus} !important`,
|
|
23
|
+
},
|
|
24
|
+
'&:focused': {
|
|
25
|
+
backgroundColor: `${(theme.vars || theme).palette.action.focus} !important`,
|
|
26
|
+
},
|
|
27
|
+
color: selected ? theme.palette.secondary.main : undefined,
|
|
28
|
+
display: 'inline-flex',
|
|
29
|
+
},
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
const StyledMenuList = styled(MenuList, { name: 'WindowViewSettings', slot: 'option' })(() => ({
|
|
33
|
+
display: 'inline-flex',
|
|
34
|
+
}));
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export function WindowThumbnailSettings({
|
|
39
|
+
handleClose = () => {},
|
|
40
|
+
thumbnailNavigationPosition,
|
|
41
|
+
direction,
|
|
42
|
+
windowId,
|
|
43
|
+
setWindowThumbnailPosition,
|
|
44
|
+
}) {
|
|
45
|
+
const { t } = useTranslation();
|
|
46
|
+
/** */
|
|
47
|
+
const handleChange = (value) => {
|
|
48
|
+
setWindowThumbnailPosition(windowId, value);
|
|
49
|
+
handleClose();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<ListSubheader role="presentation" disableSticky>
|
|
55
|
+
{t('thumbnails')}
|
|
56
|
+
</ListSubheader>
|
|
57
|
+
<StyledMenuList role="menubar">
|
|
58
|
+
<ThumbnailOption
|
|
59
|
+
aria-checked={thumbnailNavigationPosition === 'off'}
|
|
60
|
+
key="off"
|
|
61
|
+
onClick={() => {
|
|
62
|
+
handleChange('off');
|
|
63
|
+
}}
|
|
64
|
+
role="menuitemradio"
|
|
65
|
+
selected={thumbnailNavigationPosition === 'off'}
|
|
66
|
+
>
|
|
67
|
+
<FormControlLabel
|
|
68
|
+
control={
|
|
69
|
+
<ThumbnailsOffIcon color={thumbnailNavigationPosition === 'off' ? 'secondary' : undefined} fill="currentcolor" />
|
|
70
|
+
}
|
|
71
|
+
label={t('off')}
|
|
72
|
+
labelPlacement="bottom"
|
|
73
|
+
value="off"
|
|
74
|
+
/>
|
|
75
|
+
</ThumbnailOption>
|
|
76
|
+
<ThumbnailOption
|
|
77
|
+
aria-checked={thumbnailNavigationPosition === 'far-bottom'}
|
|
78
|
+
key="far-bottom"
|
|
79
|
+
onClick={() => {
|
|
80
|
+
handleChange('far-bottom');
|
|
81
|
+
}}
|
|
82
|
+
role="menuitemradio"
|
|
83
|
+
selected={thumbnailNavigationPosition === 'far-bottom'}
|
|
84
|
+
>
|
|
85
|
+
<FormControlLabel
|
|
86
|
+
control={
|
|
87
|
+
<ThumbnailNavigationBottomIcon
|
|
88
|
+
color={thumbnailNavigationPosition === 'far-bottom' ? 'secondary' : undefined}
|
|
89
|
+
fill="currentcolor"
|
|
90
|
+
/>
|
|
91
|
+
}
|
|
92
|
+
label={t('bottom')}
|
|
93
|
+
labelPlacement="bottom"
|
|
94
|
+
value="far-bottom"
|
|
95
|
+
/>
|
|
96
|
+
</ThumbnailOption>
|
|
97
|
+
<ThumbnailOption
|
|
98
|
+
aria-checked={thumbnailNavigationPosition === 'far-right'}
|
|
99
|
+
key="far-right"
|
|
100
|
+
onClick={() => {
|
|
101
|
+
handleChange('far-right');
|
|
102
|
+
}}
|
|
103
|
+
role="menuitemradio"
|
|
104
|
+
selected={thumbnailNavigationPosition === 'far-right'}
|
|
105
|
+
>
|
|
106
|
+
<FormControlLabel
|
|
107
|
+
control={
|
|
108
|
+
<ThumbnailNavigationRightIcon
|
|
109
|
+
color={thumbnailNavigationPosition === 'far-right' ? 'secondary' : undefined}
|
|
110
|
+
fill="currentcolor"
|
|
111
|
+
style={direction === 'rtl' ? { transform: 'rotate(180deg)' } : {}}
|
|
112
|
+
/>
|
|
113
|
+
}
|
|
114
|
+
label={t('right')}
|
|
115
|
+
labelPlacement="bottom"
|
|
116
|
+
value="far-right"
|
|
117
|
+
/>
|
|
118
|
+
</ThumbnailOption>
|
|
119
|
+
</StyledMenuList>
|
|
120
|
+
</>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
WindowThumbnailSettings.propTypes = {
|
|
125
|
+
direction: PropTypes.string.isRequired,
|
|
126
|
+
handleClose: PropTypes.func,
|
|
127
|
+
setWindowThumbnailPosition: PropTypes.func.isRequired,
|
|
128
|
+
thumbnailNavigationPosition: PropTypes.string.isRequired,
|
|
129
|
+
windowId: PropTypes.string.isRequired,
|
|
130
|
+
};
|