@harvard-lts/mirador-template-plugin 0.1.24 → 2.0.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.
Files changed (3) hide show
  1. package/README.md +15 -2
  2. package/dist/es/index.js +10 -92
  3. package/package.json +12 -7
package/README.md CHANGED
@@ -1,7 +1,20 @@
1
1
  # mirador-template-plugin
2
2
 
3
+ [![Node Unit Tests](https://github.com/harvard-lts/mirador-template-plugin/actions/workflows/coverage-node.yml/badge.svg)](https://github.com/harvard-lts/mirador-template-plugin/actions/workflows/coverage-node.yml)
4
+
5
+ <a href="https://github.com/harvard-lts/mirador-template-plugin/actions/workflows/coverage-node.yml"><img src="https://github.com/harvard-lts/mirador-template-plugin/raw/badges/test-coverage/coverage.svg"></a>
6
+
3
7
  Template for Harvard mps-viewer Mirador plugins.
4
8
 
9
+ ## Compatibility
10
+
11
+ This plugin is compatible with **Mirador 4** (React 18/19, MUI 7). It is **not**
12
+ backwards compatible with Mirador 3, and upgrading from an older version
13
+ contains breaking changes — internal `mirador/dist/...` imports now resolve from
14
+ the top-level `mirador` package, components use React function/hook patterns, and
15
+ the build/styling stack moved to MUI 7 + Emotion. Mirador 4 versions are tagged
16
+ `2.x`; if you still need Mirador 3 support, pin a `0.x` or `1.x` release.
17
+
5
18
  ## Requirements
6
19
 
7
20
  - [NVM](https://github.com/nvm-sh/nvm)
@@ -24,13 +37,13 @@ The following are some useful scripts can be ran using `npm run <script>`. A ful
24
37
 
25
38
  ## Installing in Mirador
26
39
 
27
- The `mirador-template-plugin` requires an instance of Mirador 3. Visit the [Mirador wiki](https://github.com/ProjectMirador/mirador/wiki) to learn how to [install an existing plugin](https://github.com/ProjectMirador/mirador/wiki/Mirador-3-plugins#installing-an-existing-plugin) and for additional information about plugins.
40
+ The `mirador-template-plugin` requires an instance of Mirador 4. Visit the [Mirador wiki](https://github.com/ProjectMirador/mirador/wiki) to learn how to [create a Mirador 4 plugin](https://github.com/ProjectMirador/mirador/wiki/Creating-a-Mirador-4-Plugin) and for additional information about plugins.
28
41
 
29
42
  Package you will need to install:
30
43
 
31
44
  ```bash
32
45
  npm i @harvard-lts/mirador-template-plugin
33
-
46
+ ```
34
47
 
35
48
  ## Contribute
36
49
  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.
package/dist/es/index.js CHANGED
@@ -1,76 +1,5 @@
1
- import { Component } from 'react';
2
- import { getManifestoInstance } from 'mirador/dist/es/src/state/selectors/manifests';
3
-
4
- function _assertThisInitialized(e) {
5
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
6
- return e;
7
- }
8
- function _callSuper(t, o, e) {
9
- return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
10
- }
11
- function _classCallCheck(a, n) {
12
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
13
- }
14
- function _defineProperties(e, r) {
15
- for (var t = 0; t < r.length; t++) {
16
- var o = r[t];
17
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
18
- }
19
- }
20
- function _createClass(e, r, t) {
21
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
22
- writable: !1
23
- }), e;
24
- }
25
- function _getPrototypeOf(t) {
26
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
27
- return t.__proto__ || Object.getPrototypeOf(t);
28
- }, _getPrototypeOf(t);
29
- }
30
- function _inherits(t, e) {
31
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
32
- t.prototype = Object.create(e && e.prototype, {
33
- constructor: {
34
- value: t,
35
- writable: !0,
36
- configurable: !0
37
- }
38
- }), Object.defineProperty(t, "prototype", {
39
- writable: !1
40
- }), e && _setPrototypeOf(t, e);
41
- }
42
- function _isNativeReflectConstruct() {
43
- try {
44
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
45
- } catch (t) {}
46
- return (_isNativeReflectConstruct = function () {
47
- return !!t;
48
- })();
49
- }
50
- function _possibleConstructorReturn(t, e) {
51
- if (e && ("object" == typeof e || "function" == typeof e)) return e;
52
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
53
- return _assertThisInitialized(t);
54
- }
55
- function _setPrototypeOf(t, e) {
56
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
57
- return t.__proto__ = e, t;
58
- }, _setPrototypeOf(t, e);
59
- }
60
- function _toPrimitive(t, r) {
61
- if ("object" != typeof t || !t) return t;
62
- var e = t[Symbol.toPrimitive];
63
- if (void 0 !== e) {
64
- var i = e.call(t, r || "default");
65
- if ("object" != typeof i) return i;
66
- throw new TypeError("@@toPrimitive must return a primitive value.");
67
- }
68
- return ("string" === r ? String : Number)(t);
69
- }
70
- function _toPropertyKey(t) {
71
- var i = _toPrimitive(t, "string");
72
- return "symbol" == typeof i ? i : i + "";
73
- }
1
+ import { useEffect } from 'react';
2
+ import { getManifestoInstance } from 'mirador';
74
3
 
75
4
  var mapStateToProps = function mapStateToProps(state, _ref) {
76
5
  var windowId = _ref.windowId;
@@ -83,28 +12,17 @@ var mapStateToProps = function mapStateToProps(state, _ref) {
83
12
  })
84
13
  };
