mirador-dl-plugin 0.12.0 → 0.14.0

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/README.md CHANGED
@@ -1,20 +1,29 @@
1
- # mirador-download-plugin
1
+ # mirador-dl-plugin
2
2
 
3
3
  [![Travis][build-badge]][build]
4
4
  [![npm package][npm-badge]][npm]
5
5
  [![Coveralls][coveralls-badge]][coveralls]
6
6
 
7
- Describe mirador-download-plugin here.
7
+ `mirador-dl-plugin` is a Mirador 3 plugin that adds manifest-provided download links (e.g. `rendering`) to the window options menu. A [live demo](https://mirador-download-plugin.netlify.app/) with several institutions' manifests is available for testing.
8
8
 
9
- [build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square
10
- [build]: https://travis-ci.org/user/repo
9
+ ![download option in menu](https://user-images.githubusercontent.com/5402927/87057974-5e665a80-c1bc-11ea-8f10-7b783bdc972f.png)
11
10
 
12
- [npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square
13
- [npm]: https://www.npmjs.org/package/npm-package
11
+ ![mirador-download-options](https://user-images.githubusercontent.com/5402927/87057857-3d056e80-c1bc-11ea-8860-7662208c19fa.png)
12
+
13
+
14
+ [build-badge]: https://img.shields.io/travis/projectmirador/mirador-dl-plugin/master.png?style=flat-square
15
+ [build]: https://travis-ci.org/projectmirador/mirador-dl-plugin
16
+
17
+ [npm-badge]: https://img.shields.io/npm/v/mirador-dl-plugin.png?style=flat-square
18
+ [npm]: https://www.npmjs.org/package/mirador-dl-plugin
14
19
 
15
20
  [coveralls-badge]: https://img.shields.io/coveralls/user/repo/master.png?style=flat-square
16
21
  [coveralls]: https://coveralls.io/github/user/repo
17
22
 
23
+ ## Installation
24
+
25
+ `mirador-dl-plugin` requires an instance of Mirador 3. See the [Mirador wiki](https://github.com/ProjectMirador/mirador/wiki) for examples of embedding Mirador within an application and additional information about plugins. See the [live demo's index.js](https://github.com/ProjectMirador/mirador-dl-plugin/blob/master/demo/src/index.js) for an example of importing and configuring `mirador-dl-plugin`.
26
+
18
27
  ## Configuration
19
28
 
20
29
  Configurations for this plugin are injected when Mirador is initialized under the `miradorDownloadPlugin` key.
@@ -31,3 +40,6 @@ Configurations for this plugin are injected when Mirador is initialized under th
31
40
  | Config Key | Type | Description |
32
41
  | --- | --- | --- |
33
42
  | `restrictDownloadOnSizeDefinition` | boolean (default: false) | If set to true the `Zoomed region` link will not be rendered if the image API returns a single size in the `sizes` section and the single size height/width is the same size or smaller than the reported height/width. |
43
+
44
+ ## Contribute
45
+ Mirador's development, design, and maintenance is driven by community needs and ongoing feedback and discussion. Join us at our regularly scheduled community calls, on [IIIF slack #mirador](http://bit.ly/iiif-slack), or the [mirador-tech](https://groups.google.com/forum/#!forum/mirador-tech) and [iiif-discuss](https://groups.google.com/forum/#!forum/iiif-discuss) mailing lists. To suggest features, report bugs, and clarify usage, please submit a GitHub issue.
@@ -35,9 +35,7 @@ var RenderingDownloadLink = function (_Component) {
35
35
  React.createElement(
36
36
  Link,
37
37
  { href: rendering.id, rel: 'noopener noreferrer', target: '_blank', variant: 'body1' },
38
- rendering.getLabel().map(function (label) {
39
- return label.value;
40
- })[0]
38
+ rendering.getLabel().getValue()
41
39
  ),
42
40
  rendering.getFormat() && rendering.getFormat().value && ' (' + rendering.getFormat().value + ')'
43
41
  )
package/es/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import miradorDownloadPlugin from './miradorDownloadPlugin';
2
2
  import MiradorDownloadDialogPlugin from './MiradorDownloadDialog';
3
3
 
4
- export default {
5
- miradorDownloadPlugin: miradorDownloadPlugin,
6
- MiradorDownloadDialogPlugin: MiradorDownloadDialogPlugin
7
- };
4
+ export { miradorDownloadPlugin, MiradorDownloadDialogPlugin };
5
+
6
+ export default [miradorDownloadPlugin, MiradorDownloadDialogPlugin];
@@ -55,9 +55,7 @@ var RenderingDownloadLink = function (_Component) {
55
55
  _react2.default.createElement(
56
56
  _Link2.default,
57
57
  { href: rendering.id, rel: 'noopener noreferrer', target: '_blank', variant: 'body1' },
58
- rendering.getLabel().map(function (label) {
59
- return label.value;
60
- })[0]
58
+ rendering.getLabel().getValue()
61
59
  ),
62
60
  rendering.getFormat() && rendering.getFormat().value && ' (' + rendering.getFormat().value + ')'
63
61
  )
package/lib/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  exports.__esModule = true;
4
+ exports.MiradorDownloadDialogPlugin = exports.miradorDownloadPlugin = undefined;
4
5
 
5
6
  var _miradorDownloadPlugin = require('./miradorDownloadPlugin');
6
7
 
@@ -12,8 +13,6 @@ var _MiradorDownloadDialog2 = _interopRequireDefault(_MiradorDownloadDialog);
12
13
 
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15
 
15
- exports.default = {
16
- miradorDownloadPlugin: _miradorDownloadPlugin2.default,
17
- MiradorDownloadDialogPlugin: _MiradorDownloadDialog2.default
18
- };
19
- module.exports = exports['default'];
16
+ exports.miradorDownloadPlugin = _miradorDownloadPlugin2.default;
17
+ exports.MiradorDownloadDialogPlugin = _MiradorDownloadDialog2.default;
18
+ exports.default = [_miradorDownloadPlugin2.default, _MiradorDownloadDialog2.default];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mirador-dl-plugin",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "mirador-dl-plugin React component",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -11,47 +11,42 @@
11
11
  "umd"
12
12
  ],
13
13
  "scripts": {
14
- "build": "nwb build-react-component",
15
- "clean": "nwb clean-module && nwb clean-demo",
16
- "lint": "npx eslint ./",
14
+ "clean": "rm -rf ./dist && rm -rf ./demo/dist",
15
+ "prebuild": "npm run clean",
17
16
  "prepublishOnly": "npm run build",
18
- "start": "nwb serve-react-demo",
19
- "test": "npm run lint && jest",
20
- "test:coverage": "jest --coverage",
21
- "test:watch": "jest --watch"
22
- },
23
- "peerDependencies": {
24
- "@material-ui/core": "^4.9.11",
25
- "@material-ui/icons": "^4.9.1",
26
- "lodash": "^4.17.11",
27
- "mirador": "^3.0.0-rc.1",
28
- "prop-types": "^15.7.2",
29
- "react": "16.x",
30
- "react-dom": "16.x"
17
+ "build": "run-p build:es",
18
+ "build:es": "rollup -c",
19
+ "serve": "vite",
20
+ "test": "vitest run",
21
+ "test:coverage": "vitest run --coverage",
22
+ "test:watch": "vitest"
31
23
  },
32
24
  "devDependencies": {
33
- "@babel/core": "^7.7.2",
34
- "@babel/preset-env": "^7.7.1",
35
- "@babel/preset-react": "^7.7.0",
36
- "@material-ui/core": "^4.9.11",
25
+ "@babel/cli": "^7.26.4",
26
+ "@babel/core": "^7.26.0",
27
+ "@babel/preset-env": "^7.21.4",
28
+ "@babel/preset-react": "^7.18.6",
29
+ "@material-ui/core": "^4.11.0",
37
30
  "@material-ui/icons": "^4.9.1",
38
- "babel-eslint": "^10.0.3",
39
- "babel-jest": "^24.9.0",
31
+ "@rollup/plugin-babel": "^6.0.3",
32
+ "@testing-library/jest-dom": "^6.1.5",
33
+ "@testing-library/react": "^12.0.0",
34
+ "@testing-library/user-event": "^14.6.1",
35
+ "@vitejs/plugin-react": "^5.1.2",
36
+ "@vitest/coverage-v8": "^4.0.17",
37
+ "@vitest/ui": "^4.0.17",
40
38
  "enzyme": "^3.9.0",
41
39
  "enzyme-adapter-react-16": "^1.15.1",
42
- "eslint": "^5.3.0",
43
- "eslint-config-airbnb": "^17.1.1",
44
- "eslint-plugin-import": "^2.18.2",
45
- "eslint-plugin-jest": "^22.21.0",
46
- "eslint-plugin-jsx-a11y": "^6.2.3",
47
- "eslint-plugin-react": "^7.16.0",
48
- "jest": "^24.9.0",
40
+ "jsdom": "^27.4.0",
49
41
  "lodash": "^4.17.15",
50
- "mirador": "^3.0.0-rc.1",
51
- "nwb": "0.23.x",
52
- "prop-types": "^15.7.2",
53
- "react": "^16.12.0",
54
- "react-dom": "^16.12.0"
42
+ "mirador": "^3.4.3",
43
+ "npm-run-all": "^4.1.5",
44
+ "parcel": "^2.8.3",
45
+ "rollup": "^3.29.5",
46
+ "url": "^0.11.4",
47
+ "vite": "^7.3.1",
48
+ "vitest": "^4.0.17",
49
+ "whatwg-fetch": "^3.6.20"
55
50
  },
56
51
  "author": "",
57
52
  "homepage": "",
@@ -59,5 +54,16 @@
59
54
  "repository": "",
60
55
  "keywords": [
61
56
  "react-component"
62
- ]
57
+ ],
58
+ "dependencies": {
59
+ "@material-ui/core": "^4.11.0",
60
+ "@material-ui/icons": "^4.9.1",
61
+ "jquery": "^3.7.0",
62
+ "lodash": "^4.17.11",
63
+ "prop-types": "^15.8.1",
64
+ "react": "^16.14.0",
65
+ "react-dom": "^16.14.0",
66
+ "redux": "^4.2.1",
67
+ "redux-saga": "^1.2.3"
68
+ }
63
69
  }