@harvard-lts/mirador-template-plugin 0.1.23 → 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.
- package/README.md +15 -2
- package/dist/es/index.js +10 -93
- package/package.json +17 -11
package/README.md
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
# mirador-template-plugin
|
|
2
2
|
|
|
3
|
+
[](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
|
|
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,77 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getManifestoInstance } from 'mirador
|
|
3
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
function _assertThisInitialized(e) {
|
|
6
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7
|
-
return e;
|
|
8
|
-
}
|
|
9
|
-
function _callSuper(t, o, e) {
|
|
10
|
-
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
11
|
-
}
|
|
12
|
-
function _classCallCheck(a, n) {
|
|
13
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
15
|
-
function _defineProperties(e, r) {
|
|
16
|
-
for (var t = 0; t < r.length; t++) {
|
|
17
|
-
var o = r[t];
|
|
18
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function _createClass(e, r, t) {
|
|
22
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
23
|
-
writable: !1
|
|
24
|
-
}), e;
|
|
25
|
-
}
|
|
26
|
-
function _getPrototypeOf(t) {
|
|
27
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
28
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
29
|
-
}, _getPrototypeOf(t);
|
|
30
|
-
}
|
|
31
|
-
function _inherits(t, e) {
|
|
32
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
33
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
34
|
-
constructor: {
|
|
35
|
-
value: t,
|
|
36
|
-
writable: !0,
|
|
37
|
-
configurable: !0
|
|
38
|
-
}
|
|
39
|
-
}), Object.defineProperty(t, "prototype", {
|
|
40
|
-
writable: !1
|
|
41
|
-
}), e && _setPrototypeOf(t, e);
|
|
42
|
-
}
|
|
43
|
-
function _isNativeReflectConstruct() {
|
|
44
|
-
try {
|
|
45
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
46
|
-
} catch (t) {}
|
|
47
|
-
return (_isNativeReflectConstruct = function () {
|
|
48
|
-
return !!t;
|
|
49
|
-
})();
|
|
50
|
-
}
|
|
51
|
-
function _possibleConstructorReturn(t, e) {
|
|
52
|
-
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
53
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
54
|
-
return _assertThisInitialized(t);
|
|
55
|
-
}
|
|
56
|
-
function _setPrototypeOf(t, e) {
|
|
57
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
58
|
-
return t.__proto__ = e, t;
|
|
59
|
-
}, _setPrototypeOf(t, e);
|
|
60
|
-
}
|
|
61
|
-
function _toPrimitive(t, r) {
|
|
62
|
-
if ("object" != typeof t || !t) return t;
|
|
63
|
-
var e = t[Symbol.toPrimitive];
|
|
64
|
-
if (void 0 !== e) {
|
|
65
|
-
var i = e.call(t, r || "default");
|
|
66
|
-
if ("object" != typeof i) return i;
|
|
67
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
68
|
-
}
|
|
69
|
-
return ("string" === r ? String : Number)(t);
|
|
70
|
-
}
|
|
71
|
-
function _toPropertyKey(t) {
|
|
72
|
-
var i = _toPrimitive(t, "string");
|
|
73
|
-
return "symbol" == typeof i ? i : i + "";
|
|
74
|
-
}
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { getManifestoInstance } from 'mirador';
|
|
75
3
|
|
|
76
4
|
var mapStateToProps = function mapStateToProps(state, _ref) {
|
|
77
5
|
var windowId = _ref.windowId;
|
|
@@ -84,28 +12,17 @@ var mapStateToProps = function mapStateToProps(state, _ref) {
|
|
|
84
12
|
})
|
|
85
13
|
};
|
|
86
14
|
};
|
|
87
|
-
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return _createClass(miradorTemplate, [{
|
|
94
|
-
key: "render",
|
|
95
|
-
value: function render() {
|
|
96
|
-
return /*#__PURE__*/jsx(Fragment, {});
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
key: "componentDidMount",
|
|
100
|
-
value: function componentDidMount() {
|
|
101
|
-
// Add custom stuff here
|
|
102
|
-
}
|
|
103
|
-
}]);
|
|
104
|
-
}(Component);
|
|
15
|
+
function MiradorTemplate() {
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
// Add custom stuff here
|
|
18
|
+
}, []);
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
105
21
|
var miradorTemplatePlugin = {
|
|
22
|
+
name: 'MiradorTemplatePlugin',
|
|
106
23
|
target: 'Window',
|
|
107
24
|
mode: 'add',
|
|
108
|
-
component:
|
|
25
|
+
component: MiradorTemplate,
|
|
109
26
|
mapStateToProps: mapStateToProps
|
|
110
27
|
};
|
|
111
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harvard-lts/mirador-template-plugin",
|
|
3
|
-
"version": "0.
|
|
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,11 +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
35
|
"prop-types": "^15.8.1",
|
|
31
|
-
"react": "^
|
|
32
|
-
"react-dom": "^
|
|
33
|
-
"
|
|
36
|
+
"react": "^19.0.0",
|
|
37
|
+
"react-dom": "^19.0.0",
|
|
38
|
+
"react-i18next": "^15.0.0",
|
|
39
|
+
"redux": "^5.0.0",
|
|
34
40
|
"redux-saga": "^1.2.3"
|
|
35
41
|
},
|
|
36
42
|
"devDependencies": {
|
|
@@ -40,17 +46,17 @@
|
|
|
40
46
|
"@babel/preset-react": "^7.18.6",
|
|
41
47
|
"@rollup/plugin-babel": "^6.0.3",
|
|
42
48
|
"@testing-library/jest-dom": "^6.1.5",
|
|
43
|
-
"@testing-library/react": "^
|
|
44
|
-
"@vitejs/plugin-react": "^
|
|
45
|
-
"@vitest/coverage-v8": "^
|
|
46
|
-
"@vitest/ui": "^
|
|
49
|
+
"@testing-library/react": "^16.0.0",
|
|
50
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
51
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
52
|
+
"@vitest/ui": "^4.0.17",
|
|
47
53
|
"jsdom": "^23.0.0",
|
|
48
|
-
"mirador": "^
|
|
54
|
+
"mirador": "^4.1.0",
|
|
49
55
|
"npm-run-all": "^4.1.5",
|
|
50
56
|
"parcel": "^2.8.3",
|
|
51
57
|
"rollup": "^3.29.5",
|
|
52
58
|
"url": "^0.11.4",
|
|
53
|
-
"vite": "^
|
|
54
|
-
"vitest": "^
|
|
59
|
+
"vite": "^8.0.16",
|
|
60
|
+
"vitest": "^4.0.17"
|
|
55
61
|
}
|
|
56
62
|
}
|