85
14
  };
86
- var miradorTemplate = /*#__PURE__*/function (_Component) {
87
- function miradorTemplate() {
88
- _classCallCheck(this, miradorTemplate);
89
- return _callSuper(this, miradorTemplate, arguments);
90
- }
91
- _inherits(miradorTemplate, _Component);
92
- return _createClass(miradorTemplate, [{
93
- key: "render",
94
- value: function render() {
95
- return "";
96
- }
97
- }, {
98
- key: "componentDidMount",
99
- value: function componentDidMount() {
100
- // Add custom stuff here
101
- }
102
- }]);
103
- }(Component);
15
+ function MiradorTemplate() {
16
+ useEffect(function () {
17
+ // Add custom stuff here
18
+ }, []);
19
+ return null;
20
+ }
104
21
  var miradorTemplatePlugin = {
22
+ name: 'MiradorTemplatePlugin',
105
23
  target: 'Window',
106
24
  mode: 'add',
107
- component: miradorTemplate,
25
+ component: MiradorTemplate,
108
26
  mapStateToProps: mapStateToProps
109
27
  };
110
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harvard-lts/mirador-template-plugin",
3
- "version": "0.1.24",
3
+ "version": "2.0.0",
4
4
  "description": "Template for Harvard mps-viewer Mirador plugins",
5
5
  "module": "dist/es/index.js",
6
6
  "files": [
@@ -14,6 +14,7 @@
14
14
  "build:es": "rollup -c",
15
15
  "serve": "vite",
16
16
  "test": "vitest run",
17
+ "test:unit": "node scripts/coverage-ci.mjs",
17
18
  "test:coverage": "vitest run --coverage",
18
19
  "test:watch": "vitest"
19
20
  },
@@ -26,12 +27,16 @@
26
27
  "license": "Apache-2.0",
27
28
  "homepage": "https://github.com/harvard-lts/mirador-template-plugin#readme",
28
29
  "dependencies": {
30
+ "@emotion/react": "^11.11.0",
31
+ "@emotion/styled": "^11.11.0",
32
+ "@mui/material": "^7.0.0",
33
+ "@mui/system": "^7.0.0",
29
34
  "jquery": "^3.7.0",
30
- "node": "^22.22.3",
31
35
  "prop-types": "^15.8.1",
32
- "react": "^16.14.0",
33
- "react-dom": "^16.14.0",
34
- "redux": "^4.2.1",
36
+ "react": "^19.0.0",
37
+ "react-dom": "^19.0.0",
38
+ "react-i18next": "^15.0.0",
39
+ "redux": "^5.0.0",
35
40
  "redux-saga": "^1.2.3"
36
41
  },
37
42
  "devDependencies": {
@@ -41,12 +46,12 @@
41
46
  "@babel/preset-react": "^7.18.6",
42
47
  "@rollup/plugin-babel": "^6.0.3",
43
48
  "@testing-library/jest-dom": "^6.1.5",
44
- "@testing-library/react": "^12.0.0",
49
+ "@testing-library/react": "^16.0.0",
45
50
  "@vitejs/plugin-react": "^5.1.2",
46
51
  "@vitest/coverage-v8": "^4.0.17",
47
52
  "@vitest/ui": "^4.0.17",
48
53
  "jsdom": "^23.0.0",
49
- "mirador": "^3.4.3",
54
+ "mirador": "^4.1.0",
50
55
  "npm-run-all": "^4.1.5",
51
56
  "parcel": "^2.8.3",
52
57
  "rollup": "^3.29.5",