mirador-dl-plugin 0.12.0 → 1.0.0-alpha.1

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.
@@ -1,232 +1,141 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
- exports.MiradorDownloadDialog = undefined;
5
-
6
- var _react = require('react');
7
-
8
- var _react2 = _interopRequireDefault(_react);
9
-
10
- var _propTypes = require('prop-types');
11
-
12
- var _propTypes2 = _interopRequireDefault(_propTypes);
13
-
14
- var _styles = require('@material-ui/core/styles');
15
-
16
- var _Button = require('@material-ui/core/Button');
17
-
18
- var _Button2 = _interopRequireDefault(_Button);
19
-
20
- var _Dialog = require('@material-ui/core/Dialog');
21
-
22
- var _Dialog2 = _interopRequireDefault(_Dialog);
23
-
24
- var _DialogActions = require('@material-ui/core/DialogActions');
25
-
26
- var _DialogActions2 = _interopRequireDefault(_DialogActions);
27
-
28
- var _DialogTitle = require('@material-ui/core/DialogTitle');
29
-
30
- var _DialogTitle2 = _interopRequireDefault(_DialogTitle);
31
-
32
- var _Typography = require('@material-ui/core/Typography');
33
-
34
- var _Typography2 = _interopRequireDefault(_Typography);
35
-
36
- var _canvases = require('mirador/dist/es/src/state/selectors/canvases');
37
-
38
- var _windows = require('mirador/dist/es/src/state/selectors/windows');
39
-
40
- var _manifests = require('mirador/dist/es/src/state/selectors/manifests');
41
-
42
- var _config = require('mirador/dist/es/src/state/selectors/config');
43
-
44
- var _ScrollIndicatedDialogContent = require('mirador/dist/es/src/containers/ScrollIndicatedDialogContent');
45
-
46
- var _ScrollIndicatedDialogContent2 = _interopRequireDefault(_ScrollIndicatedDialogContent);
47
-
48
- var _CanvasDownloadLinks = require('./CanvasDownloadLinks');
49
-
50
- var _CanvasDownloadLinks2 = _interopRequireDefault(_CanvasDownloadLinks);
51
-
52
- var _ManifestDownloadLinks = require('./ManifestDownloadLinks');
53
-
54
- var _ManifestDownloadLinks2 = _interopRequireDefault(_ManifestDownloadLinks);
55
-
56
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
57
-
58
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
59
-
60
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
61
-
62
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
63
-
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MiradorDownloadDialog = MiradorDownloadDialog;
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactI18next = require("react-i18next");
10
+ var _mirador = require("mirador");
11
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
12
+ var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
13
+ var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
14
+ var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
15
+ var _Button = _interopRequireDefault(require("@mui/material/Button"));
16
+ var _ManifestDownloadLinks = _interopRequireDefault(require("./ManifestDownloadLinks"));
17
+ var _translations = _interopRequireDefault(require("./translations"));
18
+ var _CanvasDownloadLinks = _interopRequireDefault(require("./CanvasDownloadLinks"));
19
+ var _jsxRuntime = require("react/jsx-runtime");
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
21
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
64
23
  var mapDispatchToProps = function mapDispatchToProps(dispatch, _ref) {
65
24
  var windowId = _ref.windowId;
66
25
  return {
67
26
  closeDialog: function closeDialog() {
68
- return dispatch({ type: 'CLOSE_WINDOW_DIALOG', windowId: windowId });
27
+ return dispatch({
28
+ type: 'CLOSE_WINDOW_DIALOG',
29
+ windowId: windowId
30
+ });
69
31
  }
70
32
  };
71
33
  };
72
-
73
34
  var mapStateToProps = function mapStateToProps(state, _ref2) {
74
35
  var windowId = _ref2.windowId;
75
36
  return {
76
- canvases: (0, _canvases.getVisibleCanvases)(state, { windowId: windowId }),
37
+ canvases: (0, _mirador.getVisibleCanvases)(state, {
38
+ windowId: windowId
39
+ }),
77
40
  canvasLabel: function canvasLabel(canvasId) {
78
- return (0, _canvases.getCanvasLabel)(state, { canvasId: canvasId, windowId: windowId });
41
+ return (0, _mirador.getCanvasLabel)(state, {
42
+ canvasId: canvasId,
43
+ windowId: windowId
44
+ });
79
45
  },
80
- containerId: (0, _config.getContainerId)(state),
46
+ containerId: (0, _mirador.getContainerId)(state),
81
47
  infoResponse: function infoResponse(canvasId) {
82
- return (0, _canvases.selectInfoResponse)(state, { windowId: windowId, canvasId: canvasId }) || {};
48
+ return (0, _mirador.selectInfoResponse)(state, {
49
+ windowId: windowId,
50
+ canvasId: canvasId
51
+ }) || {};
83
52
  },
84
- manifest: (0, _manifests.getManifestoInstance)(state, { windowId: windowId }),
53
+ manifest: (0, _mirador.getManifestoInstance)(state, {
54
+ windowId: windowId
55
+ }),
85
56
  restrictDownloadOnSizeDefinition: state.config.miradorDownloadPlugin && state.config.miradorDownloadPlugin.restrictDownloadOnSizeDefinition,
86
57
  open: state.windowDialogs[windowId] && state.windowDialogs[windowId].openDialog === 'download',
87
- viewType: (0, _windows.getWindowViewType)(state, { windowId: windowId })
58
+ viewType: (0, _mirador.getWindowViewType)(state, {
59
+ windowId: windowId
60
+ })
88
61
  };
89
62
  };
