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,123 @@
|
|
|
1
|
+
import ActionTypes from './action-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Request annotations on a canvas
|
|
5
|
+
*
|
|
6
|
+
* NOTE: there is no corresponding reducer; the expected API is sagas will
|
|
7
|
+
* pick this action up and act on it accordingly.
|
|
8
|
+
*/
|
|
9
|
+
export function requestCanvasAnnotations(windowId, canvasId) {
|
|
10
|
+
return {
|
|
11
|
+
canvasId,
|
|
12
|
+
type: ActionTypes.REQUEST_CANVAS_ANNOTATIONS,
|
|
13
|
+
windowId,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* requestAnnotation - action creator
|
|
19
|
+
*
|
|
20
|
+
* @param {String} targetId
|
|
21
|
+
* @param {String} annotationId
|
|
22
|
+
* @memberof ActionCreators
|
|
23
|
+
*/
|
|
24
|
+
export function requestAnnotation(targetId, annotationId) {
|
|
25
|
+
return {
|
|
26
|
+
annotationId,
|
|
27
|
+
targetId,
|
|
28
|
+
type: ActionTypes.REQUEST_ANNOTATION,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* receiveAnnotation - action creator
|
|
34
|
+
*
|
|
35
|
+
* @param {String} targetId
|
|
36
|
+
* @param {String} annotationId
|
|
37
|
+
* @param {Object} annotationJson
|
|
38
|
+
* @memberof ActionCreators
|
|
39
|
+
*/
|
|
40
|
+
export function receiveAnnotation(targetId, annotationId, annotationJson) {
|
|
41
|
+
return {
|
|
42
|
+
annotationId,
|
|
43
|
+
annotationJson,
|
|
44
|
+
targetId,
|
|
45
|
+
type: ActionTypes.RECEIVE_ANNOTATION,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* receiveAnnotationFailure - action creator
|
|
51
|
+
*
|
|
52
|
+
* @param {String} targetId
|
|
53
|
+
* @param {String} annotationId
|
|
54
|
+
* @param {String} error
|
|
55
|
+
* @memberof ActionCreators
|
|
56
|
+
*/
|
|
57
|
+
export function receiveAnnotationFailure(targetId, annotationId, error) {
|
|
58
|
+
return {
|
|
59
|
+
annotationId,
|
|
60
|
+
error,
|
|
61
|
+
targetId,
|
|
62
|
+
type: ActionTypes.RECEIVE_ANNOTATION_FAILURE,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* selectAnnotation - action creator
|
|
68
|
+
*
|
|
69
|
+
* @param {String} windowId
|
|
70
|
+
* @param {String} targetId
|
|
71
|
+
* @param {String} annotationId
|
|
72
|
+
* @memberof ActionCreators
|
|
73
|
+
*/
|
|
74
|
+
export function selectAnnotation(windowId, annotationId) {
|
|
75
|
+
return {
|
|
76
|
+
annotationId,
|
|
77
|
+
type: ActionTypes.SELECT_ANNOTATION,
|
|
78
|
+
windowId,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* deselectAnnotation - action creator
|
|
84
|
+
*
|
|
85
|
+
* @param {String} windowId
|
|
86
|
+
* @param {String} targetId
|
|
87
|
+
* @param {String} annotationId
|
|
88
|
+
* @memberof ActionCreators
|
|
89
|
+
*/
|
|
90
|
+
export function deselectAnnotation(windowId, annotationId) {
|
|
91
|
+
return {
|
|
92
|
+
annotationId,
|
|
93
|
+
type: ActionTypes.DESELECT_ANNOTATION,
|
|
94
|
+
windowId,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* toggleAnnotationDisplay - action creator
|
|
100
|
+
*
|
|
101
|
+
* @param {String} windowId
|
|
102
|
+
* @memberof ActionCreators
|
|
103
|
+
*/
|
|
104
|
+
export function toggleAnnotationDisplay(windowId) {
|
|
105
|
+
return {
|
|
106
|
+
type: ActionTypes.TOGGLE_ANNOTATION_DISPLAY,
|
|
107
|
+
windowId,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* toggleAnnotationDisplay - action creator
|
|
113
|
+
*
|
|
114
|
+
* @param {String} windowId
|
|
115
|
+
* @memberof ActionCreators
|
|
116
|
+
*/
|
|
117
|
+
export function hoverAnnotation(windowId, annotationIds) {
|
|
118
|
+
return {
|
|
119
|
+
annotationIds,
|
|
120
|
+
type: ActionTypes.HOVER_ANNOTATION,
|
|
121
|
+
windowId,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import ActionTypes from './action-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* addAuthenticationRequest - action creator
|
|
5
|
+
*
|
|
6
|
+
* @param {String} windowId
|
|
7
|
+
* @param {String} id
|
|
8
|
+
* @memberof ActionCreators
|
|
9
|
+
*/
|
|
10
|
+
export function addAuthenticationRequest(windowId, id, profile = undefined) {
|
|
11
|
+
return {
|
|
12
|
+
id,
|
|
13
|
+
profile,
|
|
14
|
+
type: ActionTypes.ADD_AUTHENTICATION_REQUEST,
|
|
15
|
+
windowId,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* resolveAuthenticationRequest - action creator
|
|
21
|
+
* Triggered when we might have an IIIF auth cookie available (but we
|
|
22
|
+
* can't be really sure until try the access token)
|
|
23
|
+
*
|
|
24
|
+
* @param {String} id
|
|
25
|
+
* @memberof ActionCreators
|
|
26
|
+
*/
|
|
27
|
+
export function resolveAuthenticationRequest(id, tokenServiceId, props) {
|
|
28
|
+
return {
|
|
29
|
+
id,
|
|
30
|
+
tokenServiceId,
|
|
31
|
+
type: ActionTypes.RESOLVE_AUTHENTICATION_REQUEST,
|
|
32
|
+
...props,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* requestAccessToken - action creator
|
|
38
|
+
* @private
|
|
39
|
+
*
|
|
40
|
+
* @param {String} serviceId
|
|
41
|
+
* @param {String} authId
|
|
42
|
+
* @memberof ActionCreators
|
|
43
|
+
*/
|
|
44
|
+
export function requestAccessToken(serviceId, authId) {
|
|
45
|
+
return {
|
|
46
|
+
authId,
|
|
47
|
+
serviceId,
|
|
48
|
+
type: ActionTypes.REQUEST_ACCESS_TOKEN,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* receiveAccessToken - action creator
|
|
54
|
+
* @private
|
|
55
|
+
*
|
|
56
|
+
* @param {String} serviceId
|
|
57
|
+
* @param {Object} json
|
|
58
|
+
* @memberof ActionCreators
|
|
59
|
+
*/
|
|
60
|
+
export function receiveAccessToken(authId, serviceId, json) {
|
|
61
|
+
return {
|
|
62
|
+
authId,
|
|
63
|
+
json,
|
|
64
|
+
serviceId,
|
|
65
|
+
type: ActionTypes.RECEIVE_ACCESS_TOKEN,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* receiveAccessTokenFailure - action creator
|
|
71
|
+
* @private
|
|
72
|
+
*
|
|
73
|
+
* @param {String} serviceId
|
|
74
|
+
* @param {Object} error
|
|
75
|
+
* @memberof ActionCreators
|
|
76
|
+
*/
|
|
77
|
+
export function receiveAccessTokenFailure(authId, serviceId, error) {
|
|
78
|
+
return {
|
|
79
|
+
authId,
|
|
80
|
+
error,
|
|
81
|
+
serviceId,
|
|
82
|
+
type: ActionTypes.RECEIVE_ACCESS_TOKEN_FAILURE,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* resolveAccessTokenRequest - action creator
|
|
88
|
+
*
|
|
89
|
+
* @param {String} authServiceId
|
|
90
|
+
* @param {String} tokenServiceId
|
|
91
|
+
* @param {Object} json
|
|
92
|
+
* @memberof ActionCreators
|
|
93
|
+
*/
|
|
94
|
+
export function resolveAccessTokenRequest(authServiceId, tokenServiceId, json) {
|
|
95
|
+
if (!json.accessToken) return receiveAccessTokenFailure(authServiceId, tokenServiceId, json);
|
|
96
|
+
|
|
97
|
+
return receiveAccessToken(authServiceId, tokenServiceId, json);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Resets authentication state for a token service
|
|
102
|
+
*/
|
|
103
|
+
export function resetAuthenticationState({ authServiceId, tokenServiceId }) {
|
|
104
|
+
return {
|
|
105
|
+
id: authServiceId,
|
|
106
|
+
tokenServiceId,
|
|
107
|
+
type: ActionTypes.RESET_AUTHENTICATION_STATE,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import ActionTypes from './action-types';
|
|
2
|
+
import { getNextCanvasGrouping, getPreviousCanvasGrouping, getCanvasGrouping, getConfig } from '../selectors';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* setCanvas - action creator
|
|
6
|
+
*
|
|
7
|
+
* @param {String} windowId
|
|
8
|
+
* @param {String} canvasId
|
|
9
|
+
* @memberof ActionCreators
|
|
10
|
+
*/
|
|
11
|
+
export function setCanvas(windowId, canvasId, newGroup = undefined, options = {}) {
|
|
12
|
+
return (dispatch, getState) => {
|
|
13
|
+
const state = getState();
|
|
14
|
+
const { preserveViewport } = getConfig(state).osdConfig;
|
|
15
|
+
let visibleCanvases = newGroup;
|
|
16
|
+
|
|
17
|
+
if (!visibleCanvases) {
|
|
18
|
+
const group = getCanvasGrouping(state, { canvasId, windowId });
|
|
19
|
+
visibleCanvases = (group || []).map((c) => c.id);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
dispatch({
|
|
23
|
+
canvasId,
|
|
24
|
+
preserveViewport: options?.preserveViewport ?? preserveViewport,
|
|
25
|
+
type: ActionTypes.SET_CANVAS,
|
|
26
|
+
visibleCanvases,
|
|
27
|
+
windowId,
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Set the window's canvas to the next canvas grouping */
|
|
33
|
+
export function setNextCanvas(windowId) {
|
|
34
|
+
return (dispatch, getState) => {
|
|
35
|
+
const state = getState();
|
|
36
|
+
const newGroup = getNextCanvasGrouping(state, { windowId });
|
|
37
|
+
const ids = (newGroup || []).map((c) => c.id);
|
|
38
|
+
newGroup && dispatch(setCanvas(windowId, ids[0], ids));
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Set the window's canvas to the previous canvas grouping */
|
|
43
|
+
export function setPreviousCanvas(windowId) {
|
|
44
|
+
return (dispatch, getState) => {
|
|
45
|
+
const state = getState();
|
|
46
|
+
|
|
47
|
+
const newGroup = getPreviousCanvasGrouping(state, { windowId });
|
|
48
|
+
const ids = (newGroup || []).map((c) => c.id);
|
|
49
|
+
newGroup && dispatch(setCanvas(windowId, ids[0], ids));
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param windowId
|
|
56
|
+
* @param payload
|
|
57
|
+
* @returns {{payload: *, type: string, windowId: *}}
|
|
58
|
+
*/
|
|
59
|
+
export function updateViewport(windowId, payload) {
|
|
60
|
+
return {
|
|
61
|
+
payload,
|
|
62
|
+
type: ActionTypes.UPDATE_VIEWPORT,
|
|
63
|
+
windowId,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import ActionTypes from './action-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* add a manifest to the resource catalog
|
|
5
|
+
* @param {string} manifestId
|
|
6
|
+
*/
|
|
7
|
+
export function addResource(manifestId, manifestJson = undefined, payload) {
|
|
8
|
+
return {
|
|
9
|
+
manifestId,
|
|
10
|
+
manifestJson,
|
|
11
|
+
payload,
|
|
12
|
+
type: ActionTypes.ADD_RESOURCE,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** remove a manifest from the resource catalog */
|
|
17
|
+
export function removeResource(manifestId) {
|
|
18
|
+
return {
|
|
19
|
+
manifestId,
|
|
20
|
+
type: ActionTypes.REMOVE_RESOURCE,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
|
+
import ActionTypes from './action-types';
|
|
3
|
+
import { getCompanionWindowIdsForPosition, getManuallyExpandedNodeIds, getVisibleNodeIds } from '../selectors';
|
|
4
|
+
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
content: null,
|
|
7
|
+
position: null,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/** */
|
|
11
|
+
export function addCompanionWindow(windowId, payload, defaults = defaultProps) {
|
|
12
|
+
const id = `cw-${uuid()}`;
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
id,
|
|
16
|
+
payload: {
|
|
17
|
+
...defaults,
|
|
18
|
+
...payload,
|
|
19
|
+
id,
|
|
20
|
+
windowId,
|
|
21
|
+
},
|
|
22
|
+
type: ActionTypes.ADD_COMPANION_WINDOW,
|
|
23
|
+
windowId,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** */
|
|
28
|
+
export function addOrUpdateCompanionWindow(windowId, payload, defaults = defaultProps) {
|
|
29
|
+
return (dispatch, getState) => {
|
|
30
|
+
const state = getState();
|
|
31
|
+
const { position } = payload;
|
|
32
|
+
|
|
33
|
+
const updatableWindowId = position === 'left' && getCompanionWindowIdsForPosition(state, { position, windowId })[0];
|
|
34
|
+
|
|
35
|
+
if (updatableWindowId) {
|
|
36
|
+
dispatch(updateCompanionWindow(windowId, updatableWindowId, payload));
|
|
37
|
+
} else {
|
|
38
|
+
dispatch(addCompanionWindow(windowId, payload, defaults));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** */
|
|
44
|
+
export function updateCompanionWindow(windowId, id, payload) {
|
|
45
|
+
return {
|
|
46
|
+
id,
|
|
47
|
+
payload,
|
|
48
|
+
type: ActionTypes.UPDATE_COMPANION_WINDOW,
|
|
49
|
+
windowId,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** */
|
|
54
|
+
export function removeCompanionWindow(windowId, id) {
|
|
55
|
+
return {
|
|
56
|
+
id,
|
|
57
|
+
type: ActionTypes.REMOVE_COMPANION_WINDOW,
|
|
58
|
+
windowId,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** */
|
|
63
|
+
export function toggleNode(windowId, id, nodeId) {
|
|
64
|
+
return (dispatch, getState) => {
|
|
65
|
+
const state = getState();
|
|
66
|
+
const collapsedNodeIds = getManuallyExpandedNodeIds(state, { companionWindowId: id }, false);
|
|
67
|
+
const expandedNodeIds = getManuallyExpandedNodeIds(state, { companionWindowId: id }, true);
|
|
68
|
+
const visibleNodeIds = getVisibleNodeIds(state, { id, windowId });
|
|
69
|
+
const expand =
|
|
70
|
+
collapsedNodeIds.indexOf(nodeId) !== -1 ||
|
|
71
|
+
(expandedNodeIds.indexOf(nodeId) === -1 && visibleNodeIds.indexOf(nodeId) === -1);
|
|
72
|
+
return dispatch({
|
|
73
|
+
id,
|
|
74
|
+
payload: {
|
|
75
|
+
[nodeId]: {
|
|
76
|
+
expanded: expand,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
type: ActionTypes.TOGGLE_TOC_NODE,
|
|
80
|
+
windowId,
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Update the expanded nodes state */
|
|
86
|
+
export function expandNodes(windowId, id, nodeIds) {
|
|
87
|
+
return (dispatch, getState) => {
|
|
88
|
+
const state = getState();
|
|
89
|
+
const expandedNodeIds = getManuallyExpandedNodeIds(state, { companionWindowId: id }, true);
|
|
90
|
+
const payload = {};
|
|
91
|
+
|
|
92
|
+
expandedNodeIds.forEach((nodeId) => {
|
|
93
|
+
payload[nodeId] = { expanded: false };
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
nodeIds.forEach((nodeId) => {
|
|
97
|
+
payload[nodeId] = { expanded: true };
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
return dispatch({
|
|
101
|
+
id,
|
|
102
|
+
payload,
|
|
103
|
+
type: ActionTypes.TOGGLE_TOC_NODE,
|
|
104
|
+
windowId,
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
|
+
import ActionTypes from './action-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* importConfig - action creator
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} config
|
|
8
|
+
* @memberof ActionCreators
|
|
9
|
+
*/
|
|
10
|
+
export function importConfig(config) {
|
|
11
|
+
return { config, type: ActionTypes.IMPORT_CONFIG };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* setConfig - action creator
|
|
16
|
+
*
|
|
17
|
+
* @param {Object} config
|
|
18
|
+
* @memberof ActionCreators
|
|
19
|
+
*/
|
|
20
|
+
export function setConfig(config) {
|
|
21
|
+
return { config, type: ActionTypes.SET_CONFIG };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* updateConfig - action creator
|
|
26
|
+
*
|
|
27
|
+
* @param {Object} config
|
|
28
|
+
* @memberof ActionCreators
|
|
29
|
+
*/
|
|
30
|
+
export function updateConfig(config) {
|
|
31
|
+
return { config, type: ActionTypes.UPDATE_CONFIG };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* importMiradorState - action creator
|
|
36
|
+
*
|
|
37
|
+
* @param {Object} config
|
|
38
|
+
* @memberof ActionCreators
|
|
39
|
+
*/
|
|
40
|
+
export function importMiradorState(state) {
|
|
41
|
+
const newState = {
|
|
42
|
+
...state,
|
|
43
|
+
workspace: {
|
|
44
|
+
...state.workspace,
|
|
45
|
+
id: uuid(),
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
return { state: newState, type: ActionTypes.IMPORT_MIRADOR_STATE };
|
|
49
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
|
+
import ActionTypes from './action-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* addError - action creator
|
|
6
|
+
* @param {string} error
|
|
7
|
+
*/
|
|
8
|
+
export function addError(error) {
|
|
9
|
+
return {
|
|
10
|
+
id: `error-${uuid()}`,
|
|
11
|
+
message: error,
|
|
12
|
+
type: ActionTypes.ADD_ERROR,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* removeError - action creator
|
|
18
|
+
* @param {string} id
|
|
19
|
+
*/
|
|
20
|
+
export function removeError(id) {
|
|
21
|
+
return { id, type: ActionTypes.REMOVE_ERROR };
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action Creators for Mirador
|
|
3
|
+
* @namespace ActionCreators
|
|
4
|
+
*/
|
|
5
|
+
export * from './companionWindow';
|
|
6
|
+
export * from './config';
|
|
7
|
+
export * from './errors';
|
|
8
|
+
export * from './window';
|
|
9
|
+
export * from './manifest';
|
|
10
|
+
export * from './infoResponse';
|
|
11
|
+
export * from './canvas';
|
|
12
|
+
export * from './workspace';
|
|
13
|
+
export * from './annotation';
|
|
14
|
+
export * from './auth';
|
|
15
|
+
export * from './elasticLayout';
|
|
16
|
+
export * from './search';
|
|
17
|
+
export * from './layers';
|
|
18
|
+
export * from './catalog';
|
|
19
|
+
export { default as ActionTypes } from './action-types';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { getIiifResourceImageService } from '../../lib/iiif';
|
|
2
|
+
import ActionTypes from './action-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* requestInfoResponse - action creator
|
|
6
|
+
*
|
|
7
|
+
* @param {String} infoId
|
|
8
|
+
* @memberof ActionCreators
|
|
9
|
+
*/
|
|
10
|
+
export function requestInfoResponse(infoId, imageResource, windowId) {
|
|
11
|
+
return {
|
|
12
|
+
imageResource,
|
|
13
|
+
infoId,
|
|
14
|
+
type: ActionTypes.REQUEST_INFO_RESPONSE,
|
|
15
|
+
windowId,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* receiveInfoResponse - action creator
|
|
21
|
+
*
|
|
22
|
+
* @param {String} infoId
|
|
23
|
+
* @param {Object} manifestJson
|
|
24
|
+
* @memberof ActionCreators
|
|
25
|
+
*/
|
|
26
|
+
export function receiveInfoResponse(infoId, infoJson, ok, tokenServiceId) {
|
|
27
|
+
return {
|
|
28
|
+
infoId,
|
|
29
|
+
infoJson,
|
|
30
|
+
ok,
|
|
31
|
+
tokenServiceId,
|
|
32
|
+
type: ActionTypes.RECEIVE_INFO_RESPONSE,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* receiveDegradedInfoResponse - action creator
|
|
38
|
+
*
|
|
39
|
+
* @param {String} infoId
|
|
40
|
+
* @param {Object} manifestJson
|
|
41
|
+
* @memberof ActionCreators
|
|
42
|
+
*/
|
|
43
|
+
export function receiveDegradedInfoResponse(infoId, infoJson, ok, tokenServiceId, windowId) {
|
|
44
|
+
return {
|
|
45
|
+
infoId,
|
|
46
|
+
infoJson,
|
|
47
|
+
ok,
|
|
48
|
+
tokenServiceId,
|
|
49
|
+
type: ActionTypes.RECEIVE_DEGRADED_INFO_RESPONSE,
|
|
50
|
+
windowId,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* receiveInfoResponseFailure - action creator
|
|
56
|
+
*
|
|
57
|
+
* @param {String} infoId
|
|
58
|
+
* @param {String} error
|
|
59
|
+
* @memberof ActionCreators
|
|
60
|
+
*/
|
|
61
|
+
export function receiveInfoResponseFailure(infoId, error, tokenServiceId) {
|
|
62
|
+
return {
|
|
63
|
+
error,
|
|
64
|
+
infoId,
|
|
65
|
+
tokenServiceId,
|
|
66
|
+
type: ActionTypes.RECEIVE_INFO_RESPONSE_FAILURE,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* fetchInfoResponse - action creator
|
|
72
|
+
*
|
|
73
|
+
* @param {String} infoId
|
|
74
|
+
* @memberof ActionCreators
|
|
75
|
+
*/
|
|
76
|
+
export function fetchInfoResponse({ imageId, imageResource, windowId }) {
|
|
77
|
+
const imageService = imageResource && getIiifResourceImageService(imageResource);
|
|
78
|
+
const infoId = imageId || imageService.id;
|
|
79
|
+
return requestInfoResponse(infoId, imageService, windowId);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* removeInfoResponse - action creator
|
|
84
|
+
*
|
|
85
|
+
* @param {String} infoId
|
|
86
|
+
* @memberof ActionCreators
|
|
87
|
+
*/
|
|
88
|
+
export function removeInfoResponse(infoId) {
|
|
89
|
+
return { infoId, type: ActionTypes.REMOVE_INFO_RESPONSE };
|
|
90
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ActionTypes from './action-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* updateLayers - action creator
|
|
5
|
+
* @param {string} id
|
|
6
|
+
*/
|
|
7
|
+
export function updateLayers(windowId, canvasId, payload) {
|
|
8
|
+
return {
|
|
9
|
+
canvasId,
|
|
10
|
+
payload,
|
|
11
|
+
type: ActionTypes.UPDATE_LAYERS,
|
|
12
|
+
windowId,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import ActionTypes from './action-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* requestManifest - action creator
|
|
5
|
+
*
|
|
6
|
+
* @param {String} manifestId
|
|
7
|
+
* @memberof ActionCreators
|
|
8
|
+
*/
|
|
9
|
+
export function requestManifest(manifestId, properties) {
|
|
10
|
+
return {
|
|
11
|
+
manifestId,
|
|
12
|
+
properties,
|
|
13
|
+
type: ActionTypes.REQUEST_MANIFEST,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* receiveManifest - action creator
|
|
19
|
+
*
|
|
20
|
+
* @param {String} manifestId
|
|
21
|
+
* @param {Object} manifestJson
|
|
22
|
+
* @memberof ActionCreators
|
|
23
|
+
*/
|
|
24
|
+
export function receiveManifest(manifestId, manifestJson) {
|
|
25
|
+
return {
|
|
26
|
+
manifestId,
|
|
27
|
+
manifestJson,
|
|
28
|
+
type: ActionTypes.RECEIVE_MANIFEST,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* receiveManifestFailure - action creator
|
|
34
|
+
*
|
|
35
|
+
* @param {String} windowId
|
|
36
|
+
* @param {String} error
|
|
37
|
+
* @memberof ActionCreators
|
|
38
|
+
*/
|
|
39
|
+
export function receiveManifestFailure(manifestId, error) {
|
|
40
|
+
return {
|
|
41
|
+
error,
|
|
42
|
+
manifestId,
|
|
43
|
+
type: ActionTypes.RECEIVE_MANIFEST_FAILURE,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* fetchManifest - action creator
|
|
49
|
+
*
|
|
50
|
+
* @param {String} manifestId
|
|
51
|
+
* @memberof ActionCreators
|
|
52
|
+
*/
|
|
53
|
+
export function fetchManifest(manifestId, properties) {
|
|
54
|
+
return requestManifest(manifestId, { ...properties, isFetching: true });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* removeManifest - action creator
|
|
59
|
+
*
|
|
60
|
+
* @param {String} manifestId
|
|
61
|
+
* @memberof ActionCreators
|
|
62
|
+
*/
|
|
63
|
+
export function removeManifest(manifestId) {
|
|
64
|
+
return { manifestId, type: ActionTypes.REMOVE_MANIFEST };
|
|
65
|
+
}
|