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,11 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
|
|
3
|
+
export const CompanionWindowSection = styled('div', {
|
|
4
|
+
name: 'CompanionWindowSection',
|
|
5
|
+
slot: 'root',
|
|
6
|
+
})(({ theme }) => ({
|
|
7
|
+
paddingBlockEnd: theme.spacing(1),
|
|
8
|
+
paddingBlockStart: theme.spacing(2),
|
|
9
|
+
paddingInlineEnd: theme.spacing(1),
|
|
10
|
+
paddingInlineStart: theme.spacing(2),
|
|
11
|
+
}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import CompanionWindow from '../containers/CompanionWindow';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* a custom panel that can be used for anything
|
|
7
|
+
*/
|
|
8
|
+
export function CustomPanel({ id, children = null, title, windowId }) {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
return (
|
|
11
|
+
<CompanionWindow title={t(title)} id={id} windowId={windowId}>
|
|
12
|
+
{children}
|
|
13
|
+
</CompanionWindow>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
CustomPanel.propTypes = {
|
|
18
|
+
children: PropTypes.node,
|
|
19
|
+
id: PropTypes.string.isRequired,
|
|
20
|
+
title: PropTypes.string.isRequired,
|
|
21
|
+
windowId: PropTypes.string.isRequired,
|
|
22
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import Accordion from '@mui/material/Accordion';
|
|
4
|
+
import AccordionSummary from '@mui/material/AccordionSummary';
|
|
5
|
+
import AccordionDetails from '@mui/material/AccordionDetails';
|
|
6
|
+
import Stack from '@mui/material/Stack';
|
|
7
|
+
import Alert from '@mui/material/Alert';
|
|
8
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { PluginHook } from './PluginHook';
|
|
11
|
+
|
|
12
|
+
const ErrorStackTrace = styled('pre', { name: 'ErrorContent', slot: 'stacktrace' })({
|
|
13
|
+
overflowY: 'scroll',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const ErrorMetadata = styled('pre', { name: 'ErrorContent', slot: 'metadata' })({
|
|
17
|
+
height: '100px',
|
|
18
|
+
overflowY: 'scroll',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const InlineAccordion = styled(Accordion, { name: 'ErrorContent', slot: 'accordion' })({
|
|
22
|
+
backgroundColor: 'inherit',
|
|
23
|
+
color: 'inherit',
|
|
24
|
+
margin: 0,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/** */
|
|
28
|
+
export function ErrorContent({ error, metadata = null, showJsError = true, ...rest }) {
|
|
29
|
+
const { t } = useTranslation();
|
|
30
|
+
if (!showJsError) return null;
|
|
31
|
+
|
|
32
|
+
const pluginProps = {
|
|
33
|
+
error,
|
|
34
|
+
metadata,
|
|
35
|
+
showJsError,
|
|
36
|
+
t,
|
|
37
|
+
...rest,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Alert elevation={6} variant="filled" severity="error">
|
|
42
|
+
{t('errorDialogTitle')}
|
|
43
|
+
{showJsError && (
|
|
44
|
+
<InlineAccordion elevation={2} square>
|
|
45
|
+
<AccordionSummary sx={{ marginInlineStart: '-1rem' }} expandIcon={<ExpandMoreIcon sx={{ color: '#fff' }} />}>
|
|
46
|
+
{t('jsError', { message: error.message, name: error.name })}
|
|
47
|
+
</AccordionSummary>
|
|
48
|
+
<AccordionDetails>
|
|
49
|
+
<Stack>
|
|
50
|
+
<ErrorStackTrace>{t('jsStack', { stack: error.stack })}</ErrorStackTrace>
|
|
51
|
+
{metadata && <ErrorMetadata>{JSON.stringify(metadata, null, 2)}</ErrorMetadata>}
|
|
52
|
+
</Stack>
|
|
53
|
+
</AccordionDetails>
|
|
54
|
+
</InlineAccordion>
|
|
55
|
+
)}
|
|
56
|
+
<PluginHook targetName="ErrorContent" {...pluginProps} />
|
|
57
|
+
</Alert>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ErrorContent.propTypes = {
|
|
62
|
+
error: PropTypes.object.isRequired,
|
|
63
|
+
metadata: PropTypes.object,
|
|
64
|
+
showJsError: PropTypes.bool,
|
|
65
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Dialog from '@mui/material/Dialog';
|
|
2
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
3
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { DialogActions, DialogContentText } from '@mui/material';
|
|
6
|
+
import Button from '@mui/material/Button';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import isUndefined from 'lodash/isUndefined';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*/
|
|
12
|
+
export function ErrorDialog({ error = null, removeError = () => {} }) {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const hasError = !isUndefined(error);
|
|
15
|
+
|
|
16
|
+
if (!error) return null;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Dialog aria-labelledby="error-dialog-title" id="error-dialog" onClose={() => removeError(error.id)} open={hasError}>
|
|
20
|
+
<DialogTitle id="error-dialog-title">{t('errorDialogTitle')}</DialogTitle>
|
|
21
|
+
<DialogContent>
|
|
22
|
+
<DialogContentText
|
|
23
|
+
variant="body2"
|
|
24
|
+
noWrap
|
|
25
|
+
sx={{
|
|
26
|
+
color: 'inherit',
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{`${error.message}`}
|
|
30
|
+
</DialogContentText>
|
|
31
|
+
<DialogActions>
|
|
32
|
+
<Button onClick={() => removeError(error.id)} variant="contained">
|
|
33
|
+
{t('errorDialogConfirm')}
|
|
34
|
+
</Button>
|
|
35
|
+
</DialogActions>
|
|
36
|
+
</DialogContent>
|
|
37
|
+
</Dialog>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
ErrorDialog.propTypes = {
|
|
42
|
+
error: PropTypes.shape({
|
|
43
|
+
id: PropTypes.string,
|
|
44
|
+
message: PropTypes.string,
|
|
45
|
+
}),
|
|
46
|
+
removeError: PropTypes.func,
|
|
47
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useContext, useEffect, useState } from 'react';
|
|
2
|
+
import FullscreenIcon from '@mui/icons-material/FullscreenSharp';
|
|
3
|
+
import FullscreenExitIcon from '@mui/icons-material/FullscreenExitSharp';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import MiradorMenuButton from '../containers/MiradorMenuButton';
|
|
7
|
+
import FullScreenContext from '../contexts/FullScreenContext';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*/
|
|
11
|
+
export function FullScreenButton({ className = undefined }) {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const handle = useContext(FullScreenContext);
|
|
14
|
+
|
|
15
|
+
// iPhone Safari does not support full screen on divs,
|
|
16
|
+
// Don't render the button if not supported
|
|
17
|
+
const [canFullscreenDiv, setCanFullscreenDiv] = useState(false);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const div = document.createElement('div');
|
|
21
|
+
setCanFullscreenDiv(typeof div.requestFullscreen === 'function');
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
if (!canFullscreenDiv) return null;
|
|
25
|
+
|
|
26
|
+
if (handle && handle.active) {
|
|
27
|
+
return (
|
|
28
|
+
<MiradorMenuButton className={className} aria-label={t('exitFullScreen')} onClick={handle.exit}>
|
|
29
|
+
<FullscreenExitIcon />
|
|
30
|
+
</MiradorMenuButton>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (handle) {
|
|
35
|
+
return (
|
|
36
|
+
<MiradorMenuButton className={className} aria-label={t('workspaceFullScreen')} onClick={handle.enter}>
|
|
37
|
+
<FullscreenIcon />
|
|
38
|
+
</MiradorMenuButton>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
FullScreenButton.propTypes = {
|
|
46
|
+
className: PropTypes.string,
|
|
47
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import Paper from '@mui/material/Paper';
|
|
4
|
+
import GalleryViewThumbnail from '../containers/GalleryViewThumbnail';
|
|
5
|
+
|
|
6
|
+
const Root = styled(Paper, { name: 'GalleryView', slot: 'root' })(({ theme }) => ({
|
|
7
|
+
alignItems: 'flex-start',
|
|
8
|
+
alignContent: 'flex-start',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
flexWrap: 'wrap',
|
|
12
|
+
overflowX: 'hidden',
|
|
13
|
+
overflowY: 'scroll',
|
|
14
|
+
padding: '50px 0 50px 20px',
|
|
15
|
+
width: '100%',
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Renders a GalleryView overview of the manifest.
|
|
20
|
+
*/
|
|
21
|
+
export function GalleryView({ canvases, viewingDirection = '', windowId }) {
|
|
22
|
+
const htmlDir = viewingDirection === 'right-to-left' ? 'rtl' : 'ltr';
|
|
23
|
+
return (
|
|
24
|
+
<Root component="section" aria-label="gallery section" dir={htmlDir} square elevation={0} id={`${windowId}-gallery`}>
|
|
25
|
+
{canvases.map((canvas) => (
|
|
26
|
+
<GalleryViewThumbnail key={canvas.id} windowId={windowId} canvas={canvas} />
|
|
27
|
+
))}
|
|
28
|
+
</Root>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
GalleryView.propTypes = {
|
|
33
|
+
canvases: PropTypes.array.isRequired,
|
|
34
|
+
viewingDirection: PropTypes.string,
|
|
35
|
+
windowId: PropTypes.string.isRequired,
|
|
36
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import Chip from '@mui/material/Chip';
|
|
5
|
+
import AnnotationIcon from '@mui/icons-material/CommentSharp';
|
|
6
|
+
import SearchIcon from '@mui/icons-material/SearchSharp';
|
|
7
|
+
import { InView } from 'react-intersection-observer';
|
|
8
|
+
import IIIFThumbnail from '../containers/IIIFThumbnail';
|
|
9
|
+
|
|
10
|
+
const Root = styled('div', { name: 'GalleryView', slot: 'thumbnail' })(({ ownerState, theme }) => ({
|
|
11
|
+
'&:focus': {
|
|
12
|
+
outline: 'none',
|
|
13
|
+
},
|
|
14
|
+
'&:hover': {
|
|
15
|
+
backgroundColor: theme.palette.action.hover,
|
|
16
|
+
},
|
|
17
|
+
border: '2px solid transparent',
|
|
18
|
+
...(ownerState.selected && {
|
|
19
|
+
borderColor: theme.palette.primary.main,
|
|
20
|
+
}),
|
|
21
|
+
...(!ownerState.selected &&
|
|
22
|
+
ownerState.searchAnnotationsCount > 0 && {
|
|
23
|
+
borderColor: theme.palette.action.selected,
|
|
24
|
+
}),
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
display: 'inline-block',
|
|
27
|
+
margin: theme.spacing(1, 0.5),
|
|
28
|
+
maxHeight: ownerState.config.height + 45,
|
|
29
|
+
minWidth: '60px',
|
|
30
|
+
overflow: 'hidden',
|
|
31
|
+
padding: theme.spacing(0.5),
|
|
32
|
+
position: 'relative',
|
|
33
|
+
width: 'min-content',
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
const StyledChipsContainer = styled('div', { name: 'GalleryView', slot: 'chipArea' })(({ theme }) => ({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flexDirection: 'column',
|
|
39
|
+
gap: theme.spacing(0.25),
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
right: 0,
|
|
42
|
+
top: 0,
|
|
43
|
+
}));
|
|
44
|
+
|
|
45
|
+
const AnnotationChip = styled(Chip, { name: 'GalleryView', slot: 'chip' })(({ theme }) => ({
|
|
46
|
+
backgroundColor: theme.palette.annotations.chipBackground,
|
|
47
|
+
opacity: 0.875,
|
|
48
|
+
textAlign: 'right',
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Represents a WindowViewer in the mirador workspace. Responsible for mounting
|
|
53
|
+
* OSD and Navigation
|
|
54
|
+
*/
|
|
55
|
+
export function GalleryViewThumbnail({
|
|
56
|
+
canvas,
|
|
57
|
+
selected = false,
|
|
58
|
+
setCanvas,
|
|
59
|
+
focusOnCanvas,
|
|
60
|
+
annotationsCount = undefined,
|
|
61
|
+
requestCanvasAnnotations = () => {},
|
|
62
|
+
searchAnnotationsCount = 0,
|
|
63
|
+
config = { height: 100, width: null },
|
|
64
|
+
}) {
|
|
65
|
+
const myRef = useRef();
|
|
66
|
+
const [requestedAnnotations, setRequestedAnnotations] = useState(false);
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (selected) {
|
|
70
|
+
myRef.current?.scrollIntoView({ block: 'nearest' });
|
|
71
|
+
}
|
|
72
|
+
}, [selected]);
|
|
73
|
+
|
|
74
|
+
/** @private */
|
|
75
|
+
const handleSelect = () => {
|
|
76
|
+
if (selected) {
|
|
77
|
+
focusOnCanvas();
|
|
78
|
+
} else {
|
|
79
|
+
setCanvas(canvas.id);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @private */
|
|
84
|
+
const handleKey = (event) => {
|
|
85
|
+
const keys = {
|
|
86
|
+
enter: 'Enter',
|
|
87
|
+
space: ' ',
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const chars = {
|
|
91
|
+
enter: 13,
|
|
92
|
+
space: 32,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const enterOrSpace =
|
|
96
|
+
event.key === keys.enter || event.which === chars.enter || event.key === keys.space || event.which === chars.space;
|
|
97
|
+
|
|
98
|
+
if (enterOrSpace) {
|
|
99
|
+
focusOnCanvas();
|
|
100
|
+
} else {
|
|
101
|
+
setCanvas(canvas.id);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** */
|
|
106
|
+
const handleIntersection = (_inView, { isIntersecting }) => {
|
|
107
|
+
if (!isIntersecting || annotationsCount === undefined || annotationsCount > 0 || requestedAnnotations) return;
|
|
108
|
+
|
|
109
|
+
setRequestedAnnotations(true);
|
|
110
|
+
requestCanvasAnnotations();
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const ownerState = {
|
|
114
|
+
annotationsCount,
|
|
115
|
+
canvas,
|
|
116
|
+
config,
|
|
117
|
+
searchAnnotationsCount,
|
|
118
|
+
selected,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<InView onChange={handleIntersection}>
|
|
123
|
+
<Root
|
|
124
|
+
ownerState={ownerState}
|
|
125
|
+
key={canvas.id || canvas.index}
|
|
126
|
+
className={selected ? 'selected' : ''}
|
|
127
|
+
onClick={handleSelect}
|
|
128
|
+
onKeyUp={handleKey}
|
|
129
|
+
ref={myRef}
|
|
130
|
+
role="button"
|
|
131
|
+
tabIndex={0}
|
|
132
|
+
>
|
|
133
|
+
<IIIFThumbnail resource={canvas} labelled variant="outside" maxHeight={config.height} maxWidth={config.width}>
|
|
134
|
+
<StyledChipsContainer>
|
|
135
|
+
{searchAnnotationsCount > 0 && (
|
|
136
|
+
<AnnotationChip icon={<SearchIcon fontSize="small" />} label={searchAnnotationsCount} size="small" />
|
|
137
|
+
)}
|
|
138
|
+
{annotationsCount > 0 && (
|
|
139
|
+
<AnnotationChip icon={<AnnotationIcon fontSize="small" />} label={annotationsCount} size="small" />
|
|
140
|
+
)}
|
|
141
|
+
</StyledChipsContainer>
|
|
142
|
+
</IIIFThumbnail>
|
|
143
|
+
</Root>
|
|
144
|
+
</InView>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
GalleryViewThumbnail.propTypes = {
|
|
149
|
+
annotationsCount: PropTypes.number,
|
|
150
|
+
canvas: PropTypes.object.isRequired,
|
|
151
|
+
config: PropTypes.shape({
|
|
152
|
+
height: PropTypes.number,
|
|
153
|
+
width: PropTypes.number,
|
|
154
|
+
}),
|
|
155
|
+
focusOnCanvas: PropTypes.func.isRequired,
|
|
156
|
+
requestCanvasAnnotations: PropTypes.func,
|
|
157
|
+
searchAnnotationsCount: PropTypes.number,
|
|
158
|
+
selected: PropTypes.bool,
|
|
159
|
+
setCanvas: PropTypes.func.isRequired,
|
|
160
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { AccessTokenSender } from './AccessTokenSender';
|
|
4
|
+
import { NewBrowserWindow } from './NewBrowserWindow';
|
|
5
|
+
import WindowAuthenticationBar from '../containers/WindowAuthenticationBar';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Opens a new window for click
|
|
9
|
+
*/
|
|
10
|
+
export function IIIFAuthentication({
|
|
11
|
+
accessTokenServiceId = undefined,
|
|
12
|
+
authServiceId = undefined,
|
|
13
|
+
confirm = undefined,
|
|
14
|
+
description = undefined,
|
|
15
|
+
failureDescription = undefined,
|
|
16
|
+
failureHeader = undefined,
|
|
17
|
+
features = 'centerscreen',
|
|
18
|
+
handleAuthInteraction,
|
|
19
|
+
header = undefined,
|
|
20
|
+
isInteractive = true,
|
|
21
|
+
label = undefined,
|
|
22
|
+
logoutConfirm = undefined,
|
|
23
|
+
logoutServiceId = undefined,
|
|
24
|
+
openWindow = window.open,
|
|
25
|
+
resetAuthenticationState,
|
|
26
|
+
resolveAccessTokenRequest,
|
|
27
|
+
resolveAuthenticationRequest,
|
|
28
|
+
status = null,
|
|
29
|
+
windowId,
|
|
30
|
+
}) {
|
|
31
|
+
const { t } = useTranslation();
|
|
32
|
+
|
|
33
|
+
/** */
|
|
34
|
+
const onReceiveAccessTokenMessage = (payload) => {
|
|
35
|
+
resolveAccessTokenRequest(authServiceId, accessTokenServiceId, payload);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** */
|
|
39
|
+
const defaultAuthBarProps = () => ({
|
|
40
|
+
authServiceId,
|
|
41
|
+
hasLogoutService: !!logoutServiceId,
|
|
42
|
+
status,
|
|
43
|
+
windowId,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/** handle the IIIF logout workflow */
|
|
47
|
+
const performLogout = () => {
|
|
48
|
+
openWindow(logoutServiceId, undefined, features);
|
|
49
|
+
|
|
50
|
+
resetAuthenticationState({ authServiceId, tokenServiceId: accessTokenServiceId });
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** Render the auth bar for logged in users */
|
|
54
|
+
const renderLoggedIn = () => {
|
|
55
|
+
if (!isInteractive && !logoutServiceId) return null;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<WindowAuthenticationBar
|
|
59
|
+
confirmButton={logoutConfirm || t('logout')}
|
|
60
|
+
onConfirm={performLogout}
|
|
61
|
+
{...defaultAuthBarProps()}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** Render whatever shows up after the interactive login attempt fails */
|
|
67
|
+
const renderFailure = () => (
|
|
68
|
+
<WindowAuthenticationBar
|
|
69
|
+
header={failureHeader}
|
|
70
|
+
description={failureDescription}
|
|
71
|
+
confirmButton={t('retry')}
|
|
72
|
+
onConfirm={() => handleAuthInteraction(windowId, authServiceId)}
|
|
73
|
+
{...defaultAuthBarProps()}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
/** Render the login bar after we're logging in */
|
|
78
|
+
const renderLoggingInCookie = () => (
|
|
79
|
+
<>
|
|
80
|
+
{renderLogin()}
|
|
81
|
+
<NewBrowserWindow
|
|
82
|
+
name="IiifLoginSender"
|
|
83
|
+
url={`${authServiceId}?origin=${window.origin}`}
|
|
84
|
+
features={features}
|
|
85
|
+
onClose={() => resolveAuthenticationRequest(authServiceId, accessTokenServiceId)}
|
|
86
|
+
/>
|
|
87
|
+
</>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
/** Render the login bar after we're logging in */
|
|
91
|
+
const renderLoggingInToken = () => (
|
|
92
|
+
<>
|
|
93
|
+
{renderLogin()}
|
|
94
|
+
<AccessTokenSender handleAccessTokenMessage={onReceiveAccessTokenMessage} url={accessTokenServiceId} />
|
|
95
|
+
</>
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
/** Render a login bar */
|
|
99
|
+
const renderLogin = () => {
|
|
100
|
+
if (!isInteractive) return null;
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<WindowAuthenticationBar
|
|
104
|
+
header={header}
|
|
105
|
+
description={description}
|
|
106
|
+
label={label}
|
|
107
|
+
confirmButton={confirm}
|
|
108
|
+
onConfirm={() => handleAuthInteraction(windowId, authServiceId)}
|
|
109
|
+
{...defaultAuthBarProps()}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
if (!authServiceId) return null;
|
|
115
|
+
if (status === null) return renderLogin();
|
|
116
|
+
if (status === 'cookie') return renderLoggingInCookie();
|
|
117
|
+
if (status === 'token') return renderLoggingInToken();
|
|
118
|
+
if (status === 'failed') return renderFailure();
|
|
119
|
+
if (status === 'ok') return renderLoggedIn();
|
|
120
|
+
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
IIIFAuthentication.propTypes = {
|
|
125
|
+
accessTokenServiceId: PropTypes.string,
|
|
126
|
+
authServiceId: PropTypes.string,
|
|
127
|
+
confirm: PropTypes.string,
|
|
128
|
+
description: PropTypes.string,
|
|
129
|
+
failureDescription: PropTypes.string,
|
|
130
|
+
failureHeader: PropTypes.string,
|
|
131
|
+
features: PropTypes.string,
|
|
132
|
+
handleAuthInteraction: PropTypes.func.isRequired,
|
|
133
|
+
header: PropTypes.string,
|
|
134
|
+
isInteractive: PropTypes.bool,
|
|
135
|
+
label: PropTypes.string,
|
|
136
|
+
logoutConfirm: PropTypes.string,
|
|
137
|
+
logoutServiceId: PropTypes.string,
|
|
138
|
+
openWindow: PropTypes.func,
|
|
139
|
+
resetAuthenticationState: PropTypes.func.isRequired,
|
|
140
|
+
resolveAccessTokenRequest: PropTypes.func.isRequired,
|
|
141
|
+
resolveAuthenticationRequest: PropTypes.func.isRequired,
|
|
142
|
+
status: PropTypes.oneOf(['logout', 'ok', 'token', 'cookie', 'failed', null]),
|
|
143
|
+
windowId: PropTypes.string.isRequired,
|
|
144
|
+
};
|