mirador-annotation-editor-video 0.0.17 → 0.0.19

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.
@@ -1,42 +1,48 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
5
  });
6
-
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
8
-
9
- var _wrapperAnnotationCreationWindowWrapper = require("../wrapper/AnnotationCreationWindowWrapper");
10
-
11
- var _wrapperAnnotationCreationWindowWrapper2 = _interopRequireDefault(_wrapperAnnotationCreationWindowWrapper);
12
-
13
- var _miradorAnnotationsSrcPluginsExternalStorageAnnotationPlugin = require('mirador-annotations/src/plugins/externalStorageAnnotationPlugin');
14
-
15
- var _miradorAnnotationsSrcPluginsExternalStorageAnnotationPlugin2 = _interopRequireDefault(_miradorAnnotationsSrcPluginsExternalStorageAnnotationPlugin);
16
-
17
- var _miradorAnnotationsSrcPluginsCanvasAnnotationsPlugin = require('mirador-annotations/src/plugins/canvasAnnotationsPlugin');
18
-
19
- var _miradorAnnotationsSrcPluginsCanvasAnnotationsPlugin2 = _interopRequireDefault(_miradorAnnotationsSrcPluginsCanvasAnnotationsPlugin);
20
-
21
- var _miradorAnnotationsSrcPluginsAnnotationCreationCompanionWindow = require('mirador-annotations/src/plugins/annotationCreationCompanionWindow');
22
-
23
- var _miradorAnnotationsSrcPluginsAnnotationCreationCompanionWindow2 = _interopRequireDefault(_miradorAnnotationsSrcPluginsAnnotationCreationCompanionWindow);
24
-
25
- var _miradorAnnotationsSrcPluginsWindowSideBarButtonsPlugin = require('mirador-annotations/src/plugins/windowSideBarButtonsPlugin');
26
-
27
- var _miradorAnnotationsSrcPluginsWindowSideBarButtonsPlugin2 = _interopRequireDefault(_miradorAnnotationsSrcPluginsWindowSideBarButtonsPlugin);
28
-
29
- var _wrapperAnnotationCreationCompanionWindowWrapper = require("../wrapper/AnnotationCreationCompanionWindowWrapper");
30
-
31
- var _wrapperAnnotationCreationCompanionWindowWrapper2 = _interopRequireDefault(_wrapperAnnotationCreationCompanionWindowWrapper);
32
-
33
- exports.AnnotationCreationWindowWrapper = _wrapperAnnotationCreationWindowWrapper2['default'];
34
- exports.externalStorageAnnotationPlugin = _miradorAnnotationsSrcPluginsExternalStorageAnnotationPlugin2['default'];
35
- exports.canvasAnnotationsPlugin = _miradorAnnotationsSrcPluginsCanvasAnnotationsPlugin2['default'];
36
- exports.AnnotationCreationCompanionWindowWrapper = _wrapperAnnotationCreationCompanionWindowWrapper2['default'];
37
- exports.windowSideBarButtonsPlugin = _miradorAnnotationsSrcPluginsWindowSideBarButtonsPlugin2['default'];
38
- exports['default'] = [{
39
- component: _wrapperAnnotationCreationWindowWrapper2['default'],
40
- mode: 'wrap',
41
- target: 'AnnotationSettings'
42
- }, _miradorAnnotationsSrcPluginsExternalStorageAnnotationPlugin2['default'], _miradorAnnotationsSrcPluginsCanvasAnnotationsPlugin2['default'], _wrapperAnnotationCreationCompanionWindowWrapper2['default'], _miradorAnnotationsSrcPluginsWindowSideBarButtonsPlugin2['default']];
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,96 +1,81 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
5
  });
