mirador-annotation-editor-video 0.0.6 → 0.0.9
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 +4 -1
- package/demo/src/index.html +1 -1
- package/demo/src/index.js +18 -15
- package/es/plugin/MiradorAnnotationEditionVideoPlugin.js +47 -12
- package/es/wrapper/AnnotationCreationCompanionWindowWrapper.js +72 -49
- package/es/wrapper/AnnotationCreationWindowWrapper.js +37 -22
- package/package.json +13 -8
- package/webpack.config.js +0 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ You need to use our custom Mirador 4 version. https://github.com/SCENE-CE/mirado
|
|
|
61
61
|
|
|
62
62
|
```js
|
|
63
63
|
"mirador": "npm:mirador-video@^1.0.6",
|
|
64
|
-
"mirador-annotations": "npm:mirador-annotation-editor-video@^0.0.
|
|
64
|
+
"mirador-annotations": "npm:mirador-annotation-editor-video@^0.0.7",
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
You can find an example of integration in our Mirador-integration repository :
|
|
@@ -90,7 +90,10 @@ Run a demo with Mirador and the MAEV plugin :
|
|
|
90
90
|
```
|
|
91
91
|
npm start
|
|
92
92
|
```
|
|
93
|
+
## Full working Mirador environnement
|
|
93
94
|
|
|
95
|
+
We develop a Mirador Multi User (MMU) environnement : [https://github.com/SCENE-CE/mirador-multi-user](https://github.com/SCENE-CE/mirador-multi-user).
|
|
96
|
+
MMU come out of the box with our custom [Mirador Video](https://github.com/SCENE-CE/mirador-video) (Mirador 4 with custom code) and the MAEV plugin.
|
|
94
97
|
|
|
95
98
|
## Persisting Annotations
|
|
96
99
|
Persisting annotations requires implementing a IIIF annotation server. Several
|
package/demo/src/index.html
CHANGED
package/demo/src/index.js
CHANGED
|
@@ -3,25 +3,28 @@ import LocalStorageAdapter from 'mirador-annotations/src/annotationAdapter/Local
|
|
|
3
3
|
import MiradorAnnotationEditionVideoPlugin from '../../src/plugin/MiradorAnnotationEditionVideoPlugin'
|
|
4
4
|
|
|
5
5
|
const config = {
|
|
6
|
-
|
|
6
|
+
id: 'demo',
|
|
7
7
|
catalog: [
|
|
8
|
-
{
|
|
9
|
-
{
|
|
8
|
+
{manifestId: 'https://purl.stanford.edu/sn904cj3429/iiif/manifest'},
|
|
9
|
+
{manifestId: 'https://files.tetras-libre.fr/dev/Clock/manifest.json'},
|
|
10
|
+
{manifestId: 'https://files.tetras-libre.fr/dev/Heterogeneous-media-on-several-canvases.json'},
|
|
11
|
+
{manifestId: "https://dzkimgs.l.u-tokyo.ac.jp/videos/cat2020/manifest.json"},
|
|
12
|
+
{manifestId: "https://files.tetras-libre.fr/dev/vertical_video_with_annot.json"}
|
|
10
13
|
],
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
theme: {
|
|
15
|
+
palette: {
|
|
16
|
+
primary: {
|
|
17
|
+
main: '#6e8678',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
annotation: {
|
|
22
|
+
adapter: (canvasId) => new LocalStorageAdapter(`localStorage://?canvasId=${canvasId}`),
|
|
23
|
+
// adapter: (canvasId) => new AnnototAdapter(canvasId, endpointUrl),
|
|
24
|
+
exportLocalStorageAnnotations: false, // display annotation JSON export button
|
|
16
25
|
},
|
|
17
|
-
},
|
|
18
|
-
annotation: {
|
|
19
|
-
adapter: (canvasId) => new LocalStorageAdapter(`localStorage://?canvasId=${canvasId}`),
|
|
20
|
-
// adapter: (canvasId) => new AnnototAdapter(canvasId, endpointUrl),
|
|
21
|
-
exportLocalStorageAnnotations: false, // display annotation JSON export button
|
|
22
|
-
},
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
Mirador.viewer(config, [
|
|
26
|
-
|
|
29
|
+
...MiradorAnnotationEditionVideoPlugin,
|
|
27
30
|
]);
|
|
@@ -1,13 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
import externalStorageAnnotationPlugin from 'mirador-annotations/src/plugins/externalStorageAnnotationPlugin';
|
|
3
|
-
import canvasAnnotationsPlugin from 'mirador-annotations/src/plugins/canvasAnnotationsPlugin';
|
|
4
|
-
import annotationCreationCompanionWindow from 'mirador-annotations/src/plugins/annotationCreationCompanionWindow';
|
|
5
|
-
import windowSideBarButtonsPlugin from 'mirador-annotations/src/plugins/windowSideBarButtonsPlugin';
|
|
6
|
-
import AnnotationCreationCompanionWindowWrapper from "../wrapper/AnnotationCreationCompanionWindowWrapper";
|
|
7
|
-
export { AnnotationCreationWindowWrapper, externalStorageAnnotationPlugin, canvasAnnotationsPlugin, AnnotationCreationCompanionWindowWrapper, windowSideBarButtonsPlugin };
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AnnotationCreationCompanionWindowWrapper", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AnnotationCreationCompanionWindowWrapper.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AnnotationCreationWindowWrapper", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _AnnotationCreationWindowWrapper.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "canvasAnnotationsPlugin", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _canvasAnnotationsPlugin.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
exports.default = void 0;
|
|
25
|
+
Object.defineProperty(exports, "externalStorageAnnotationPlugin", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _externalStorageAnnotationPlugin.default;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "windowSideBarButtonsPlugin", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _windowSideBarButtonsPlugin.default;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var _AnnotationCreationWindowWrapper = _interopRequireDefault(require("../wrapper/AnnotationCreationWindowWrapper"));
|
|
38
|
+
var _externalStorageAnnotationPlugin = _interopRequireDefault(require("mirador-annotations/src/plugins/externalStorageAnnotationPlugin"));
|
|
39
|
+
var _canvasAnnotationsPlugin = _interopRequireDefault(require("mirador-annotations/src/plugins/canvasAnnotationsPlugin"));
|
|
40
|
+
var _annotationCreationCompanionWindow = _interopRequireDefault(require("mirador-annotations/src/plugins/annotationCreationCompanionWindow"));
|
|
41
|
+
var _windowSideBarButtonsPlugin = _interopRequireDefault(require("mirador-annotations/src/plugins/windowSideBarButtonsPlugin"));
|
|
42
|
+
var _AnnotationCreationCompanionWindowWrapper = _interopRequireDefault(require("../wrapper/AnnotationCreationCompanionWindowWrapper"));
|
|
43
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
44
|
+
var _default = exports.default = [{
|
|
45
|
+
component: _AnnotationCreationWindowWrapper.default,
|
|
46
|
+
mode: 'wrap',
|
|
47
|
+
target: 'AnnotationSettings'
|
|
48
|
+
}, _externalStorageAnnotationPlugin.default, _canvasAnnotationsPlugin.default, _AnnotationCreationCompanionWindowWrapper.default, _windowSideBarButtonsPlugin.default];
|
|
@@ -1,58 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
import { getCompanionWindow } from 'mirador/dist/es/src/state/selectors/companionWindows';
|
|
3
|
-
import { getVisibleCanvasAudioResources, getVisibleCanvases } from 'mirador/dist/es/src/state/selectors/canvases';
|
|
4
|
-
import { getPresentAnnotationsOnSelectedCanvases } from 'mirador/dist/es/src/state/selectors/annotations';
|
|
5
|
-
import annotationForm from 'mirador-annotations/src/annotationForm/AnnotationForm';
|
|
6
|
-
import { playerReferences } from 'mirador-annotations/src/playerReferences';
|
|
7
|
-
import { OSDReferences } from 'mirador/dist/es/src/plugins/OSDReferences';
|
|
8
|
-
import { VideosReferences } from "mirador/dist/es/src/plugins/VideosReferences";
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var actions = _interopRequireWildcard(require("mirador/dist/es/src/state/actions"));
|
|
8
|
+
var _companionWindows = require("mirador/dist/es/src/state/selectors/companionWindows");
|
|
9
|
+
var _canvases = require("mirador/dist/es/src/state/selectors/canvases");
|
|
10
|
+
var _annotations = require("mirador/dist/es/src/state/selectors/annotations");
|
|
11
|
+
var _AnnotationForm = _interopRequireDefault(require("mirador-annotations/src/annotationForm/AnnotationForm"));
|
|
12
|
+
var _playerReferences = require("mirador-annotations/src/playerReferences");
|
|
13
|
+
var _OSDReferences = require("mirador/dist/es/src/plugins/OSDReferences");
|
|
14
|
+
var _VideosReferences = require("mirador/dist/es/src/plugins/VideosReferences");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
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; }
|
|
10
18
|
/** */
|
|
11
|
-
const mapDispatchToProps = (dispatch, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
const mapDispatchToProps = (dispatch, {
|
|
20
|
+
id,
|
|
21
|
+
windowId
|
|
22
|
+
}) => ({
|
|
23
|
+
closeCompanionWindow: () => dispatch(actions.removeCompanionWindow(windowId, id)),
|
|
24
|
+
receiveAnnotation: (targetId, annoId, annotation) => dispatch(actions.receiveAnnotation(targetId, annoId, annotation))
|
|
25
|
+
// setCurrentTime: (...args) => dispatch(actions.setWindowCurrentTime(windowId, ...args)),
|
|
26
|
+
// setSeekTo: (...args) => dispatch(actions.setWindowSeekTo(windowId, ...args)),
|
|
16
27
|
});
|
|
17
28
|
|
|
18
29
|
/** */
|
|
19
|
-
function mapStateToProps(state, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
function mapStateToProps(state, {
|
|
31
|
+
id: companionWindowId,
|
|
32
|
+
windowId
|
|
33
|
+
}) {
|
|
34
|
+
const currentTime = null;
|
|
35
|
+
const cw = (0, _companionWindows.getCompanionWindow)(state, {
|
|
36
|
+
companionWindowId,
|
|
37
|
+
windowId
|
|
38
|
+
});
|
|
39
|
+
const {
|
|
40
|
+
annotationid
|
|
41
|
+
} = cw;
|
|
42
|
+
const canvases = (0, _canvases.getVisibleCanvases)(state, {
|
|
43
|
+
windowId
|
|
44
|
+
});
|
|
45
|
+
if (canvases[0].__jsonld.items) {
|
|
46
|
+
_playerReferences.playerReferences.init(state, windowId, _VideosReferences.VideosReferences, actions);
|
|
47
|
+
} else {
|
|
48
|
+
_playerReferences.playerReferences.init(state, windowId, _OSDReferences.OSDReferences, actions);
|
|
49
|
+
}
|
|
50
|
+
console.log('overlay :', _playerReferences.playerReferences.getOverlay());
|
|
51
|
+
console.log('mediaType :', _playerReferences.playerReferences.getMediaType());
|
|
52
|
+
// This could be removed but it's serve the useEffect in AnnotationForm for now.
|
|
53
|
+
let annotation = (0, _annotations.getPresentAnnotationsOnSelectedCanvases)(state, {
|
|
54
|
+
windowId
|
|
55
|
+
}).flatMap(annoPage => annoPage.json.items || []).find(annot => annot.id === annotationid);
|
|
43
56
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
// New annotation has no ID and no templateType defined
|
|
58
|
+
if (!annotation) {
|
|
59
|
+
annotation = {
|
|
60
|
+
id: null,
|
|
61
|
+
maeData: {
|
|
62
|
+
templateType: null
|
|
63
|
+
}
|
|
50
64
|
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
currentTime,
|
|
68
|
+
annotation,
|
|
69
|
+
canvases,
|
|
70
|
+
config: state.config,
|
|
71
|
+
getMediaAudio: (0, _canvases.getVisibleCanvasAudioResources)(state, {
|
|
72
|
+
windowId
|
|
73
|
+
})
|
|
74
|
+
};
|
|
51
75
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
mapStateToProps
|
|
76
|
+
var _default = exports.default = {
|
|
77
|
+
companionWindowKey: 'annotationCreation',
|
|
78
|
+
component: _AnnotationForm.default,
|
|
79
|
+
mapDispatchToProps,
|
|
80
|
+
mapStateToProps
|
|
58
81
|
};
|
|
@@ -1,28 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _redux = require("redux");
|
|
8
|
+
var _reactRedux = require("react-redux");
|
|
9
|
+
var _selectors = require("mirador/dist/es/src/state/selectors");
|
|
10
|
+
var _canvases = require("mirador/dist/es/src/state/selectors/canvases");
|
|
11
|
+
var _companionWindows = require("mirador/dist/es/src/state/selectors/companionWindows");
|
|
6
12
|
const MiradorAnnotation = require('mirador-annotations/src/plugins/miradorAnnotationPlugin').default;
|
|
7
13
|
// TODO use selector in main componenent
|
|
8
14
|
/**
|
|
9
15
|
* this function map the state to the annotationPlugin's props
|
|
10
16
|
* */
|
|
11
|
-
function mapStateToProps(state, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
function mapStateToProps(state, {
|
|
18
|
+
targetProps: {
|
|
19
|
+
windowId
|
|
20
|
+
}
|
|
21
|
+
}) {
|
|
22
|
+
// Annotation edit companion window ou annotation creation companion window is the same thing
|
|
23
|
+
const annotationCreationCompanionWindows = (0, _companionWindows.getCompanionWindowsForContent)(state, {
|
|
24
|
+
content: 'annotationCreation',
|
|
25
|
+
windowId
|
|
26
|
+
});
|
|
27
|
+
let annotationEditCompanionWindowIsOpened = true;
|
|
28
|
+
if (Object.keys(annotationCreationCompanionWindows).length !== 0) {
|
|
29
|
+
annotationEditCompanionWindowIsOpened = false;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
annotationEditCompanionWindowIsOpened,
|
|
33
|
+
canvases: (0, _canvases.getVisibleCanvases)(state, {
|
|
34
|
+
windowId
|
|
35
|
+
}),
|
|
36
|
+
config: state.config,
|
|
37
|
+
windowViewType: (0, _selectors.getWindowViewType)(state, {
|
|
38
|
+
windowId
|
|
39
|
+
})
|
|
40
|
+
};
|
|
24
41
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export default enhance(MiradorAnnotation);
|
|
42
|
+
const enhance = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps));
|
|
43
|
+
var _default = exports.default = enhance(MiradorAnnotation);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mirador-annotation-editor-video",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Mirador 4 plugin wrapping Mirador Annotation Editor plugin and adding video annotation support",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -22,24 +22,24 @@
|
|
|
22
22
|
"test:ci": "jest --ci --reporters=default --reporters=jest-junit --watchAll=false"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"mirador": "npm:mirador-video
|
|
26
|
-
"mirador-annotations": "npm:mirador-annotation-editor
|
|
25
|
+
"mirador": "npm:mirador-video@1.0.8",
|
|
26
|
+
"mirador-annotations": "npm:mirador-annotation-editor@1.0.34"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"lodash": "^4.17.11",
|
|
30
|
-
"mirador": "npm:mirador-video@^1.0.6",
|
|
31
|
-
"mirador-annotations": "npm:mirador-annotation-editor@^1.0.22-mirador-video-based",
|
|
32
30
|
"react": "^18.2.0",
|
|
33
31
|
"react-dom": "^18.0.0"
|
|
34
32
|
},
|
|
35
33
|
"devDependencies": {
|
|
36
|
-
"@babel/
|
|
34
|
+
"@babel/cli": "^7.25.9",
|
|
35
|
+
"@babel/core": "^7.26.0",
|
|
36
|
+
"@babel/node": "^7.26.0",
|
|
37
37
|
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
38
38
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
39
|
-
"@babel/
|
|
39
|
+
"@babel/polyfill": "^7.12.1",
|
|
40
|
+
"@babel/preset-env": "^7.26.0",
|
|
40
41
|
"@babel/preset-react": "^7.24.6",
|
|
41
42
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.13",
|
|
42
|
-
"babel-cli": "^6.26.0",
|
|
43
43
|
"css-loader": "^7.1.2",
|
|
44
44
|
"html-webpack-plugin": "^5.6.0",
|
|
45
45
|
"react": "^18.2.0",
|
|
@@ -51,6 +51,11 @@
|
|
|
51
51
|
"webpack-dev-server": "^4.15.2",
|
|
52
52
|
"webpack-plugin": "^1.0.5"
|
|
53
53
|
},
|
|
54
|
+
"overrides": {
|
|
55
|
+
"mirador-annotations": {
|
|
56
|
+
"mirador": "npm:mirador-video@^1.0.7"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
54
59
|
"author": "",
|
|
55
60
|
"homepage": "",
|
|
56
61
|
"license": "Apache-2.0",
|