mirador-annotation-editor-video 0.0.21 → 0.0.23
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/demo/src/index.js +1 -0
- package/demo/src/manifestsCatalog.js +1 -0
- package/es/locales.js +96 -0
- package/es/plugin/MiradorAnnotationEditionVideoPlugin.js +5 -2
- package/es/wrapper/AnnotationCreationCompanionWindowWrapper.js +14 -3
- package/es/wrapper/AnnotationCreationWindowWrapper.js +2 -1
- package/package.json +5 -4
- package/src/locales.js +90 -0
- package/src/plugin/MiradorAnnotationEditionVideoPlugin.js +5 -1
- package/src/wrapper/AnnotationCreationCompanionWindowWrapper.js +19 -5
- package/src/wrapper/AnnotationCreationWindowWrapper.js +2 -0
package/demo/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@ const config = {
|
|
|
13
13
|
{manifestId: "https://files.tetras-libre.fr/dev/youtube_withannot.json"},
|
|
14
14
|
{manifestId: "https://files.tetras-libre.fr/dev/peertube.json"},
|
|
15
15
|
{manifestId: "https://files.tetras-libre.fr/dev/cats_simplify_video_with_annot.json"},
|
|
16
|
+
{ manifestId: "https://files.tetras-libre.fr/dev/sun-400x400.json"}
|
|
16
17
|
],
|
|
17
18
|
theme: {
|
|
18
19
|
palette: {
|
|
@@ -13,4 +13,5 @@ export const manifestsCatalog = [
|
|
|
13
13
|
{ manifestId: 'https://iiif.io/api/cookbook/recipe/0074-multiple-language-captions/manifest.json' },
|
|
14
14
|
{ manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843' },
|
|
15
15
|
{ manifestId: 'https://iiif.io/api/cookbook/recipe/0002-mvm-audio/manifest.json' },
|
|
16
|
+
{ manifestId: 'https://files.tetras-libre.fr/dev/sun-400x400.json' }
|
|
16
17
|
];
|
package/es/locales.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
en: {
|
|
9
|
+
cancel: 'Cancel',
|
|
10
|
+
container_size: 'Container Size',
|
|
11
|
+
create_annotation: 'Create annotation',
|
|
12
|
+
delete: 'Delete',
|
|
13
|
+
detected_media_type: 'We detect {{mediaType}} media type.',
|
|
14
|
+
document: 'Document',
|
|
15
|
+
drawings_and_text_in_overlay: 'Drawings and text in overlay',
|
|
16
|
+
edit: 'Edit',
|
|
17
|
+
edit_annotation: 'Edit annotation',
|
|
18
|
+
edit_iiif_json_code: 'Edit directly the IIIF json code',
|
|
19
|
+
expert_mode: 'Expert mode',
|
|
20
|
+
export_annotation: 'Export Annotations',
|
|
21
|
+
export_annotation_for: 'Export annotations for "${label}"',
|
|
22
|
+
export_local_annotation: 'Export local annotations for visible items',
|
|
23
|
+
image: 'Image',
|
|
24
|
+
image_displayed: 'Image Displayed',
|
|
25
|
+
image_in_overlay_with_note: 'Image in overlay with a note',
|
|
26
|
+
image_true_size: 'Image True Size',
|
|
27
|
+
invalid_url: 'Invalid URL',
|
|
28
|
+
maev_github_link: 'https://github.com/SCENE-CE/mirador-annotation-editor-video',
|
|
29
|
+
manifest_url: 'Manifest URL',
|
|
30
|
+
media_not_supported: 'Media not supported',
|
|
31
|
+
new_annotation: 'New annotation',
|
|
32
|
+
no_annotation: 'No annotations stored yet.',
|
|
33
|
+
note: 'Note',
|
|
34
|
+
overlay: 'Overlay',
|
|
35
|
+
save: 'Save',
|
|
36
|
+
scale: 'Scale',
|
|
37
|
+
select_cursor: 'Select Cursor',
|
|
38
|
+
shape_selection: 'Shape Selection',
|
|
39
|
+
svg_selection: 'SVG selection',
|
|
40
|
+
switch_view: 'Switch to single view',
|
|
41
|
+
switch_view_h2: 'Switch view type to single view?',
|
|
42
|
+
tag: 'Tag',
|
|
43
|
+
tag_with_target: 'Tag with target',
|
|
44
|
+
target: 'Target',
|
|
45
|
+
textual_note_with_target: 'Textual note with target',
|
|
46
|
+
tool_selection: 'Tool Selection',
|
|
47
|
+
unsupported_media_message: 'Your current canvas media type is not supported by the annotation editor.',
|
|
48
|
+
video_annotation_instruction: 'If you want to annotate video media, you must install MAEV to create and edit annotations on video:',
|
|
49
|
+
your_tag_here: 'Your tag here:',
|
|
50
|
+
zoom: 'Zoom'
|
|
51
|
+
},
|
|
52
|
+
fr: {
|
|
53
|
+
cancel: 'Annuler',
|
|
54
|
+
container_size: 'Taille du conteneur',
|
|
55
|
+
create_annotation: 'Créer une annotation',
|
|
56
|
+
delete: 'Supprimer',
|
|
57
|
+
detected_media_type: 'Nous détectons un média de type {{mediaType}}.',
|
|
58
|
+
document: 'Document',
|
|
59
|
+
drawings_and_text_in_overlay: 'Dessins et texte en superposition',
|
|
60
|
+
edit: 'Éditer',
|
|
61
|
+
edit_annotation: "Editer l'annotation",
|
|
62
|
+
edit_iiif_json_code: 'Modifier directement le code JSON IIIF',
|
|
63
|
+
expert_mode: 'Mode expert',
|
|
64
|
+
export_annotation: 'Exporter les annotations',
|
|
65
|
+
export_annotation_for: 'Exporter les annotations pour "${label}"',
|
|
66
|
+
export_local_annotation: 'Exporter les annotations locales pour les éléments visibles',
|
|
67
|
+
image: 'Image',
|
|
68
|
+
image_displayed: 'Image affichée',
|
|
69
|
+
image_in_overlay_with_note: 'Image en superposition avec une note',
|
|
70
|
+
image_true_size: 'Taille réelle de l\'image',
|
|
71
|
+
invalid_url: 'URL invalide',
|
|
72
|
+
maev_github_link: 'https://github.com/SCENE-CE/mirador-annotation-editor-video',
|
|
73
|
+
manifest_url: 'URL du manifeste',
|
|
74
|
+
media_not_supported: 'Média non pris en charge',
|
|
75
|
+
new_annotation: 'Nouvelle annotation',
|
|
76
|
+
no_annotation: 'Aucune annotation enregistrée pour le moment.',
|
|
77
|
+
note: 'Note',
|
|
78
|
+
overlay: 'Superposition',
|
|
79
|
+
save: 'Sauvegarder',
|
|
80
|
+
scale: 'Échelle',
|
|
81
|
+
select_cursor: 'Sélectionner le curseur',
|
|
82
|
+
shape_selection: 'Sélection de forme',
|
|
83
|
+
svg_selection: 'Sélection SVG',
|
|
84
|
+
switch_view: 'Passer à la vue simple',
|
|
85
|
+
switch_view_h2: 'Changer le type de vue en vue simple?',
|
|
86
|
+
tag: 'Étiquette',
|
|
87
|
+
tag_with_target: 'Étiquette avec cible',
|
|
88
|
+
target: 'Target',
|
|
89
|
+
textual_note_with_target: 'Note textuelle avec cible',
|
|
90
|
+
tool_selection: 'Sélection d’outil',
|
|
91
|
+
unsupported_media_message: "Le type de média de votre canvas actuel n'est pas pris en charge par l'éditeur d'annotations.",
|
|
92
|
+
video_annotation_instruction: 'Si vous souhaitez annoter des vidéos, vous devez installer le plugin Mirador Annotation Editor Video (MAEV) pour créer et modifier des annotations sur les vidéos :',
|
|
93
|
+
your_tag_here: 'Votre étiquette',
|
|
94
|
+
zoom: 'Zoom'
|
|
95
|
+
}
|
|
96
|
+
};
|
|
@@ -37,12 +37,15 @@ Object.defineProperty(exports, "windowSideBarButtonsPlugin", {
|
|
|
37
37
|
var _AnnotationCreationWindowWrapper = _interopRequireDefault(require("../wrapper/AnnotationCreationWindowWrapper"));
|
|
38
38
|
var _externalStorageAnnotationPlugin = _interopRequireDefault(require("mirador-annotations/src/plugins/externalStorageAnnotationPlugin"));
|
|
39
39
|
var _canvasAnnotationsPlugin = _interopRequireDefault(require("mirador-annotations/src/plugins/canvasAnnotationsPlugin"));
|
|
40
|
-
var _annotationCreationCompanionWindow = _interopRequireDefault(require("mirador-annotations/src/plugins/annotationCreationCompanionWindow"));
|
|
41
40
|
var _windowSideBarButtonsPlugin = _interopRequireDefault(require("mirador-annotations/src/plugins/windowSideBarButtonsPlugin"));
|
|
42
41
|
var _AnnotationCreationCompanionWindowWrapper = _interopRequireDefault(require("../wrapper/AnnotationCreationCompanionWindowWrapper"));
|
|
42
|
+
var _locales = _interopRequireDefault(require("../locales.js"));
|
|
43
43
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
44
44
|
var _default = exports.default = [{
|
|
45
45
|
component: _AnnotationCreationWindowWrapper.default,
|
|
46
46
|
mode: 'wrap',
|
|
47
|
-
target: 'AnnotationSettings'
|
|
47
|
+
target: 'AnnotationSettings',
|
|
48
|
+
config: {
|
|
49
|
+
translations: _locales.default
|
|
50
|
+
}
|
|
48
51
|
}, _externalStorageAnnotationPlugin.default, _canvasAnnotationsPlugin.default, _AnnotationCreationCompanionWindowWrapper.default, _windowSideBarButtonsPlugin.default];
|
|
@@ -12,6 +12,8 @@ var _AnnotationForm = _interopRequireDefault(require("mirador-annotations/src/an
|
|
|
12
12
|
var _playerReferences = require("mirador-annotations/src/playerReferences");
|
|
13
13
|
var _OSDReferences = require("mirador/dist/es/src/plugins/OSDReferences");
|
|
14
14
|
var _VideosReferences = require("mirador/dist/es/src/plugins/VideosReferences");
|
|
15
|
+
var _reactI18next = require("react-i18next");
|
|
16
|
+
var _locales = _interopRequireDefault(require("../locales"));
|
|
15
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
18
|
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
19
|
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; }
|
|
@@ -42,7 +44,12 @@ function mapStateToProps(state, {
|
|
|
42
44
|
const canvases = (0, _canvases.getVisibleCanvases)(state, {
|
|
43
45
|
windowId
|
|
44
46
|
});
|
|
45
|
-
|
|
47
|
+
const videoResources = (0, _canvases.getVisibleCanvasVideoResources)(state, {
|
|
48
|
+
windowId
|
|
49
|
+
});
|
|
50
|
+
// TODO add check on audioResources getVisibleCanvasAudioResources
|
|
51
|
+
|
|
52
|
+
if (videoResources) {
|
|
46
53
|
_playerReferences.playerReferences.init(state, windowId, _VideosReferences.VideosReferences, actions);
|
|
47
54
|
} else {
|
|
48
55
|
_playerReferences.playerReferences.init(state, windowId, _OSDReferences.OSDReferences, actions);
|
|
@@ -65,15 +72,19 @@ function mapStateToProps(state, {
|
|
|
65
72
|
currentTime,
|
|
66
73
|
annotation,
|
|
67
74
|
canvases,
|
|
68
|
-
config:
|
|
75
|
+
config: {
|
|
76
|
+
...state.config,
|
|
77
|
+
translations: _locales.default
|
|
78
|
+
},
|
|
69
79
|
getMediaAudio: (0, _canvases.getVisibleCanvasAudioResources)(state, {
|
|
70
80
|
windowId
|
|
71
81
|
})
|
|
72
82
|
};
|
|
73
83
|
}
|
|
84
|
+
const AnnotationFormWithTranslation = (0, _reactI18next.withTranslation)()(_AnnotationForm.default);
|
|
74
85
|
var _default = exports.default = {
|
|
75
86
|
companionWindowKey: 'annotationCreation',
|
|
76
|
-
component:
|
|
87
|
+
component: AnnotationFormWithTranslation,
|
|
77
88
|
mapDispatchToProps,
|
|
78
89
|
mapStateToProps
|
|
79
90
|
};
|
|
@@ -10,6 +10,7 @@ var _selectors = require("mirador/dist/es/src/state/selectors");
|
|
|
10
10
|
var _canvases = require("mirador/dist/es/src/state/selectors/canvases");
|
|
11
11
|
var _companionWindows = require("mirador/dist/es/src/state/selectors/companionWindows");
|
|
12
12
|
var _window = require("mirador/dist/es/src/state/selectors/window");
|
|
13
|
+
var _reactI18next = require("react-i18next");
|
|
13
14
|
const MiradorAnnotation = require('mirador-annotations/src/plugins/miradorAnnotationPlugin').default;
|
|
14
15
|
// TODO use selector in main componenent
|
|
15
16
|
/**
|
|
@@ -44,5 +45,5 @@ function mapStateToProps(state, {
|
|
|
44
45
|
currentTime: currrentTime
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
|
-
const enhance = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps));
|
|
48
|
+
const enhance = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps), (0, _reactI18next.withTranslation)());
|
|
48
49
|
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.23",
|
|
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",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@mui/icons-material": "^5.11.16",
|
|
26
26
|
"mirador": "npm:mirador-video@1.0.14",
|
|
27
|
-
"mirador-annotations": "
|
|
27
|
+
"mirador-annotations": "npm:mirador-annotation-editor@1.0.65",
|
|
28
|
+
"react-i18next": "^15.4.0"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
31
|
"lodash": "^4.17.11",
|
|
@@ -32,7 +33,6 @@
|
|
|
32
33
|
"react-dom": "^18.0.0"
|
|
33
34
|
},
|
|
34
35
|
"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",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"@babel/polyfill": "^7.12.1",
|
|
42
42
|
"@babel/preset-env": "^7.26.0",
|
|
43
43
|
"@babel/preset-react": "^7.24.6",
|
|
44
|
+
"@emotion/styled": "^11.11.0",
|
|
44
45
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.13",
|
|
45
46
|
"css-loader": "^7.1.2",
|
|
46
47
|
"html-webpack-plugin": "^5.6.0",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
},
|
|
56
57
|
"overrides": {
|
|
57
58
|
"mirador-annotations": {
|
|
58
|
-
"mirador": "npm:mirador-video@1.0.
|
|
59
|
+
"mirador": "npm:mirador-video@1.0.14"
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
"author": "",
|
package/src/locales.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: {
|
|
3
|
+
cancel: 'Cancel',
|
|
4
|
+
container_size: 'Container Size',
|
|
5
|
+
create_annotation: 'Create annotation',
|
|
6
|
+
delete: 'Delete',
|
|
7
|
+
detected_media_type: 'We detect {{mediaType}} media type.',
|
|
8
|
+
document: 'Document',
|
|
9
|
+
drawings_and_text_in_overlay: 'Drawings and text in overlay',
|
|
10
|
+
edit: 'Edit',
|
|
11
|
+
edit_annotation: 'Edit annotation',
|
|
12
|
+
edit_iiif_json_code: 'Edit directly the IIIF json code',
|
|
13
|
+
expert_mode: 'Expert mode',
|
|
14
|
+
export_annotation: 'Export Annotations',
|
|
15
|
+
export_annotation_for: 'Export annotations for "${label}"',
|
|
16
|
+
export_local_annotation: 'Export local annotations for visible items',
|
|
17
|
+
image: 'Image',
|
|
18
|
+
image_displayed: 'Image Displayed',
|
|
19
|
+
image_in_overlay_with_note: 'Image in overlay with a note',
|
|
20
|
+
image_true_size: 'Image True Size',
|
|
21
|
+
invalid_url: 'Invalid URL',
|
|
22
|
+
maev_github_link: 'https://github.com/SCENE-CE/mirador-annotation-editor-video',
|
|
23
|
+
manifest_url: 'Manifest URL',
|
|
24
|
+
media_not_supported: 'Media not supported',
|
|
25
|
+
new_annotation: 'New annotation',
|
|
26
|
+
no_annotation: 'No annotations stored yet.',
|
|
27
|
+
note: 'Note',
|
|
28
|
+
overlay: 'Overlay',
|
|
29
|
+
save: 'Save',
|
|
30
|
+
scale: 'Scale',
|
|
31
|
+
select_cursor: 'Select Cursor',
|
|
32
|
+
shape_selection: 'Shape Selection',
|
|
33
|
+
svg_selection: 'SVG selection',
|
|
34
|
+
switch_view: 'Switch to single view',
|
|
35
|
+
switch_view_h2: 'Switch view type to single view?',
|
|
36
|
+
tag: 'Tag',
|
|
37
|
+
tag_with_target: 'Tag with target',
|
|
38
|
+
target: 'Target',
|
|
39
|
+
textual_note_with_target: 'Textual note with target',
|
|
40
|
+
tool_selection: 'Tool Selection',
|
|
41
|
+
unsupported_media_message: 'Your current canvas media type is not supported by the annotation editor.',
|
|
42
|
+
video_annotation_instruction: 'If you want to annotate video media, you must install MAEV to create and edit annotations on video:',
|
|
43
|
+
your_tag_here: 'Your tag here:',
|
|
44
|
+
zoom: 'Zoom',
|
|
45
|
+
},
|
|
46
|
+
fr: {
|
|
47
|
+
cancel: 'Annuler',
|
|
48
|
+
container_size: 'Taille du conteneur',
|
|
49
|
+
create_annotation: 'Créer une annotation',
|
|
50
|
+
delete: 'Supprimer',
|
|
51
|
+
detected_media_type: 'Nous détectons un média de type {{mediaType}}.',
|
|
52
|
+
document: 'Document',
|
|
53
|
+
drawings_and_text_in_overlay: 'Dessins et texte en superposition',
|
|
54
|
+
edit: 'Éditer',
|
|
55
|
+
edit_annotation: "Editer l'annotation",
|
|
56
|
+
edit_iiif_json_code: 'Modifier directement le code JSON IIIF',
|
|
57
|
+
expert_mode: 'Mode expert',
|
|
58
|
+
export_annotation: 'Exporter les annotations',
|
|
59
|
+
export_annotation_for: 'Exporter les annotations pour "${label}"',
|
|
60
|
+
export_local_annotation: 'Exporter les annotations locales pour les éléments visibles',
|
|
61
|
+
image: 'Image',
|
|
62
|
+
image_displayed: 'Image affichée',
|
|
63
|
+
image_in_overlay_with_note: 'Image en superposition avec une note',
|
|
64
|
+
image_true_size: 'Taille réelle de l\'image',
|
|
65
|
+
invalid_url: 'URL invalide',
|
|
66
|
+
maev_github_link: 'https://github.com/SCENE-CE/mirador-annotation-editor-video',
|
|
67
|
+
manifest_url: 'URL du manifeste',
|
|
68
|
+
media_not_supported: 'Média non pris en charge',
|
|
69
|
+
new_annotation: 'Nouvelle annotation',
|
|
70
|
+
no_annotation: 'Aucune annotation enregistrée pour le moment.',
|
|
71
|
+
note: 'Note',
|
|
72
|
+
overlay: 'Superposition',
|
|
73
|
+
save: 'Sauvegarder',
|
|
74
|
+
scale: 'Échelle',
|
|
75
|
+
select_cursor: 'Sélectionner le curseur',
|
|
76
|
+
shape_selection: 'Sélection de forme',
|
|
77
|
+
svg_selection: 'Sélection SVG',
|
|
78
|
+
switch_view: 'Passer à la vue simple',
|
|
79
|
+
switch_view_h2: 'Changer le type de vue en vue simple?',
|
|
80
|
+
tag: 'Étiquette',
|
|
81
|
+
tag_with_target: 'Étiquette avec cible',
|
|
82
|
+
target: 'Target',
|
|
83
|
+
textual_note_with_target: 'Note textuelle avec cible',
|
|
84
|
+
tool_selection: 'Sélection d’outil',
|
|
85
|
+
unsupported_media_message: "Le type de média de votre canvas actuel n'est pas pris en charge par l'éditeur d'annotations.",
|
|
86
|
+
video_annotation_instruction: 'Si vous souhaitez annoter des vidéos, vous devez installer le plugin Mirador Annotation Editor Video (MAEV) pour créer et modifier des annotations sur les vidéos :',
|
|
87
|
+
your_tag_here: 'Votre étiquette',
|
|
88
|
+
zoom: 'Zoom',
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import AnnotationCreationWindowWrapper from "../wrapper/AnnotationCreationWindowWrapper";
|
|
2
2
|
import externalStorageAnnotationPlugin from 'mirador-annotations/src/plugins/externalStorageAnnotationPlugin';
|
|
3
3
|
import canvasAnnotationsPlugin from 'mirador-annotations/src/plugins/canvasAnnotationsPlugin';
|
|
4
|
-
import annotationCreationCompanionWindow from 'mirador-annotations/src/plugins/annotationCreationCompanionWindow';
|
|
5
4
|
import windowSideBarButtonsPlugin from 'mirador-annotations/src/plugins/windowSideBarButtonsPlugin';
|
|
6
5
|
import AnnotationCreationCompanionWindowWrapper from "../wrapper/AnnotationCreationCompanionWindowWrapper";
|
|
6
|
+
import translations from '../locales.js'
|
|
7
7
|
export{
|
|
8
8
|
AnnotationCreationWindowWrapper,
|
|
9
9
|
externalStorageAnnotationPlugin,canvasAnnotationsPlugin,AnnotationCreationCompanionWindowWrapper,
|
|
@@ -15,6 +15,10 @@ export default [
|
|
|
15
15
|
component: AnnotationCreationWindowWrapper,
|
|
16
16
|
mode:'wrap',
|
|
17
17
|
target:'AnnotationSettings',
|
|
18
|
+
config: {
|
|
19
|
+
translations,
|
|
20
|
+
},
|
|
21
|
+
|
|
18
22
|
},
|
|
19
23
|
externalStorageAnnotationPlugin,
|
|
20
24
|
canvasAnnotationsPlugin,
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import * as actions from 'mirador/dist/es/src/state/actions';
|
|
2
2
|
import { getCompanionWindow } from 'mirador/dist/es/src/state/selectors/companionWindows';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
getVisibleCanvasAudioResources,
|
|
5
|
+
getVisibleCanvases,
|
|
6
|
+
getVisibleCanvasVideoResources
|
|
7
|
+
} from 'mirador/dist/es/src/state/selectors/canvases';
|
|
4
8
|
import { getPresentAnnotationsOnSelectedCanvases } from 'mirador/dist/es/src/state/selectors/annotations';
|
|
5
9
|
import annotationForm from 'mirador-annotations/src/annotationForm/AnnotationForm';
|
|
6
10
|
import { playerReferences } from 'mirador-annotations/src/playerReferences';
|
|
7
11
|
import { OSDReferences } from 'mirador/dist/es/src/plugins/OSDReferences';
|
|
8
12
|
import {VideosReferences} from "mirador/dist/es/src/plugins/VideosReferences";
|
|
13
|
+
import { withTranslation } from 'react-i18next';
|
|
14
|
+
import translations from '../locales';
|
|
9
15
|
|
|
10
16
|
/** */
|
|
11
17
|
const mapDispatchToProps = (dispatch, { id, windowId }) => ({
|
|
@@ -25,10 +31,15 @@ function mapStateToProps(state, { id: companionWindowId, windowId }) {
|
|
|
25
31
|
const cw = getCompanionWindow(state, { companionWindowId, windowId });
|
|
26
32
|
const { annotationid } = cw;
|
|
27
33
|
const canvases = getVisibleCanvases(state, { windowId });
|
|
28
|
-
|
|
34
|
+
|
|
35
|
+
const videoResources = getVisibleCanvasVideoResources(state, { windowId });
|
|
36
|
+
// TODO add check on audioResources getVisibleCanvasAudioResources
|
|
37
|
+
|
|
38
|
+
if(videoResources){
|
|
29
39
|
playerReferences.init(state, windowId,VideosReferences, actions);
|
|
30
40
|
}else{
|
|
31
|
-
|
|
41
|
+
|
|
42
|
+
playerReferences.init(state, windowId,OSDReferences, actions);
|
|
32
43
|
}
|
|
33
44
|
// This could be removed but it's serve the useEffect in AnnotationForm for now.
|
|
34
45
|
let annotation = getPresentAnnotationsOnSelectedCanvases(state, { windowId })
|
|
@@ -49,14 +60,17 @@ function mapStateToProps(state, { id: companionWindowId, windowId }) {
|
|
|
49
60
|
currentTime,
|
|
50
61
|
annotation,
|
|
51
62
|
canvases,
|
|
52
|
-
config: state.config,
|
|
63
|
+
config: {...state.config, translations},
|
|
53
64
|
getMediaAudio: getVisibleCanvasAudioResources(state, { windowId }),
|
|
54
65
|
};
|
|
55
66
|
}
|
|
56
67
|
|
|
68
|
+
const AnnotationFormWithTranslation = withTranslation()(annotationForm);
|
|
69
|
+
|
|
70
|
+
|
|
57
71
|
export default {
|
|
58
72
|
companionWindowKey: 'annotationCreation',
|
|
59
|
-
component:
|
|
73
|
+
component: AnnotationFormWithTranslation,
|
|
60
74
|
mapDispatchToProps,
|
|
61
75
|
mapStateToProps,
|
|
62
76
|
};
|
|
@@ -4,6 +4,7 @@ import { getWindowViewType } from 'mirador/dist/es/src/state/selectors';
|
|
|
4
4
|
import { getVisibleCanvases } from 'mirador/dist/es/src/state/selectors/canvases';
|
|
5
5
|
import { getCompanionWindowsForContent } from 'mirador/dist/es/src/state/selectors/companionWindows';
|
|
6
6
|
import { getWindowCurrentTime } from "mirador/dist/es/src/state/selectors/window";
|
|
7
|
+
import {withTranslation} from "react-i18next";
|
|
7
8
|
const MiradorAnnotation = require('mirador-annotations/src/plugins/miradorAnnotationPlugin').default;
|
|
8
9
|
// TODO use selector in main componenent
|
|
9
10
|
/**
|
|
@@ -28,6 +29,7 @@ function mapStateToProps(state, { targetProps: { windowId } }) {
|
|
|
28
29
|
|
|
29
30
|
const enhance = compose(
|
|
30
31
|
connect(mapStateToProps),
|
|
32
|
+
withTranslation(),
|
|
31
33
|
);
|
|
32
34
|
|
|
33
35
|
export default enhance(MiradorAnnotation);
|