6
-
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
8
-
9
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
10
-
11
- var _miradorDistEsSrcStateActions = require('mirador/dist/es/src/state/actions');
12
-
13
- var actions = _interopRequireWildcard(_miradorDistEsSrcStateActions);
14
-
15
- var _miradorDistEsSrcStateSelectorsCompanionWindows = require('mirador/dist/es/src/state/selectors/companionWindows');
16
-
17
- var _miradorDistEsSrcStateSelectorsCanvases = require('mirador/dist/es/src/state/selectors/canvases');
18
-
19
- var _miradorDistEsSrcStateSelectorsAnnotations = require('mirador/dist/es/src/state/selectors/annotations');
20
-
21
- var _miradorAnnotationsSrcAnnotationFormAnnotationForm = require('mirador-annotations/src/annotationForm/AnnotationForm');
22
-
23
- var _miradorAnnotationsSrcAnnotationFormAnnotationForm2 = _interopRequireDefault(_miradorAnnotationsSrcAnnotationFormAnnotationForm);
24
-
25
- var _miradorAnnotationsSrcPlayerReferences = require('mirador-annotations/src/playerReferences');
26
-
27
- var _miradorDistEsSrcPluginsOSDReferences = require('mirador/dist/es/src/plugins/OSDReferences');
28
-
29
- var _miradorDistEsSrcPluginsVideosReferences = require("mirador/dist/es/src/plugins/VideosReferences");
30
-
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; }
31
18
  /** */
32
- var mapDispatchToProps = function mapDispatchToProps(dispatch, _ref) {
33
- var id = _ref.id;
34
- var windowId = _ref.windowId;
35
- return {
36
- closeCompanionWindow: function closeCompanionWindow() {
37
- return dispatch(actions.removeCompanionWindow(windowId, id));
38
- },
39
- receiveAnnotation: function receiveAnnotation(targetId, annoId, annotation) {
40
- return dispatch(actions.receiveAnnotation(targetId, annoId, annotation));
41
- }
42
- };
43
- };
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)),
27
+ });
44
28
 
45
29
  /** */
46
- // setCurrentTime: (...args) => dispatch(actions.setWindowCurrentTime(windowId, ...args)),
47
- // setSeekTo: (...args) => dispatch(actions.setWindowSeekTo(windowId, ...args)),
48
- function mapStateToProps(state, _ref2) {
49
- var companionWindowId = _ref2.id;
50
- var windowId = _ref2.windowId;
51
-
52
- var currentTime = null;
53
- var cw = (0, _miradorDistEsSrcStateSelectorsCompanionWindows.getCompanionWindow)(state, { companionWindowId: companionWindowId, windowId: windowId });
54
- var annotationid = cw.annotationid;
55
-
56
- var canvases = (0, _miradorDistEsSrcStateSelectorsCanvases.getVisibleCanvases)(state, { windowId: windowId });
57
- if (canvases[0].__jsonld.items) {
58
- _miradorAnnotationsSrcPlayerReferences.playerReferences.init(state, windowId, _miradorDistEsSrcPluginsVideosReferences.VideosReferences, actions);
59
- } else {
60
- _miradorAnnotationsSrcPlayerReferences.playerReferences.init(state, windowId, _miradorDistEsSrcPluginsOSDReferences.OSDReferences, actions);
61
- }
62
- console.log('overlay :', _miradorAnnotationsSrcPlayerReferences.playerReferences.getOverlay());
63
- console.log('mediaType :', _miradorAnnotationsSrcPlayerReferences.playerReferences.getMediaType());
64
- // This could be removed but it's serve the useEffect in AnnotationForm for now.
65
- var annotation = (0, _miradorDistEsSrcStateSelectorsAnnotations.getPresentAnnotationsOnSelectedCanvases)(state, { windowId: windowId }).flatMap(function (annoPage) {
66
- return annoPage.json.items || [];
67
- }).find(function (annot) {
68
- return annot.id === annotationid;
69
- });
70
-
71
- // New annotation has no ID and no templateType defined
72
- if (!annotation) {
73
- annotation = {
74
- id: null,
75
- maeData: {
76
- templateType: null
77
- }
78
- };
79
- }
80
-
81
- return {
82
- currentTime: currentTime,
83
- annotation: annotation,
84
- canvases: canvases,
85
- config: state.config,
86
- getMediaAudio: (0, _miradorDistEsSrcStateSelectorsCanvases.getVisibleCanvasAudioResources)(state, { windowId: windowId })
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);
56
+
57
+ // New annotation has no ID and no templateType defined
58
+ if (!annotation) {
59
+ annotation = {
60
+ id: null,
61
+ maeData: {
62
+ templateType: null
63
+ }
87
64
  };
65
+ }
66
+ return {
67
+ currentTime,
68
+ annotation,
69
+ canvases,
70
+ config: state.config,
71
+ getMediaAudio: (0, _canvases.getVisibleCanvasAudioResources)(state, {
72
+ windowId
73
+ })
74
+ };
88
75
  }
