mirador-annotation-editor-video 0.0.13 → 0.0.15
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,48 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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];
|
|
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']];
|
|
@@ -1,81 +1,96 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
|
|
18
31
|
/** */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
};
|
|
28
44
|
|
|
29
45
|
/** */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
windowId
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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 })
|
|
64
87
|
};
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
currentTime,
|
|
68
|
-
annotation,
|
|
69
|
-
canvases,
|
|
70
|
-
config: state.config,
|
|
71
|
-
getMediaAudio: (0, _canvases.getVisibleCanvasAudioResources)(state, {
|
|
72
|
-
windowId
|
|
73
|
-
})
|
|
74
|
-
};
|
|
75
88
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
|
|
90
|
+
exports['default'] = {
|
|
91
|
+
companionWindowKey: 'annotationCreation',
|
|
92
|
+
component: _miradorAnnotationsSrcAnnotationFormAnnotationForm2['default'],
|
|
93
|
+
mapDispatchToProps: mapDispatchToProps,
|
|
94
|
+
mapStateToProps: mapStateToProps
|
|
95
|
+
};
|
|
96
|
+
module.exports = exports['default'];
|
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
var _redux = require(
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
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'];
|
|
13
18
|
// TODO use selector in main componenent
|
|
14
19
|
/**
|
|
15
20
|
* this function map the state to the annotationPlugin's props
|
|
16
21
|
* */
|
|
17
|
-
function mapStateToProps(state, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
};
|
|
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
|
+
};
|
|
41
37
|
}
|
|
42
|
-
|
|
43
|
-
var
|
|
38
|
+
|
|
39
|
+
var enhance = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps));
|
|
40
|
+
|
|
41
|
+
exports['default'] = enhance(MiradorAnnotation);
|
|
42
|
+
module.exports = exports['default'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mirador-annotation-editor-video",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
|
|
4
5
|
"description": "Mirador 4 plugin wrapping Mirador Annotation Editor plugin and adding video annotation support",
|
|
5
6
|
"main": "es/index.js",
|
|
6
7
|
"module": "es/index.js",
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
"dependencies": {
|
|
25
26
|
"@mui/icons-material": "^6.1.8",
|
|
26
27
|
"mirador": "npm:mirador-video@1.0.12",
|
|
27
|
-
"mirador-annotations": "npm:mirador-annotation-editor@1.0.
|
|
28
|
+
"mirador-annotations": "npm:mirador-annotation-editor@1.0.42"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
31
|
"lodash": "^4.17.11",
|