mirador-annotation-editor-video 1.0.93 → 1.0.94
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.
|
@@ -4,17 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = ManifestNetworkFormSection;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _material = require("@mui/material");
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _AnnotationFormUtils = require("./AnnotationFormUtils");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
12
|
/**
|
|
15
13
|
* Handle Manifest Section
|
|
16
14
|
* @param manifestNetwork
|
|
17
|
-
* @param onChange
|
|
15
|
+
* @param onChange - callback function to handle manifest URL changes
|
|
16
|
+
* @param t
|
|
18
17
|
* @returns {Element}
|
|
19
18
|
* @constructor
|
|
20
19
|
*/
|
|
@@ -23,17 +22,6 @@ function ManifestNetworkFormSection({
|
|
|
23
22
|
onChange,
|
|
24
23
|
t
|
|
25
24
|
}) {
|
|
26
|
-
// TODO probably useless. check this state
|
|
27
|
-
const [manifestUrl, setManifestUrl] = (0, _react.useState)('');
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Handle on change
|
|
31
|
-
* @param value new value
|
|
32
|
-
*/
|
|
33
|
-
const handlOnChange = value => {
|
|
34
|
-
setManifestUrl(value);
|
|
35
|
-
onChange(value);
|
|
36
|
-
};
|
|
37
25
|
return /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
38
26
|
item: true,
|
|
39
27
|
container: true,
|
|
@@ -47,16 +35,12 @@ function ManifestNetworkFormSection({
|
|
|
47
35
|
item: true
|
|
48
36
|
}, /*#__PURE__*/_react.default.createElement(_material.TextField, {
|
|
49
37
|
value: manifestNetwork,
|
|
50
|
-
onChange: event =>
|
|
38
|
+
onChange: event => onChange(event.target.value.trim()),
|
|
51
39
|
label: t('manifest_url'),
|
|
52
40
|
type: "url",
|
|
53
41
|
error: !(0, _AnnotationFormUtils.isValidUrl)(manifestNetwork)
|
|
54
42
|
})), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
55
43
|
item: true
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Link, {
|
|
57
|
-
href: manifestUrl
|
|
58
|
-
}, manifestUrl)), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
59
|
-
item: true
|
|
60
44
|
}, (0, _AnnotationFormUtils.isValidUrl)(manifestNetwork) && /*#__PURE__*/_react.default.createElement(_material.Link, {
|
|
61
45
|
href: manifestNetwork,
|
|
62
46
|
target: "_blank",
|
|
@@ -93,7 +93,7 @@ function NetworkCommentTemplate({
|
|
|
93
93
|
(0, _KonvaUtils.resizeKonvaStage)(windowId, playerReferences.getMediaTrueWidth(), playerReferences.getMediaTrueHeight(), 1 / playerReferences.getScale());
|
|
94
94
|
const baseAnnotation = getBaseAnnotation(annotationState.id);
|
|
95
95
|
if (baseAnnotation) {
|
|
96
|
-
annotationState.id = `${
|
|
96
|
+
annotationState.id = `${baseAnnotation}#${annotation.maeData.manifestNetwork}`;
|
|
97
97
|
}
|
|
98
98
|
saveAnnotation(annotationState);
|
|
99
99
|
};
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Grid, Link, TextField, Typography,
|
|
4
4
|
} from '@mui/material';
|
|
@@ -8,7 +8,8 @@ import { isValidUrl } from './AnnotationFormUtils';
|
|
|
8
8
|
/**
|
|
9
9
|
* Handle Manifest Section
|
|
10
10
|
* @param manifestNetwork
|
|
11
|
-
* @param onChange
|
|
11
|
+
* @param onChange - callback function to handle manifest URL changes
|
|
12
|
+
* @param t
|
|
12
13
|
* @returns {Element}
|
|
13
14
|
* @constructor
|
|
14
15
|
*/
|
|
@@ -19,18 +20,6 @@ export default function ManifestNetworkFormSection(
|
|
|
19
20
|
t,
|
|
20
21
|
},
|
|
21
22
|
) {
|
|
22
|
-
// TODO probably useless. check this state
|
|
23
|
-
const [manifestUrl, setManifestUrl] = useState('');
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Handle on change
|
|
27
|
-
* @param value new value
|
|
28
|
-
*/
|
|
29
|
-
const handlOnChange = (value) => {
|
|
30
|
-
setManifestUrl(value);
|
|
31
|
-
onChange(value);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
23
|
return (
|
|
35
24
|
<Grid item container direction="column" spacing={1}>
|
|
36
25
|
<Grid item>
|
|
@@ -41,15 +30,12 @@ export default function ManifestNetworkFormSection(
|
|
|
41
30
|
<Grid item>
|
|
42
31
|
<TextField
|
|
43
32
|
value={manifestNetwork}
|
|
44
|
-
onChange={(event) =>
|
|
33
|
+
onChange={(event) => onChange(event.target.value.trim())}
|
|
45
34
|
label={t('manifest_url')}
|
|
46
35
|
type="url"
|
|
47
36
|
error={!isValidUrl(manifestNetwork)}
|
|
48
37
|
/>
|
|
49
38
|
</Grid>
|
|
50
|
-
<Grid item>
|
|
51
|
-
<Link href={manifestUrl}>{manifestUrl}</Link>
|
|
52
|
-
</Grid>
|
|
53
39
|
<Grid item>
|
|
54
40
|
{isValidUrl(manifestNetwork) && (
|
|
55
41
|
<Link href={manifestNetwork} target="_blank" rel="noreferrer">
|
|
@@ -102,7 +102,7 @@ function NetworkCommentTemplate(
|
|
|
102
102
|
|
|
103
103
|
const baseAnnotation = getBaseAnnotation(annotationState.id);
|
|
104
104
|
if (baseAnnotation) {
|
|
105
|
-
annotationState.id = `${
|
|
105
|
+
annotationState.id = `${baseAnnotation}#${annotation.maeData.manifestNetwork}`;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
saveAnnotation(annotationState);
|