89
-
90
- exports['default'] = {
91
- companionWindowKey: 'annotationCreation',
92
- component: _miradorAnnotationsSrcAnnotationFormAnnotationForm2['default'],
93
- mapDispatchToProps: mapDispatchToProps,
94
- mapStateToProps: mapStateToProps
95
- };
96
- module.exports = exports['default'];
76
+ var _default = exports.default = {
77
+ companionWindowKey: 'annotationCreation',
78
+ component: _AnnotationForm.default,
79
+ mapDispatchToProps,
80
+ mapStateToProps
81
+ };
@@ -1,42 +1,43 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
5
  });
6
-
7
- var _redux = require('redux');
8
-
9
- var _reactRedux = require('react-redux');
10
-
11
- var _miradorDistEsSrcStateSelectors = require('mirador/dist/es/src/state/selectors');
12
-
13
- var _miradorDistEsSrcStateSelectorsCanvases = require('mirador/dist/es/src/state/selectors/canvases');
14
-
15
- var _miradorDistEsSrcStateSelectorsCompanionWindows = require('mirador/dist/es/src/state/selectors/companionWindows');
16
-
17
- var MiradorAnnotation = require('mirador-annotations/src/plugins/miradorAnnotationPlugin')['default'];
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");
12
+ const MiradorAnnotation = require('mirador-annotations/src/plugins/miradorAnnotationPlugin').default;
18
13
  // TODO use selector in main componenent
19
14
  /**
20
15
  * this function map the state to the annotationPlugin's props
21
16
  * */
22
- function mapStateToProps(state, _ref) {
23
- var windowId = _ref.targetProps.windowId;
24
-
25
- // Annotation edit companion window ou annotation creation companion window is the same thing
26
- var annotationCreationCompanionWindows = (0, _miradorDistEsSrcStateSelectorsCompanionWindows.getCompanionWindowsForContent)(state, { content: 'annotationCreation', windowId: windowId });
27
- var annotationEditCompanionWindowIsOpened = true;
28
- if (Object.keys(annotationCreationCompanionWindows).length !== 0) {
29
- annotationEditCompanionWindowIsOpened = false;
30
- }
31
- return {
32
- annotationEditCompanionWindowIsOpened: annotationEditCompanionWindowIsOpened,
33
- canvases: (0, _miradorDistEsSrcStateSelectorsCanvases.getVisibleCanvases)(state, { windowId: windowId }),
34
- config: state.config,
35
- windowViewType: (0, _miradorDistEsSrcStateSelectors.getWindowViewType)(state, { windowId: windowId })
36
- };
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
+ };
37
41
  }
38
-
39
- var enhance = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps));
40
-
41
- exports['default'] = enhance(MiradorAnnotation);
42
- module.exports = exports['default'];
42
+ const enhance = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps));
43
+ var _default = exports.default = enhance(MiradorAnnotation);
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "mirador-annotation-editor-video",
3
- "version": "0.0.17",
4
-
3
+ "version": "0.0.19",
5
4
  "description": "Mirador 4 plugin wrapping Mirador Annotation Editor plugin and adding video annotation support",
6
5
  "main": "es/index.js",
7
6
  "module": "es/index.js",
@@ -23,9 +22,9 @@
23
22
  "test:ci": "jest --ci --reporters=default --reporters=jest-junit --watchAll=false"
24
23
  },
25
24
  "dependencies": {
26
- "@mui/icons-material": "^6.1.8",
27
- "mirador": "npm:mirador-video@1.0.12",
28
- "mirador-annotations": "npm:mirador-annotation-editor@1.0.44"
25
+ "@mui/icons-material": "^5.11.16",
26
+ "mirador": "npm:mirador-video@1.0.14",
27
+ "mirador-annotations": "npm:mirador-annotation-editor@1.0.57"
29
28
  },
30
29
  "peerDependencies": {
31
30
  "lodash": "^4.17.11",
@@ -33,6 +32,7 @@
33
32
  "react-dom": "^18.0.0"
34
33
  },
35
34
  "devDependencies": {
35
+ "@emotion/styled": "^11.11.0",
36
36
  "@babel/cli": "^7.25.9",
37
37
  "@babel/core": "^7.26.0",
38
38
  "@babel/node": "^7.26.0",