-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
59 lines (56 loc) · 1.8 KB
/
index.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { updateWindow } from "mirador/dist/es/src/state/actions";
import {
getCanvasLabel,
getContainerId,
getManifestRelatedContent,
getManifestUrl,
getVisibleCanvases,
selectInfoResponse,
} from "mirador/dist/es/src/state/selectors";
import DownloadButton from "./components/DownloadButton";
import DownloadDialog from "./components/DownloadDialog";
import translations from "./locales";
import { getPluginConfig } from "./state/selectors";
export default [
{
component: DownloadButton,
config: {
translations,
},
mapDispatchToProps: (dispatch, { windowId }) => ({
updateConfig: (downloadDialog) =>
dispatch(updateWindow(windowId, { downloadDialog })),
}),
mapStateToProps: (state, { windowId }) => ({
containerId: getContainerId(state),
config: getPluginConfig(state, { windowId }),
}),
mode: "add",
name: "DownloadButton",
target: "WindowTopBarPluginArea",
},
{
component: DownloadDialog,
config: {
translations,
},
mapDispatchToProps: (dispatch, { windowId }) => ({
updateConfig: (downloadDialog) =>
dispatch(updateWindow(windowId, { downloadDialog })),
}),
mapStateToProps: (state, { windowId }) => ({
canvasLabel: (canvasId) => getCanvasLabel(state, { canvasId, windowId }),
config: getPluginConfig(state, { windowId }),
containerId: getContainerId(state),
infoResponse: (canvasId) =>
selectInfoResponse(state, { canvasId, windowId }) ?? {},
manifestUrl: getManifestUrl(state, { windowId }),
seeAlso: getManifestRelatedContent(state, { windowId }),
visibleCanvases: getVisibleCanvases(state, { windowId }),
}),
mode: "add",
name: "DownloadDialog",
target: "Window",
},
];
export { DownloadDialog, getPluginConfig, translations };