@harvard-lts/mirador-pdf-plugin 0.0.2 → 1.0.0-beta.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.
Files changed (2) hide show
  1. package/dist/es/index.js +27 -45
  2. package/package.json +22 -11
package/dist/es/index.js CHANGED
@@ -1,18 +1,17 @@
1
- import { useState, useEffect } from 'react';
2
- import MenuItem from '@material-ui/core/MenuItem';
3
- import ListItemIcon from '@material-ui/core/ListItemIcon';
4
- import ListItemText from '@material-ui/core/ListItemText';
5
- import { getManifestoInstance } from 'mirador/dist/es/src/state/selectors/manifests';
6
- import PDFIcon from '@material-ui/icons/PictureAsPdf';
1
+ import MenuItem from '@mui/material/MenuItem';
2
+ import ListItemIcon from '@mui/material/ListItemIcon';
3
+ import ListItemText from '@mui/material/ListItemText';
4
+ import { getManifestoInstance } from 'mirador';
5
+ import PictureAsPdfIcon from '@mui/icons-material/PictureAsPdf';
7
6
  import { jsx, jsxs } from 'react/jsx-runtime';
8
- import { withStyles } from '@material-ui/core/styles';
9
- import Button from '@material-ui/core/Button';
10
- import Dialog from '@material-ui/core/Dialog';
11
- import DialogActions from '@material-ui/core/DialogActions';
12
- import DialogContent from '@material-ui/core/DialogContent';
13
- import DialogTitle from '@material-ui/core/DialogTitle';
14
- import TextField from '@material-ui/core/TextField';
15
- import Typography from '@material-ui/core/Typography';
7
+ import { useState, useEffect } from 'react';
8
+ import Button from '@mui/material/Button';
9
+ import Dialog from '@mui/material/Dialog';
10
+ import DialogActions from '@mui/material/DialogActions';
11
+ import DialogContent from '@mui/material/DialogContent';
12
+ import DialogTitle from '@mui/material/DialogTitle';
13
+ import TextField from '@mui/material/TextField';
14
+ import Typography from '@mui/material/Typography';
16
15
 
17
16
  function _arrayLikeToArray(r, a) {
18
17
  (null == a || a > r.length) && (a = r.length);
@@ -146,8 +145,10 @@ var mapDispatchToProps$1 = function mapDispatchToProps(dispatch, _ref2) {
146
145
  };
147
146
  };
