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 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.5",
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
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
- <title>Title</title>
5
+ <title>MAEV - Mirador Annotation Editor Video</title>
6
6
  </head>
7
7
  <body>
8
8
  <div id="demo">
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
- id: 'demo',
6
+ id: 'demo',
7
7
  catalog: [
8
- { manifestId: 'https://purl.stanford.edu/sn904cj3429/iiif/manifest' },
9
- { manifestId: 'https://files.tetras-libre.fr/dev/Clock/manifest.json'}
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
- theme: {
12
- palette: {
13
- primary: {
14
- main: '#6e8678',
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
- ...MiradorAnnotationEditionVideoPlugin,
29
+ ...MiradorAnnotationEditionVideoPlugin,
27
30
  ]);
@@ -1,13 +1,48 @@
1
- import AnnotationCreationWindowWrapper from "../wrapper/AnnotationCreationWindowWrapper";
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
- export default [{
10
- component: AnnotationCreationWindowWrapper,
11
- mode: 'wrap',
12
- target: 'AnnotationSettings'
13
- }, externalStorageAnnotationPlugin, canvasAnnotationsPlugin, AnnotationCreationCompanionWindowWrapper, windowSideBarButtonsPlugin];
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
- import * as actions from 'mirador/dist/es/src/state/actions';
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, { id, windowId }) => ({
12
- closeCompanionWindow: () => dispatch(actions.removeCompanionWindow(windowId, id)),
13
- receiveAnnotation: (targetId, annoId, annotation) => dispatch(actions.receiveAnnotation(targetId, annoId, annotation))
14
- // setCurrentTime: (...args) => dispatch(actions.setWindowCurrentTime(windowId, ...args)),
15
- // setSeekTo: (...args) => dispatch(actions.setWindowSeekTo(windowId, ...args)),
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, { id: companionWindowId, windowId }) {
20
- const currentTime = null;
21
- const cw = getCompanionWindow(state, { companionWindowId, windowId });
22
- const { annotationid } = cw;
23
- const canvases = getVisibleCanvases(state, { windowId });
24
- if (canvases[0].__jsonld.items) {
25
- playerReferences.init(state, windowId, VideosReferences, actions);
26
- } else {
27
- playerReferences.init(state, windowId, OSDReferences, actions);
28
- }
29
- console.log('overlay :', playerReferences.getOverlay());
30
- console.log('mediaType :', playerReferences.getMediaType());
31
- // This could be removed but it's serve the useEffect in AnnotationForm for now.
32
- let annotation = getPresentAnnotationsOnSelectedCanvases(state, { windowId }).flatMap(annoPage => annoPage.json.items || []).find(annot => annot.id === annotationid);
33
-
34
- // New annotation has no ID and no templateType defined
35
- if (!annotation) {
36
- annotation = {
37
- id: null,
38
- maeData: {
39
- templateType: null
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
- return {
45
- currentTime,
46
- annotation,
47
- canvases,
48
- config: state.config,
49
- getMediaAudio: getVisibleCanvasAudioResources(state, { windowId })
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
- export default {
54
- companionWindowKey: 'annotationCreation',
55
- component: annotationForm,
56
- mapDispatchToProps,
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
- import { compose } from 'redux';
2
- import { connect } from 'react-redux';
3
- import { getWindowViewType } from 'mirador/dist/es/src/state/selectors';
4
- import { getVisibleCanvases } from 'mirador/dist/es/src/state/selectors/canvases';
5
- import { getCompanionWindowsForContent } from 'mirador/dist/es/src/state/selectors/companionWindows';
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, { targetProps: { windowId } }) {
12
- // Annotation edit companion window ou annotation creation companion window is the same thing
13
- const annotationCreationCompanionWindows = getCompanionWindowsForContent(state, { content: 'annotationCreation', windowId });
14
- let annotationEditCompanionWindowIsOpened = true;
15
- if (Object.keys(annotationCreationCompanionWindows).length !== 0) {
16
- annotationEditCompanionWindowIsOpened = false;
17
- }
18
- return {
19
- annotationEditCompanionWindowIsOpened,
20
- canvases: getVisibleCanvases(state, { windowId }),
21
- config: state.config,
22
- windowViewType: getWindowViewType(state, { windowId })
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
- const enhance = compose(connect(mapStateToProps));
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.6",
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@^1.0.6",
26
- "mirador-annotations": "npm:mirador-annotation-editor@^1.0.22-mirador-video-based"
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/core": "^7.24.6",
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/preset-env": "^7.24.6",
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",
package/webpack.config.js CHANGED
@@ -85,7 +85,6 @@ module.exports = (env, options) => {
85
85
  },
86
86
  devServer: {
87
87
  hot: true,
88
- port: 4445,
89
88
  static: [
90
89
  './demo/dist/',
91
90
  ],