-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmiradorImageToolsPlugin.js
38 lines (37 loc) · 1.27 KB
/
miradorImageToolsPlugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import withTheme from '@material-ui/core/styles/withTheme';
import * as actions from 'mirador/dist/es/src/state/actions';
import { getWindowConfig, getViewer, getContainerId } from 'mirador/dist/es/src/state/selectors';
import MiradorImageTools from './MiradorImageTools';
import MiradorImageToolsMenuItem from './MiradorImageToolsMenuItem';
import translations from '../translations';
export default [
{
target: 'OpenSeadragonViewer',
mapDispatchToProps: {
updateWindow: actions.updateWindow,
updateViewport: actions.updateViewport,
},
mapStateToProps: (state, { windowId }) => ({
containerId: getContainerId(state),
enabled: getWindowConfig(state, { windowId }).imageToolsEnabled || false,
open: getWindowConfig(state, { windowId }).imageToolsOpen || false,
viewConfig: getViewer(state, { windowId }) || {},
}),
mode: 'add',
component: withTheme(MiradorImageTools),
config: {
translations,
},
},
{
target: 'WindowTopBarPluginMenu',
component: MiradorImageToolsMenuItem,
mode: 'add',
mapDispatchToProps: {
updateWindow: actions.updateWindow,
},
mapStateToProps: (state, { windowId }) => ({
enabled: getWindowConfig(state, { windowId }).imageToolsEnabled || false,
}),
},
];