90
63
 
91
64
  /**
92
65
  * MiradorDownloadDialog ~
93
- */
94
-
95
- var MiradorDownloadDialog = exports.MiradorDownloadDialog = function (_Component) {
96
- _inherits(MiradorDownloadDialog, _Component);
97
-
98
- function MiradorDownloadDialog() {
99
- _classCallCheck(this, MiradorDownloadDialog);
100
-
101
- return _possibleConstructorReturn(this, _Component.apply(this, arguments));
102
- }
103
-
104
- MiradorDownloadDialog.prototype.renderings = function renderings() {
105
- var manifest = this.props.manifest;
106
-
66
+ */
67
+ function MiradorDownloadDialog(_ref3) {
68
+ var _ref3$canvases = _ref3.canvases,
69
+ canvases = _ref3$canvases === void 0 ? [] : _ref3$canvases,
70
+ canvasLabel = _ref3.canvasLabel,
71
+ closeDialog = _ref3.closeDialog,
72
+ containerId = _ref3.containerId,
73
+ infoResponse = _ref3.infoResponse,
74
+ _ref3$manifest = _ref3.manifest,
75
+ manifest = _ref3$manifest === void 0 ? {} : _ref3$manifest,
76
+ _ref3$open = _ref3.open,
77
+ open = _ref3$open === void 0 ? false : _ref3$open,
78
+ _ref3$restrictDownloa = _ref3.restrictDownloadOnSizeDefinition,
79
+ restrictDownloadOnSizeDefinition = _ref3$restrictDownloa === void 0 ? false : _ref3$restrictDownloa,
80
+ viewType = _ref3.viewType,
81
+ windowId = _ref3.windowId;
82
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
83
+ t = _useTranslation.t;
84
+ var renderings = (0, _react.useMemo)(function () {
107
85
  if (!(manifest && manifest.getSequences() && manifest.getSequences()[0] && manifest.getSequences()[0].getRenderings())) return [];
108
-
109
86
  return manifest.getSequences()[0].getRenderings();
110
- };
111
-
112
- /**
113
- * Returns the rendered component
114
- */
115
-
116
-
117
- MiradorDownloadDialog.prototype.render = function render() {
118
- var _props = this.props,
119
- canvases = _props.canvases,
120
- canvasLabel = _props.canvasLabel,
121
- classes = _props.classes,
122
- closeDialog = _props.closeDialog,
123
- containerId = _props.containerId,
124
- infoResponse = _props.infoResponse,
125
- open = _props.open,
126
- restrictDownloadOnSizeDefinition = _props.restrictDownloadOnSizeDefinition,
127
- viewType = _props.viewType,
128
- windowId = _props.windowId;
129
-
130
-
131
- if (!open) return '';
132
-
133
- return _react2.default.createElement(
134
- _react2.default.Fragment,
135
- null,
136
- _react2.default.createElement(
137
- _Dialog2.default,
138
- {
139
- container: document.querySelector('#' + containerId + ' .mirador-viewer'),
140
- disableEnforceFocus: true,
141
- onClose: closeDialog,
142
- open: open,
143
- scroll: 'paper',
144
- fullWidth: true,
145
- maxWidth: 'xs'
146
- },
147
- _react2.default.createElement(
148
- _DialogTitle2.default,
149
- { disableTypography: true, className: classes.h2 },
150
- _react2.default.createElement(
151
- _Typography2.default,
152
- { variant: 'h2' },
153
- 'Download'
154
- )
155
- ),
156
- _react2.default.createElement(
157
- _ScrollIndicatedDialogContent2.default,
158
- null,
159
- canvases.map(function (canvas) {
160
- return _react2.default.createElement(_CanvasDownloadLinks2.default, {
161
- canvas: canvas,
162
- canvasLabel: canvasLabel(canvas.id),
163
- classes: classes,
164
- infoResponse: infoResponse(canvas.id),
165
- restrictDownloadOnSizeDefinition: restrictDownloadOnSizeDefinition,
166
- key: canvas.id,
167
- viewType: viewType,
168
- windowId: windowId
169
- });
170
- }),
171
- this.renderings().length > 0 && _react2.default.createElement(_ManifestDownloadLinks2.default, { classes: classes, renderings: this.renderings() })
172
- ),
173
- _react2.default.createElement(
174
- _DialogActions2.default,
175
- null,
176
- _react2.default.createElement(
177
- _Button2.default,
178
- { onClick: closeDialog, color: 'primary' },
179
- 'Close'
180
- )
181
- )
182
- )
183
- );
184
- };
185
-
186
- return MiradorDownloadDialog;
187
- }(_react.Component);
188
-
189
- MiradorDownloadDialog.propTypes = process.env.NODE_ENV !== "production" ? {
190
- canvasLabel: _propTypes2.default.func.isRequired,
191
- canvases: _propTypes2.default.arrayOf(_propTypes2.default.shape({ id: _propTypes2.default.string, index: _propTypes2.default.number })),
192
- classes: _propTypes2.default.shape({
193
- h2: _propTypes2.default.string,
194
- h3: _propTypes2.default.string
195
- }).isRequired,
196
- closeDialog: _propTypes2.default.func.isRequired,
197
- containerId: _propTypes2.default.string.isRequired,
198
- infoResponse: _propTypes2.default.func.isRequired,
199
- manifest: _propTypes2.default.shape({
200
- getSequences: _propTypes2.default.func
201
- }),
202
- open: _propTypes2.default.bool,
203
- restrictDownloadOnSizeDefinition: _propTypes2.default.bool,
204
- viewType: _propTypes2.default.string.isRequired,
205
- windowId: _propTypes2.default.string.isRequired
206
- } : {};
207
- MiradorDownloadDialog.defaultProps = {
208
- canvases: [],
209
- manifest: {},
210
- open: false,
211
- restrictDownloadOnSizeDefinition: false
212
- };
213
-
214
- var styles = function styles() {
215
- return {
216
- h2: {
217
- paddingBottom: 0
218
- },
219
- h3: {
220
- marginTop: '20px'
221
- }
222
- };
223
- };
224
-
225
- exports.default = {
87
+ }, [manifest]);
88
+ if (!open) return '';
89
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Dialog["default"], {
90
+ "data-testid": "dialog-content",
91
+ container: document.querySelector("#".concat(containerId, " .mirador-viewer")),
92
+ disableEnforceFocus: true,
93
+ onClose: closeDialog,
94
+ open: open,
95
+ scroll: "paper",
96
+ fullWidth: true,
97
+ maxWidth: "xs",
98
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogTitle["default"], {
99
+ sx: {
100
+ paddingBottom: 0
101
+ },
102
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography["default"], {
103
+ variant: "h2",
104
+ component: "span",
105
+ children: t('mirador-dl-plugin.download')
106
+ })
107
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_mirador.ScrollIndicatedDialogContent, {
108
+ children: [canvases.map(function (canvas) {
109
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CanvasDownloadLinks["default"], {
110
+ canvas: canvas,
111
+ canvasLabel: canvasLabel(canvas.id),
112
+ infoResponse: infoResponse(canvas.id),
113
+ restrictDownloadOnSizeDefinition: restrictDownloadOnSizeDefinition,
114
+ t: t,
115
+ viewType: viewType,
116
+ windowId: windowId
117
+ }, canvas.id);
118
+ }), renderings.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ManifestDownloadLinks["default"], {
119
+ renderings: renderings,
120
+ t: t
121
+ })]
122
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogActions["default"], {
123
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
124
+ onClick: closeDialog,
125
+ color: "primary",
126
+ children: t('mirador-dl-plugin.close')
127
+ })
128
+ })]
129
+ });
130
+ }
131
+ var _default = exports["default"] = {
226
132
  target: 'Window',
227
133
  mode: 'add',
228
134
  name: 'MiradorDownloadDialog',
229
- component: (0, _styles.withStyles)(styles)(MiradorDownloadDialog),
135
+ component: MiradorDownloadDialog,
136
+ config: {
137
+ translations: _translations["default"]
138
+ },
230
139
  mapDispatchToProps: mapDispatchToProps,
231
140
  mapStateToProps: mapStateToProps
232
141
  };