148
147
  var MiradorPdfMenuItem = function MiradorPdfMenuItem(_ref3) {
149
- var handleClose = _ref3.handleClose,
150
- openDialog = _ref3.openDialog;
148
+ var _ref3$handleClose = _ref3.handleClose,
149
+ handleClose = _ref3$handleClose === void 0 ? function () {} : _ref3$handleClose,
150
+ _ref3$openDialog = _ref3.openDialog,
151
+ openDialog = _ref3$openDialog === void 0 ? function () {} : _ref3$openDialog;
151
152
  var handleClick = function handleClick() {
152
153
  openDialog();
153
154
  handleClose();
@@ -156,7 +157,7 @@ var MiradorPdfMenuItem = function MiradorPdfMenuItem(_ref3) {
156
157
  children: /*#__PURE__*/jsxs(MenuItem, {
157
158
  onClick: handleClick,
158
159
  children: [/*#__PURE__*/jsx(ListItemIcon, {
159
- children: /*#__PURE__*/jsx(PDFIcon, {})
160
+ children: /*#__PURE__*/jsx(PictureAsPdfIcon, {})
160
161
  }), /*#__PURE__*/jsx(ListItemText, {
161
162
  primaryTypographyProps: {
162
163
  variant: "body1"
@@ -166,10 +167,6 @@ var MiradorPdfMenuItem = function MiradorPdfMenuItem(_ref3) {
166
167
  })
167
168
  });
168
169
  };
169
- MiradorPdfMenuItem.defaultProps = {
170
- handleClose: function handleClose() {},
171
- openDialog: function openDialog() {}
172
- };
173
170
  var miradorPdfMenuItem = {
174
171
  target: 'WindowTopBarPluginMenu',
175
172
  mode: 'add',
@@ -213,13 +210,14 @@ var extractUrn = function extractUrn(manifestId) {
213
210
  return withoutLeadingSlash.split(':MANIFEST')[0];
214
211
  };
215
212
  var MiradorPdfDialog = function MiradorPdfDialog(_ref3) {
216
- var open = _ref3.open,
213
+ var _ref3$open = _ref3.open,
214
+ open = _ref3$open === void 0 ? false : _ref3$open,
217
215
  closeDialog = _ref3.closeDialog,
218
216
  manifestId = _ref3.manifestId,
219
217
  totalPages = _ref3.totalPages,
220
218
  pdfAPI = _ref3.pdfAPI,
221
- containerId = _ref3.containerId,
222
- classes = _ref3.classes;
219
+ _ref3$containerId = _ref3.containerId,
220
+ containerId = _ref3$containerId === void 0 ? null : _ref3$containerId;
223
221
  var _useState = useState(''),
224
222
  _useState2 = _slicedToArray(_useState, 2),
225
223
  pages = _useState2[0],
@@ -228,8 +226,6 @@ var MiradorPdfDialog = function MiradorPdfDialog(_ref3) {
228
226
  _useState4 = _slicedToArray(_useState3, 2),
229
227
  error = _useState4[0],
230
228
  setError = _useState4[1];
231
-
232
- // Reset form state whenever the dialog is closed
233
229
  useEffect(function () {
234
230
  if (!open) {
235
231
  setPages('');
@@ -299,12 +295,10 @@ var MiradorPdfDialog = function MiradorPdfDialog(_ref3) {
299
295
  fullWidth: true,
300
296
  maxWidth: "sm",
301
297
  children: [/*#__PURE__*/jsx(DialogTitle, {
302
- disableTypography: true,
303
- className: classes.h2,
304
- children: /*#__PURE__*/jsx(Typography, {
305
- variant: "h2",
306
- children: "PDF Download"
307
- })
298
+ sx: {
299
+ paddingBottom: 0
300
+ },
301
+ children: "PDF Download"
308
302
  }), /*#__PURE__*/jsxs(DialogContent, {
309
303
  children: [/*#__PURE__*/jsx(Typography, {
310
304
  variant: "body1",
@@ -329,7 +323,6 @@ var MiradorPdfDialog = function MiradorPdfDialog(_ref3) {
329
323
  }), /*#__PURE__*/jsxs(DialogActions, {
330
324
  children: [/*#__PURE__*/jsx(Button, {
331
325
  onClick: handleClose,
332
- color: "default",
333
326
  children: "Close"
334
327
  }), /*#__PURE__*/jsx(Button, {
335
328
  onClick: handleDownload,
@@ -340,22 +333,11 @@ var MiradorPdfDialog = function MiradorPdfDialog(_ref3) {
340
333
  })]
341
334
  });
342
335
  };
343
- MiradorPdfDialog.defaultProps = {
344
- open: false,
345
- containerId: null
346
- };
347
- var styles = function styles() {
348
- return {
349
- h2: {
350
- paddingBottom: 0
351
- }
352
- };
353
- };
354
336
  var miradorPdfDialog = {
355
337
  target: 'Window',
356
338
  mode: 'add',
357
339
  name: 'MiradorPdfDialog',
358
- component: withStyles(styles)(MiradorPdfDialog),
340
+ component: MiradorPdfDialog,
359
341
  mapStateToProps: mapStateToProps,
360
342
  mapDispatchToProps: mapDispatchToProps
361
343
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@harvard-lts/mirador-pdf-plugin",
3
- "version": "0.0.2",
4
- "description": "A Mirador 3 plugin that interacts with MPS PDF Download Service ",
3
+ "version": "1.0.0-beta.1",
4
+ "description": "A Mirador 4 plugin that interacts with MPS PDF Download Service",
5
5
  "module": "dist/es/index.js",
6
6
  "files": [
7
7
  "dist"
@@ -26,28 +26,39 @@
26
26
  "license": "Apache-2.0",
27
27
  "homepage": "https://github.com/harvard-lts/mirador-pdf-plugin#readme",
28
28
  "dependencies": {
29
- "jquery": "^3.7.0",
30
- "prop-types": "^15.8.1",
31
- "react": "^16.14.0",
32
- "react-dom": "^16.14.0",
33
- "redux": "^4.2.1",
34
- "redux-saga": "^1.2.3"
29
+ "prop-types": "^15.8.1"
30
+ },
31
+ "peerDependencies": {
32
+ "mirador": "^4.0.0",
33
+ "react": "^18.0.0 || ^19.0.0",
34
+ "react-dom": "^18.0.0 || ^19.0.0",
35
+ "@mui/material": "^7.0.0",
36
+ "@mui/system": "^7.0.0",
37
+ "@emotion/react": "^11.10.6",
38
+ "@emotion/styled": "^11.10.6"
35
39
  },
36
40
  "devDependencies": {
37
41
  "@babel/cli": "^7.26.4",
38
42
  "@babel/core": "^7.26.0",
39
43
  "@babel/preset-env": "^7.21.4",
40
44
  "@babel/preset-react": "^7.18.6",
45
+ "@emotion/react": "^11.10.6",
46
+ "@emotion/styled": "^11.10.6",
47
+ "@mui/material": "^7.0.0",
48
+ "@mui/icons-material": "^7.0.0",
49
+ "@mui/system": "^7.0.0",
41
50
  "@rollup/plugin-babel": "^6.0.3",
42
51
  "@testing-library/jest-dom": "^6.1.5",
43
- "@testing-library/react": "^12.0.0",
44
- "@vitejs/plugin-react": "^4.2.1",
52
+ "@testing-library/react": "^16.0.0",
53
+ "@vitejs/plugin-react": "^5.0.0",
45
54
  "@vitest/coverage-v8": "^1.0.0",
46
55
  "@vitest/ui": "^1.0.0",
47
56
  "jsdom": "^23.0.0",
48
- "mirador": "^3.4.3",
57
+ "mirador": "^4.0.0",
49
58
  "npm-run-all": "^4.1.5",
50
59
  "parcel": "^2.8.3",
60
+ "react": "^18.3.0",
61
+ "react-dom": "^18.3.0",
51
62
  "rollup": "^3.29.5",
52
63
  "url": "^0.11.4",
53
64
  "vite": "^5.0.0",