@searpent/react-image-annotate 2.0.71 → 2.0.72
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.
|
@@ -1181,8 +1181,8 @@ export default (function (state, action) {
|
|
|
1181
1181
|
var name = action.name,
|
|
1182
1182
|
value = action.value,
|
|
1183
1183
|
_imageIndex = action.imageIndex,
|
|
1184
|
-
_groupId2 = action.groupId
|
|
1185
|
-
|
|
1184
|
+
_groupId2 = action.groupId,
|
|
1185
|
+
metadataId = action.metadataId;
|
|
1186
1186
|
|
|
1187
1187
|
if (isNaN(_imageIndex)) {
|
|
1188
1188
|
var _state$albumMetadata;
|
|
@@ -1221,7 +1221,7 @@ export default (function (state, action) {
|
|
|
1221
1221
|
var articleRegionToUpdate = (_state$images$_imageI2 = state.images[_imageIndex]) === null || _state$images$_imageI2 === void 0 ? void 0 : _state$images$_imageI2.regions[articleMetadataRegionIdx];
|
|
1222
1222
|
var articleMetadata = JSON.parse(articleRegionToUpdate.text);
|
|
1223
1223
|
var toBeUpdatedMetadataIdx = articleMetadata.findIndex(function (i) {
|
|
1224
|
-
return i.
|
|
1224
|
+
return i.metadataId === metadataId;
|
|
1225
1225
|
});
|
|
1226
1226
|
|
|
1227
1227
|
if (toBeUpdatedMetadataIdx < 0) {
|
|
@@ -30,6 +30,7 @@ var MetadataItem = function MetadataItem(_ref2) {
|
|
|
30
30
|
|
|
31
31
|
var name = _ref2.name,
|
|
32
32
|
value = _ref2.value,
|
|
33
|
+
metadataId = _ref2.metadataId,
|
|
33
34
|
imageIndex = _ref2.imageIndex,
|
|
34
35
|
groupId = _ref2.groupId,
|
|
35
36
|
onChange = _ref2.onChange,
|
|
@@ -45,7 +46,8 @@ var MetadataItem = function MetadataItem(_ref2) {
|
|
|
45
46
|
name: name,
|
|
46
47
|
value: value,
|
|
47
48
|
imageIndex: imageIndex,
|
|
48
|
-
groupId: groupId
|
|
49
|
+
groupId: groupId,
|
|
50
|
+
metadataId: metadataId
|
|
49
51
|
});
|
|
50
52
|
};
|
|
51
53
|
|
|
@@ -112,11 +114,13 @@ var MetadataList = function MetadataList(_ref3) {
|
|
|
112
114
|
groupId = _ref3.groupId;
|
|
113
115
|
return React.createElement("div", null, React.createElement("h2", null, title), metadata && metadata.map(function (_ref4) {
|
|
114
116
|
var key = _ref4.key,
|
|
115
|
-
value = _ref4.value
|
|
117
|
+
value = _ref4.value,
|
|
118
|
+
metadataId = _ref4.metadataId;
|
|
116
119
|
return React.createElement(MetadataItem, {
|
|
117
120
|
name: key,
|
|
118
121
|
value: value,
|
|
119
122
|
imageIndex: imageIndex,
|
|
123
|
+
metadataId: metadataId,
|
|
120
124
|
groupId: groupId,
|
|
121
125
|
onChange: onMetadataChange,
|
|
122
126
|
metadataConfig: metadataConfigs.find(function (i) {
|
|
@@ -170,7 +174,7 @@ export var MetadataEditorSidebarBox = function MetadataEditorSidebarBox(_ref6) {
|
|
|
170
174
|
var selectedGroupId = state === null || state === void 0 ? void 0 : (_state$images$state$s2 = state.images[state.selectedImage]) === null || _state$images$state$s2 === void 0 ? void 0 : (_state$images$state$s3 = _state$images$state$s2.regions) === null || _state$images$state$s3 === void 0 ? void 0 : (_state$images$state$s4 = _state$images$state$s3.find(function (r) {
|
|
171
175
|
return r.highlighted === true;
|
|
172
176
|
})) === null || _state$images$state$s4 === void 0 ? void 0 : _state$images$state$s4.groupId;
|
|
173
|
-
var articleMetadata = [];
|
|
177
|
+
var articleMetadata = []; // example: [{key: "previousArticleId", value "123-123-123-123-123"}]
|
|
174
178
|
|
|
175
179
|
if (selectedGroupId !== undefined) {
|
|
176
180
|
var articleMetadataRegion = state === null || state === void 0 ? void 0 : state.images[state.selectedImage].regions.find(function (r) {
|