@@ -1,80 +1,58 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
- exports.default = undefined;
5
-
6
- var _react = require('react');
7
-
8
- var _react2 = _interopRequireDefault(_react);
9
-
10
- var _propTypes = require('prop-types');
11
-
12
- var _propTypes2 = _interopRequireDefault(_propTypes);
13
-
14
- var _Link = require('@material-ui/core/Link');
15
-
16
- var _Link2 = _interopRequireDefault(_Link);
17
-
18
- var _ListItem = require('@material-ui/core/ListItem');
19
-
20
- var _ListItem2 = _interopRequireDefault(_ListItem);
21
-
22
- var _ListItemText = require('@material-ui/core/ListItemText');
23
-
24
- var _ListItemText2 = _interopRequireDefault(_ListItemText);
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
-
30
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
31
-
32
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
33
-
34
- /**
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _Link = _interopRequireDefault(require("@mui/material/Link"));
9
+ var _ListItem = _interopRequireDefault(require("@mui/material/ListItem"));
10
+ var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
21
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
22
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
23
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
24
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
25
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
26
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } /**
35
27
  * RenderingDownloadLink ~
36
- */
37
- var RenderingDownloadLink = function (_Component) {
38
- _inherits(RenderingDownloadLink, _Component);
39
-
28
+ */
29
+ var RenderingDownloadLink = exports["default"] = /*#__PURE__*/function (_Component) {
40
30
  function RenderingDownloadLink() {
41
31
  _classCallCheck(this, RenderingDownloadLink);
42
-
43
- return _possibleConstructorReturn(this, _Component.apply(this, arguments));
32
+ return _callSuper(this, RenderingDownloadLink, arguments);
44
33
  }
45
-
46
- RenderingDownloadLink.prototype.render = function render() {
47
- var rendering = this.props.rendering;
48
-
49
- return _react2.default.createElement(
50
- _ListItem2.default,
51
- { disableGutters: true, divider: true, key: rendering.id },
52
- _react2.default.createElement(
53
- _ListItemText2.default,
54
- { primaryTypographyProps: { variant: 'body1' } },
55
- _react2.default.createElement(
56
- _Link2.default,
57
- { href: rendering.id, rel: 'noopener noreferrer', target: '_blank', variant: 'body1' },
58
- rendering.getLabel().map(function (label) {
59
- return label.value;
60
- })[0]
61
- ),
62
- rendering.getFormat() && rendering.getFormat().value && ' (' + rendering.getFormat().value + ')'
63
- )
64
- );
65
- };
66
-
67
- return RenderingDownloadLink;
68
- }(_react.Component);
69
-
70
- exports.default = RenderingDownloadLink;
71
-
72
-
73
- RenderingDownloadLink.propTypes = process.env.NODE_ENV !== "production" ? {
74
- rendering: _propTypes2.default.shape({
75
- id: _propTypes2.default.string.isRequired,
76
- getLabel: _propTypes2.default.func.isRequired,
77
- getFormat: _propTypes2.default.func.isRequired
78
- }).isRequired
79
- } : {};
80
- module.exports = exports['default'];
34
+ _inherits(RenderingDownloadLink, _Component);
35
+ return _createClass(RenderingDownloadLink, [{
36
+ key: "render",
37
+ value: function render() {
38
+ var rendering = this.props.rendering;
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItem["default"], {
40
+ disableGutters: true,
41
+ divider: true,
42
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListItemText["default"], {
43
+ primaryTypographyProps: {
44
+ variant: 'body1'
45
+ },
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link["default"], {
47
+ href: rendering.id,
48
+ download: true,
49
+ rel: "noopener noreferrer",
50
+ target: "_blank",
51
+ variant: "body1",
52
+ children: rendering.getLabel().getValue()
53
+ }), rendering.getFormat() && rendering.getFormat().value && " (".concat(rendering.getFormat().value, ")")]
54
+ })
55
+ }, rendering.id);
56
+ }
57
+ }]);
58
+ }(_react.Component);
package/lib/index.js CHANGED
@@ -1,19 +1,23 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- exports.__esModule = true;
4
-
5
- var _miradorDownloadPlugin = require('./miradorDownloadPlugin');
6
-
7
- var _miradorDownloadPlugin2 = _interopRequireDefault(_miradorDownloadPlugin);
8
-
9
- var _MiradorDownloadDialog = require('./MiradorDownloadDialog');
10
-
11
- var _MiradorDownloadDialog2 = _interopRequireDefault(_MiradorDownloadDialog);
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- exports.default = {
16
- miradorDownloadPlugin: _miradorDownloadPlugin2.default,
17
- MiradorDownloadDialogPlugin: _MiradorDownloadDialog2.default
18
- };
19
- module.exports = exports['default'];
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "MiradorDownloadDialogPlugin", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _MiradorDownloadDialog["default"];
10
+ }
11
+ });
12
+ exports["default"] = void 0;
13
+ Object.defineProperty(exports, "miradorDownloadPlugin", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _miradorDownloadPlugin["default"];
17
+ }
18
+ });
19
+ require("@mui/material/styles/styled");
20
+ var _miradorDownloadPlugin = _interopRequireDefault(require("./miradorDownloadPlugin"));
21
+ var _MiradorDownloadDialog = _interopRequireDefault(require("./MiradorDownloadDialog"));
22
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
23
+ var _default = exports["default"] = [_miradorDownloadPlugin["default"], _MiradorDownloadDialog["default"]];