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,20 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { getManifestLogo, getRequiredStatement, getRights } from '../state/selectors';
|
|
4
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
5
|
+
import { AttributionPanel } from '../components/AttributionPanel';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* mapStateToProps - to hook up connect
|
|
9
|
+
* @memberof WindowSideBarInfoPanel
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
const mapStateToProps = (state, { id, windowId }) => ({
|
|
13
|
+
manifestLogo: getManifestLogo(state, { windowId }),
|
|
14
|
+
requiredStatement: getRequiredStatement(state, { windowId }),
|
|
15
|
+
rights: getRights(state, { windowId }),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const enhance = compose(connect(mapStateToProps), withPlugins('AttributionPanel'));
|
|
19
|
+
|
|
20
|
+
export default enhance(AttributionPanel);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { connect } from 'react-redux';
|
|
2
|
+
import { compose } from 'redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { AudioViewer } from '../components/AudioViewer';
|
|
5
|
+
import { getConfig, getVisibleCanvasAudioResources, getVisibleCanvasCaptions } from '../state/selectors';
|
|
6
|
+
|
|
7
|
+
/** */
|
|
8
|
+
const mapStateToProps = (state, { windowId }) => ({
|
|
9
|
+
audioOptions: getConfig(state).audioOptions,
|
|
10
|
+
audioResources: getVisibleCanvasAudioResources(state, { windowId }) || [],
|
|
11
|
+
captions: getVisibleCanvasCaptions(state, { windowId }) || [],
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const enhance = compose(connect(mapStateToProps, null), withPlugins('AudioViewer'));
|
|
15
|
+
|
|
16
|
+
export default enhance(AudioViewer);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import * as actions from '../state/actions';
|
|
5
|
+
import { getAnnotationResourcesDataForCanvas, getCanvasLabel, getSelectedAnnotationId, getConfig } from '../state/selectors';
|
|
6
|
+
import { CanvasAnnotations } from '../components/CanvasAnnotations';
|
|
7
|
+
|
|
8
|
+
/** For connect */
|
|
9
|
+
const mapStateToProps = (state, { canvasId, windowId }) => ({
|
|
10
|
+
annotations: getAnnotationResourcesDataForCanvas(state, { canvasId, windowId }),
|
|
11
|
+
htmlSanitizationRuleSet: getConfig(state).annotations.htmlSanitizationRuleSet,
|
|
12
|
+
label: getCanvasLabel(state, {
|
|
13
|
+
canvasId,
|
|
14
|
+
windowId,
|
|
15
|
+
}),
|
|
16
|
+
selectedAnnotationId: getSelectedAnnotationId(state, { windowId }),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* mapDispatchToProps - to hook up connect
|
|
21
|
+
* @memberof WindowSideBarAnnotationsPanel
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
const mapDispatchToProps = {
|
|
25
|
+
deselectAnnotation: actions.deselectAnnotation,
|
|
26
|
+
hoverAnnotation: actions.hoverAnnotation,
|
|
27
|
+
selectAnnotation: actions.selectAnnotation,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('CanvasAnnotations'));
|
|
31
|
+
|
|
32
|
+
export default enhance(CanvasAnnotations);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { getCanvasMetadata, getCanvasLabel, getCanvasDescription } from '../state/selectors';
|
|
5
|
+
import { CanvasInfo } from '../components/CanvasInfo';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* mapStateToProps - to hook up connect
|
|
9
|
+
* @memberof WindowSideBarInfoPanel
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
const mapStateToProps = (state, { canvasId, companionWindowId, windowId }) => ({
|
|
13
|
+
canvasDescription: getCanvasDescription(state, { canvasId, companionWindowId, windowId }),
|
|
14
|
+
canvasLabel: getCanvasLabel(state, { canvasId, companionWindowId, windowId }),
|
|
15
|
+
canvasMetadata: getCanvasMetadata(state, { canvasId, companionWindowId, windowId }),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const enhance = compose(connect(mapStateToProps), withPlugins('CanvasInfo'));
|
|
19
|
+
|
|
20
|
+
export default enhance(CanvasInfo);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import * as actions from '../state/actions';
|
|
4
|
+
import { getCanvasLabel, getLayers, getSortedLayers } from '../state/selectors';
|
|
5
|
+
import { CanvasLayers } from '../components/CanvasLayers';
|
|
6
|
+
|
|
7
|
+
/** For connect */
|
|
8
|
+
const mapStateToProps = (state, { canvasId, companionWindowId, windowId }) => ({
|
|
9
|
+
label: getCanvasLabel(state, { canvasId, companionWindowId, windowId }),
|
|
10
|
+
layerMetadata: getLayers(state, { canvasId, companionWindowId, windowId }),
|
|
11
|
+
layers: getSortedLayers(state, { canvasId, companionWindowId, windowId }),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* mapDispatchToProps - to hook up connect
|
|
16
|
+
* @memberof WindowSideBarAnnotationsPanel
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
const mapDispatchToProps = {
|
|
20
|
+
updateLayers: actions.updateLayers,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps));
|
|
24
|
+
|
|
25
|
+
export default enhance(CanvasLayers);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import * as actions from '../state/actions';
|
|
5
|
+
import { getThemeIds, getConfig } from '../state/selectors';
|
|
6
|
+
import { ChangeThemeDialog } from '../components/ChangeThemeDialog';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* mapDispatchToProps - used to hook up connect to action creators
|
|
10
|
+
* @memberof ChangeThemeDialog
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
const mapDispatchToProps = (dispatch, { windowId }) => ({
|
|
14
|
+
setSelectedTheme: (theme) => dispatch(actions.updateConfig({ selectedTheme: theme })),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* mapStateToProps - to hook up connect
|
|
19
|
+
* @memberof ChangeThemeDialog
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
const mapStateToProps = (state) => ({
|
|
23
|
+
selectedTheme: getConfig(state).selectedTheme,
|
|
24
|
+
themeIds: getThemeIds(state),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('ChangeThemeDialog'));
|
|
28
|
+
|
|
29
|
+
export default enhance(ChangeThemeDialog);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import * as actions from '../state/actions';
|
|
5
|
+
import { getManifest, getManifestoInstance, getSequenceBehaviors, getWindow } from '../state/selectors';
|
|
6
|
+
import { CollectionDialog } from '../components/CollectionDialog';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* mapDispatchToProps - used to hook up connect to action creators
|
|
10
|
+
* @memberof CollectionDialog
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
const mapDispatchToProps = {
|
|
14
|
+
addWindow: actions.addWindow,
|
|
15
|
+
hideCollectionDialog: actions.hideCollectionDialog,
|
|
16
|
+
setWorkspaceAddVisibility: actions.setWorkspaceAddVisibility,
|
|
17
|
+
showCollectionDialog: actions.showCollectionDialog,
|
|
18
|
+
updateWindow: actions.updateWindow,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* mapStateToProps - to hook up connect
|
|
23
|
+
* @memberof CollectionDialog
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
const mapStateToProps = (state, { windowId }) => {
|
|
27
|
+
const { collectionManifestId: manifestId, dialogCollectionPath } = getWindow(state, { windowId });
|
|
28
|
+
const manifest = getManifest(state, { manifestId });
|
|
29
|
+
|
|
30
|
+
const collectionId = dialogCollectionPath && dialogCollectionPath[dialogCollectionPath.length - 1];
|
|
31
|
+
const collection = collectionId && getManifest(state, { manifestId: collectionId });
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
collection: collection && getManifestoInstance(state, { manifestId: collection.id }),
|
|
35
|
+
dialogCollectionPath,
|
|
36
|
+
error: manifest && manifest.error,
|
|
37
|
+
isMultipart: getSequenceBehaviors(state, { manifestId }).includes('multi-part'),
|
|
38
|
+
manifest: manifest && getManifestoInstance(state, { manifestId }),
|
|
39
|
+
manifestId,
|
|
40
|
+
open: state.workspace.collectionDialogOn,
|
|
41
|
+
ready: manifest && !!manifest.json,
|
|
42
|
+
windowId,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('CollectionDialog'));
|
|
47
|
+
|
|
48
|
+
export default enhance(CollectionDialog);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { getManifestTitle, getWindow } from '../state/selectors';
|
|
5
|
+
import * as actions from '../state/actions';
|
|
6
|
+
import { CollectionInfo } from '../components/CollectionInfo';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* mapStateToProps - to hook up connect
|
|
10
|
+
* @memberof WindowSideBarInfoPanel
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
const mapStateToProps = (state, { windowId }) => {
|
|
14
|
+
const { collectionPath } = getWindow(state, { windowId }) || {};
|
|
15
|
+
const manifestId = collectionPath[collectionPath.length - 1];
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
collectionLabel: getManifestTitle(state, { manifestId }),
|
|
19
|
+
collectionPath,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const mapDispatchToProps = {
|
|
24
|
+
showCollectionDialog: actions.showCollectionDialog,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('CollectionInfo'));
|
|
28
|
+
|
|
29
|
+
export default enhance(CollectionInfo);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { getCompanionWindowIdsForPosition, getCompanionAreaVisibility, getThemeDirection, getWindow } from '../state/selectors';
|
|
5
|
+
import * as actions from '../state/actions';
|
|
6
|
+
import { CompanionArea } from '../components/CompanionArea';
|
|
7
|
+
|
|
8
|
+
/** */
|
|
9
|
+
const mapStateToProps = (state, { windowId, position }) => ({
|
|
10
|
+
companionAreaOpen: getCompanionAreaVisibility(state, { position, windowId }),
|
|
11
|
+
companionWindowIds: getCompanionWindowIdsForPosition(state, { position, windowId }),
|
|
12
|
+
direction: getThemeDirection(state),
|
|
13
|
+
sideBarOpen: (getWindow(state, { windowId }) || {}).sideBarOpen,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const mapDispatchToProps = {
|
|
17
|
+
setCompanionAreaOpen: actions.setCompanionAreaOpen,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('CompanionArea'));
|
|
21
|
+
|
|
22
|
+
export default enhance(CompanionArea);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import * as actions from '../state/actions';
|
|
5
|
+
import { getCompanionWindow, getThemeDirection, getWindowConfig } from '../state/selectors';
|
|
6
|
+
import { CompanionWindow } from '../components/CompanionWindow';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* mapStateToProps - to hook up connect
|
|
10
|
+
* @memberof CompanionWindow
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
const mapStateToProps = (state, { id, windowId }) => {
|
|
14
|
+
const companionWindow = getCompanionWindow(state, { companionWindowId: id });
|
|
15
|
+
const { defaultSidebarPanelHeight, defaultSidebarPanelWidth } = getWindowConfig(state, {
|
|
16
|
+
windowId,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
...companionWindow,
|
|
21
|
+
defaultSidebarPanelHeight,
|
|
22
|
+
defaultSidebarPanelWidth,
|
|
23
|
+
direction: getThemeDirection(state),
|
|
24
|
+
isDisplayed: companionWindow && companionWindow.content && companionWindow.content.length > 0,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* mapDispatchToProps - to hook up connect
|
|
30
|
+
* @memberof CompanionWindow
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
const mapDispatchToProps = (dispatch, { windowId, id }) => ({
|
|
34
|
+
onCloseClick: () => dispatch(actions.removeCompanionWindow(windowId, id)),
|
|
35
|
+
updateCompanionWindow: (...args) => dispatch(actions.updateCompanionWindow(windowId, id, ...args)),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true }), withPlugins('CompanionWindow'));
|
|
39
|
+
|
|
40
|
+
export default enhance(CompanionWindow);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { getCompanionWindow } from '../state/selectors';
|
|
5
|
+
import { CompanionWindowFactory } from '../components/CompanionWindowFactory';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* mapStateToProps - to hook up connect
|
|
9
|
+
* @memberof CompanionWindow
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
const mapStateToProps = (state, { id }) => {
|
|
13
|
+
const companionWindow = getCompanionWindow(state, { companionWindowId: id });
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
content: companionWindow.content,
|
|
17
|
+
id,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const enhance = compose(connect(mapStateToProps), withPlugins('CompanionWindowFactory'));
|
|
22
|
+
|
|
23
|
+
export default enhance(CompanionWindowFactory);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { CustomPanel } from '../components/CustomPanel';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* mapStateToProps - to hook up connect
|
|
8
|
+
*/
|
|
9
|
+
const mapStateToProps = (state, { id, windowId }) => ({});
|
|
10
|
+
|
|
11
|
+
const enhance = compose(connect(mapStateToProps), withPlugins('CustomPanel'));
|
|
12
|
+
|
|
13
|
+
export default enhance(CustomPanel);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { ErrorContent } from '../components/ErrorContent';
|
|
5
|
+
import { getCompanionWindow, getManifest, getWindow, getViewer, getConfig } from '../state/selectors';
|
|
6
|
+
|
|
7
|
+
/** mapStateToProps */
|
|
8
|
+
const mapStateToProps = (state, { companionWindowId, windowId }) => ({
|
|
9
|
+
metadata: {
|
|
10
|
+
companionWindow: companionWindowId && getCompanionWindow(state, { companionWindowId }),
|
|
11
|
+
manifest: getManifest(state, { windowId }),
|
|
12
|
+
viewer: getViewer(state, { windowId }),
|
|
13
|
+
window: getWindow(state, { windowId }),
|
|
14
|
+
},
|
|
15
|
+
showJsError: getConfig(state).window.showJsError,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const enhance = compose(connect(mapStateToProps), withPlugins('ErrorContent'));
|
|
19
|
+
|
|
20
|
+
export default enhance(ErrorContent);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { ErrorDialog } from '../components/ErrorDialog';
|
|
5
|
+
import * as actions from '../state/actions';
|
|
6
|
+
import { getLatestError } from '../state/selectors';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* mapStateToProps - to hook up connect
|
|
10
|
+
* @memberof ErrorDialog
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
const mapStateToProps = (state) => ({
|
|
14
|
+
error: getLatestError(state),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* mapDispatchToProps - used to hook up connect to action creators
|
|
19
|
+
* @memberof App
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
const mapDispatchToProps = {
|
|
23
|
+
removeError: actions.removeError,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('ErrorDialog'));
|
|
27
|
+
|
|
28
|
+
export default enhance(ErrorDialog);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { connect } from 'react-redux';
|
|
2
|
+
import { compose } from 'redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { FullScreenButton } from '../components/FullScreenButton';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* mapStateToProps - to hook up connect
|
|
8
|
+
* @memberof FullScreenButton
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
const mapStateToProps = (_state) => ({});
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* mapDispatchToProps - used to hook up connect to action creators
|
|
15
|
+
* @memberof ManifestListItem
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
const mapDispatchToProps = {};
|
|
19
|
+
|
|
20
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('FullScreenButton'));
|
|
21
|
+
|
|
22
|
+
export default enhance(FullScreenButton);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { GalleryView } from '../components/GalleryView';
|
|
5
|
+
import { getCanvases, getSequenceViewingDirection } from '../state/selectors';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* mapStateToProps - to hook up connect
|
|
9
|
+
* @memberof WindowViewer
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
const mapStateToProps = (state, { windowId }) => ({
|
|
13
|
+
canvases: getCanvases(state, { windowId }),
|
|
14
|
+
viewingDirection: getSequenceViewingDirection(state, { windowId }),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const enhance = compose(
|
|
18
|
+
connect(mapStateToProps),
|
|
19
|
+
withPlugins('GalleryView'),
|
|
20
|
+
// further HOC go here
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default enhance(GalleryView);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import * as actions from '../state/actions';
|
|
4
|
+
import { GalleryViewThumbnail } from '../components/GalleryViewThumbnail';
|
|
5
|
+
import {
|
|
6
|
+
getSearchAnnotationsForWindow,
|
|
7
|
+
getCurrentCanvas,
|
|
8
|
+
getConfig,
|
|
9
|
+
getPresentAnnotationsOnSelectedCanvases,
|
|
10
|
+
getCompanionWindowsForContent,
|
|
11
|
+
} from '../state/selectors';
|
|
12
|
+
|
|
13
|
+
/** */
|
|
14
|
+
const mapStateToProps = (state, { canvas, windowId }) => {
|
|
15
|
+
const currentCanvas = getCurrentCanvas(state, { windowId });
|
|
16
|
+
const searchAnnotations = getSearchAnnotationsForWindow(state, { windowId });
|
|
17
|
+
|
|
18
|
+
const canvasAnnotations = searchAnnotations.flatMap((a) => a.resources).filter((a) => a.targetId === canvas.id);
|
|
19
|
+
|
|
20
|
+
const hasOpenAnnotationsWindow = getCompanionWindowsForContent(state, { content: 'annotations', windowId }).length > 0;
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
annotationsCount: (() => {
|
|
24
|
+
if (!hasOpenAnnotationsWindow) return undefined;
|
|
25
|
+
const annotations = getPresentAnnotationsOnSelectedCanvases(state, { canvasId: canvas.id });
|
|
26
|
+
|
|
27
|
+
return annotations.reduce((v, a) => v + a.resources.filter((r) => r.targetId === canvas.id).length, 0);
|
|
28
|
+
})(),
|
|
29
|
+
config: getConfig(state).galleryView,
|
|
30
|
+
searchAnnotationsCount: canvasAnnotations.length,
|
|
31
|
+
selected: currentCanvas && currentCanvas.id === canvas.id,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* mapDispatchToProps - used to hook up connect to action creators
|
|
37
|
+
* @memberof WindowViewer
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
const mapDispatchToProps = (dispatch, { canvas, id, windowId }) => ({
|
|
41
|
+
focusOnCanvas: () => dispatch(actions.setWindowViewType(windowId, 'single')),
|
|
42
|
+
requestCanvasAnnotations: () => dispatch(actions.requestCanvasAnnotations(windowId, canvas.id)),
|
|
43
|
+
setCanvas: (...args) => dispatch(actions.setCanvas(windowId, ...args)),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const enhance = compose(
|
|
47
|
+
connect(mapStateToProps, mapDispatchToProps),
|
|
48
|
+
// further HOC go here
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export default enhance(GalleryViewThumbnail);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { connect } from 'react-redux';
|
|
2
|
+
import { compose } from 'redux';
|
|
3
|
+
import { Utils } from 'manifesto.js';
|
|
4
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
5
|
+
import * as actions from '../state/actions';
|
|
6
|
+
import { getAuth, getAuthProfiles, selectCurrentAuthServices, getAccessTokens } from '../state/selectors';
|
|
7
|
+
import { IIIFAuthentication } from '../components/IIIFAuthentication';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* mapStateToProps - to hook up connect
|
|
11
|
+
* @memberof FullScreenButton
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
// eslint-disable-next-line complexity
|
|
15
|
+
const mapStateToProps = (state, { windowId }) => {
|
|
16
|
+
const services = selectCurrentAuthServices(state, { windowId });
|
|
17
|
+
|
|
18
|
+
// TODO: get the most actionable auth service...
|
|
19
|
+
const service = services[0];
|
|
20
|
+
|
|
21
|
+
const accessTokenService =
|
|
22
|
+
service &&
|
|
23
|
+
(Utils.getService(service, 'http://iiif.io/api/auth/1/token') ||
|
|
24
|
+
Utils.getService(service, 'http://iiif.io/api/auth/0/token'));
|
|
25
|
+
const logoutService =
|
|
26
|
+
service &&
|
|
27
|
+
(Utils.getService(service, 'http://iiif.io/api/auth/1/logout') ||
|
|
28
|
+
Utils.getService(service, 'http://iiif.io/api/auth/0/logout'));
|
|
29
|
+
|
|
30
|
+
const authStatuses = getAuth(state);
|
|
31
|
+
const authStatus = service && authStatuses[service.id];
|
|
32
|
+
const accessTokens = getAccessTokens(state);
|
|
33
|
+
const accessTokenStatus = accessTokenService && accessTokens[accessTokenService.id];
|
|
34
|
+
|
|
35
|
+
let status = null;
|
|
36
|
+
|
|
37
|
+
if (!authStatus) {
|
|
38
|
+
status = null;
|
|
39
|
+
} else if (authStatus.isFetching) {
|
|
40
|
+
if (authStatus.windowId === windowId) status = 'cookie';
|
|
41
|
+
} else if (accessTokenStatus && accessTokenStatus.isFetching) {
|
|
42
|
+
if (authStatus.windowId === windowId) status = 'token';
|
|
43
|
+
} else if (authStatus.ok) {
|
|
44
|
+
status = 'ok';
|
|
45
|
+
} else if (authStatus.ok === false) {
|
|
46
|
+
status = 'failed';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const authProfiles = getAuthProfiles(state);
|
|
50
|
+
|
|
51
|
+
const profile = service && service.getProfile();
|
|
52
|
+
|
|
53
|
+
const isInteractive = authProfiles.some((config) => config.profile === profile && !(config.external || config.kiosk));
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
accessTokenServiceId: accessTokenService && accessTokenService.id,
|
|
57
|
+
authServiceId: service && service.id,
|
|
58
|
+
confirm: service && service.getConfirmLabel(),
|
|
59
|
+
description: service && service.getDescription(),
|
|
60
|
+
failureDescription: service && service.getFailureDescription(),
|
|
61
|
+
failureHeader: service && service.getFailureHeader(),
|
|
62
|
+
header: service && service.getHeader(),
|
|
63
|
+
isInteractive,
|
|
64
|
+
label: service && service.getLabel()[0].value,
|
|
65
|
+
logoutConfirm: logoutService && logoutService.getLabel()[0] && logoutService.getLabel()[0].value,
|
|
66
|
+
logoutServiceId: logoutService && logoutService.id,
|
|
67
|
+
profile,
|
|
68
|
+
status,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* mapDispatchToProps - used to hook up connect to action creators
|
|
74
|
+
* @memberof ManifestListItem
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
const mapDispatchToProps = {
|
|
78
|
+
handleAuthInteraction: actions.addAuthenticationRequest,
|
|
79
|
+
resetAuthenticationState: actions.resetAuthenticationState,
|
|
80
|
+
resolveAccessTokenRequest: actions.resolveAccessTokenRequest,
|
|
81
|
+
resolveAuthenticationRequest: actions.resolveAuthenticationRequest,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const enhance = compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('IIIFAuthentication'));
|
|
85
|
+
|
|
86
|
+
export default enhance(IIIFAuthentication);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { getConfig } from '../state/selectors';
|
|
5
|
+
import { IIIFThumbnail } from '../components/IIIFThumbnail';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* mapStateToProps - to hook up connect
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
const mapStateToProps = (state) => ({
|
|
12
|
+
thumbnailsConfig: getConfig(state).thumbnails,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const enhance = compose(connect(mapStateToProps), withPlugins('IIIFThumbnail'));
|
|
16
|
+
|
|
17
|
+
export default enhance(IIIFThumbnail);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { getConfig } from '../state/selectors';
|
|
5
|
+
import { LabelValueMetadata } from '../components/LabelValueMetadata';
|
|
6
|
+
|
|
7
|
+
/** */
|
|
8
|
+
const mapStateToProps = (state) => ({
|
|
9
|
+
labelValueJoiner: getConfig(state).labelValueJoiner,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const enhance = compose(connect(mapStateToProps), withPlugins('LabelValueMetadata'));
|
|
13
|
+
|
|
14
|
+
export default enhance(LabelValueMetadata);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import * as actions from '../state/actions';
|
|
5
|
+
import { getLanguagesFromConfigWithCurrent } from '../state/selectors';
|
|
6
|
+
import { LanguageSettings } from '../components/LanguageSettings';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Map state to props for connect
|
|
10
|
+
*/
|
|
11
|
+
const mapStateToProps = (state) => ({
|
|
12
|
+
languages: getLanguagesFromConfigWithCurrent(state),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Map action dispatches to props for connect
|
|
17
|
+
*/
|
|
18
|
+
const mapDispatchToProps = (dispatch, { afterSelect }) => ({
|
|
19
|
+
handleClick: (language) => {
|
|
20
|
+
dispatch(actions.updateConfig({ language }));
|
|
21
|
+
|
|
22
|
+
afterSelect && afterSelect();
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export default compose(connect(mapStateToProps, mapDispatchToProps), withPlugins('LanguageSettings'))(LanguageSettings);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { compose } from 'redux';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import { withPlugins } from '../extend/withPlugins';
|
|
4
|
+
import { LayersPanel } from '../components/LayersPanel';
|
|
5
|
+
import { getVisibleCanvasIds } from '../state/selectors';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* mapStateToProps - to hook up connect
|
|
9
|
+
*/
|
|
10
|
+
const mapStateToProps = (state, { id, windowId }) => ({
|
|
11
|
+
canvasIds: getVisibleCanvasIds(state, { windowId }),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const enhance = compose(connect(mapStateToProps), withPlugins('LayersPanel'));
|
|
15
|
+
|
|
16
|
+
export default enhance(LayersPanel);
|