@searpent/react-image-annotate 2.0.27 → 2.0.28
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.
|
@@ -966,6 +966,7 @@ export default (function (state, action) {
|
|
|
966
966
|
var _regionIndex18 = getRegionIndex(action.region);
|
|
967
967
|
|
|
968
968
|
if (_regionIndex18 === null) return state;
|
|
969
|
+
state = saveToHistory(state, "Delete region");
|
|
969
970
|
return setIn(state, [].concat(_toConsumableArray(pathToActiveImage), ["regions"]), (activeImage.regions || []).filter(function (r) {
|
|
970
971
|
return r.id !== action.region.id;
|
|
971
972
|
}));
|
|
@@ -975,6 +976,7 @@ export default (function (state, action) {
|
|
|
975
976
|
{
|
|
976
977
|
var _groupId = action.groupId;
|
|
977
978
|
if (_groupId === null || _groupId === undefined) return state;
|
|
979
|
+
state = saveToHistory(state, "Delete group");
|
|
978
980
|
return setIn(state, [].concat(_toConsumableArray(pathToActiveImage), ["regions"]), (activeImage.regions || []).filter(function (r) {
|
|
979
981
|
return r.groupId !== _groupId;
|
|
980
982
|
}));
|
|
@@ -982,6 +984,7 @@ export default (function (state, action) {
|
|
|
982
984
|
|
|
983
985
|
case "DELETE_SELECTED_REGION":
|
|
984
986
|
{
|
|
987
|
+
state = saveToHistory(state, "Delete selected region");
|
|
985
988
|
return setIn(state, [].concat(_toConsumableArray(pathToActiveImage), ["regions"]), (activeImage.regions || []).filter(function (r) {
|
|
986
989
|
return !r.highlighted;
|
|
987
990
|
}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
function RightSidebarItemsWrapper(_ref) {
|
|
4
|
+
var children = _ref.children;
|
|
5
|
+
var elementRef = useRef();
|
|
6
|
+
useEffect(function () {
|
|
7
|
+
if (elementRef) {
|
|
8
|
+
var divElement = elementRef.current;
|
|
9
|
+
var parentEl = divElement.parentElement;
|
|
10
|
+
parentEl.style.overflowY = "scroll";
|
|
11
|
+
}
|
|
12
|
+
}, []);
|
|
13
|
+
return React.createElement("div", {
|
|
14
|
+
ref: elementRef
|
|
15
|
+
}, children);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default RightSidebarItemsWrapper;
|
package/MainLayout/index.js
CHANGED
|
@@ -35,7 +35,8 @@ import { withHotKeys } from "react-hotkeys";
|
|
|
35
35
|
import Editor from "../Editor";
|
|
36
36
|
import regionsToBlocks from '../utils/regions-to-blocks';
|
|
37
37
|
import PageSelector from "../PageSelector";
|
|
38
|
-
import regionsGroups from '../utils/regions-groups';
|
|
38
|
+
import regionsGroups from '../utils/regions-groups';
|
|
39
|
+
import RightSidebarItemsWrapper from './RightSidebarItemsWrapper'; // import Fullscreen from "../Fullscreen"
|
|
39
40
|
|
|
40
41
|
var emptyArr = [];
|
|
41
42
|
var theme = createTheme();
|
|
@@ -422,7 +423,7 @@ export var MainLayout = function MainLayout(_ref5) {
|
|
|
422
423
|
}].filter(Boolean).filter(function (a) {
|
|
423
424
|
return a.alwaysShowing || state.enabledTools.includes(a.name);
|
|
424
425
|
}),
|
|
425
|
-
rightSidebarItems: [debugModeOn && React.createElement(DebugBox, {
|
|
426
|
+
rightSidebarItems: [React.createElement(RightSidebarItemsWrapper, null, [debugModeOn && React.createElement(DebugBox, {
|
|
426
427
|
state: debugModeOn,
|
|
427
428
|
lastAction: state.lastAction,
|
|
428
429
|
key: "debug-box"
|
|
@@ -484,7 +485,7 @@ export var MainLayout = function MainLayout(_ref5) {
|
|
|
484
485
|
groups: allowedGroups,
|
|
485
486
|
onAddGroup: onAddGroup,
|
|
486
487
|
key: "groups-editor"
|
|
487
|
-
})].filter(Boolean)
|
|
488
|
+
})].filter(Boolean))]
|
|
488
489
|
}, canvas)), showEditor && React.createElement(EditorWrapper, {
|
|
489
490
|
id: "editor-wrapper"
|
|
490
491
|
}, React.createElement(Editor, {
|