@searpent/react-image-annotate 2.0.2 → 2.0.5
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/.babelrc +6 -0
- package/.env +1 -0
- package/.flowconfig +2 -0
- package/.github/workflows/release-on-master.yml +32 -0
- package/.github/workflows/test.yml +16 -0
- package/.prettierrc +3 -0
- package/.releaserc.js +18 -0
- package/.storybook/addons.js +2 -0
- package/.storybook/config.js +16 -0
- package/LICENSE +21 -0
- package/package.json +4 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +38 -0
- package/src/Annotator/bike-pic.png +0 -0
- package/src/Annotator/bike-pic2.png +0 -0
- package/src/Annotator/dab-keyframes.story.json +1 -0
- package/src/Annotator/examplePhotos.js +7601 -0
- package/src/Annotator/index.js +291 -0
- package/src/Annotator/index.story.js +807 -0
- package/src/Annotator/poses.story.js +150 -0
- package/src/Annotator/reducers/combine-reducers.js +7 -0
- package/src/Annotator/reducers/convert-expanding-line-to-polygon.js +53 -0
- package/{Annotator → src/Annotator}/reducers/fix-twisted.js +5 -3
- package/src/Annotator/reducers/general-reducer.js +996 -0
- package/src/Annotator/reducers/get-active-image.js +21 -0
- package/src/Annotator/reducers/get-implied-video-regions.js +115 -0
- package/src/Annotator/reducers/history-handler.js +60 -0
- package/src/Annotator/reducers/image-reducer.js +23 -0
- package/src/Annotator/reducers/video-reducer.js +85 -0
- package/src/Annotator/video.story.js +51 -0
- package/src/ClassSelectionMenu/index.js +108 -0
- package/src/Crosshairs/index.js +64 -0
- package/src/DebugSidebarBox/index.js +36 -0
- package/src/DemoSite/Editor.js +235 -0
- package/src/DemoSite/ErrorBoundaryDialog.js +34 -0
- package/src/DemoSite/index.js +41 -0
- package/src/DemoSite/index.story.js +10 -0
- package/src/DemoSite/simple-segmentation-example.json +572 -0
- package/src/Editor/annotation-plugin/annotation.css +46 -0
- package/src/Editor/annotation-plugin/annotation.js +515 -0
- package/src/Editor/index.js +24 -0
- package/src/Editor/tools.js +6 -0
- package/src/FullImageSegmentationAnnotator/hard1.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/hard2.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/hard3.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/index.js +7 -0
- package/src/FullImageSegmentationAnnotator/index.story.js +177 -0
- package/src/FullImageSegmentationAnnotator/orange.story.png +0 -0
- package/src/GroupSelectorSidebarBox/index.js +48 -0
- package/src/HighlightBox/index.js +143 -0
- package/src/HistorySidebarBox/index.js +78 -0
- package/src/ImageCanvas/dancing-man.story.jpg +0 -0
- package/src/ImageCanvas/index.js +494 -0
- package/src/ImageCanvas/index.story.js +314 -0
- package/src/ImageCanvas/mouse_mask.story.png +0 -0
- package/src/ImageCanvas/region-tools.js +171 -0
- package/src/ImageCanvas/seves_desk.story.jpg +0 -0
- package/{ImageCanvas → src/ImageCanvas}/styles.js +8 -12
- package/src/ImageCanvas/use-mouse.js +168 -0
- package/src/ImageCanvas/use-project-box.js +23 -0
- package/src/ImageCanvas/use-wasd-mode.js +50 -0
- package/src/ImageMask/index.js +127 -0
- package/src/ImageMask/load-image.js +32 -0
- package/src/ImageSelectorSidebarBox/index.js +54 -0
- package/src/KeyframeTimeline/get-time-string.js +25 -0
- package/src/KeyframeTimeline/index.js +223 -0
- package/src/KeyframesSelectorSidebarBox/index.js +93 -0
- package/src/LandingPage/content.md +57 -0
- package/src/LandingPage/github-markdown.css +964 -0
- package/src/LandingPage/index.js +147 -0
- package/src/MainLayout/icon-dictionary.js +79 -0
- package/src/MainLayout/index.js +510 -0
- package/src/MainLayout/index.story.js +240 -0
- package/{MainLayout → src/MainLayout}/styles.js +7 -6
- package/src/MainLayout/types.js +164 -0
- package/src/MainLayout/use-implied-video-regions.js +17 -0
- package/src/MetadataEditorSidebarBox/index.js +98 -0
- package/src/PageSelector/index.js +76 -0
- package/src/PageSelector/page-selector.css +69 -0
- package/src/PointDistances/index.js +90 -0
- package/src/PreventScrollToParents/index.js +48 -0
- package/src/PreventScrollToParents/index.story.js +23 -0
- package/src/RegionLabel/index.js +222 -0
- package/{RegionLabel → src/RegionLabel}/styles.js +15 -12
- package/src/RegionSelectAndTransformBoxes/index.js +234 -0
- package/src/RegionSelectorSidebarBox/index.js +216 -0
- package/{RegionSelectorSidebarBox → src/RegionSelectorSidebarBox}/styles.js +14 -13
- package/src/RegionShapes/index.js +254 -0
- package/src/RegionTags/index.js +134 -0
- package/src/SettingsDialog/index.js +58 -0
- package/src/SettingsProvider/index.js +48 -0
- package/src/Shortcuts/ShortcutField.js +44 -0
- package/src/Shortcuts/index.js +129 -0
- package/src/ShortcutsManager/index.js +162 -0
- package/src/Sidebar/index.js +117 -0
- package/src/SidebarBoxContainer/index.js +93 -0
- package/src/SmallToolButton/index.js +57 -0
- package/src/TagsSidebarBox/index.js +93 -0
- package/src/TaskDescriptionSidebarBox/index.js +43 -0
- package/src/Theme/index.js +36 -0
- package/src/VideoOrImageCanvasBackground/index.js +170 -0
- package/src/colors.js +32 -0
- package/src/hooks/use-colors.js +74 -0
- package/src/hooks/use-event-callback.js +11 -0
- package/src/hooks/use-exclude-pattern.js +27 -0
- package/src/hooks/use-load-image.js +21 -0
- package/src/hooks/use-window-size.js +46 -0
- package/{hooks → src/hooks}/xpattern.js +1 -1
- package/src/hooks/xpattern.png +0 -0
- package/src/index.js +18 -0
- package/src/lib.js +7 -0
- package/src/screenshot.png +0 -0
- package/src/site.css +5 -0
- package/src/stories.js +2 -0
- package/src/utils/filter-only-unique.js +5 -0
- package/src/utils/get-from-local-storage.js +7 -0
- package/src/utils/get-hotkey-help-text.js +11 -0
- package/src/utils/get-landmarks-with-transform.js +23 -0
- package/src/utils/photosToImages.js +40 -0
- package/src/utils/regions-to-blocks.js +14 -0
- package/src/utils/set-in-local-storage.js +6 -0
- package/Annotator/index.js +0 -161
- package/Annotator/reducers/combine-reducers.js +0 -14
- package/Annotator/reducers/convert-expanding-line-to-polygon.js +0 -73
- package/Annotator/reducers/general-reducer.js +0 -1058
- package/Annotator/reducers/get-active-image.js +0 -27
- package/Annotator/reducers/get-implied-video-regions.js +0 -180
- package/Annotator/reducers/history-handler.js +0 -38
- package/Annotator/reducers/image-reducer.js +0 -20
- package/Annotator/reducers/video-reducer.js +0 -88
- package/ClassSelectionMenu/index.js +0 -135
- package/Crosshairs/index.js +0 -53
- package/DebugSidebarBox/index.js +0 -20
- package/DemoSite/Editor.js +0 -194
- package/DemoSite/ErrorBoundaryDialog.js +0 -64
- package/DemoSite/index.js +0 -40
- package/FullImageSegmentationAnnotator/index.js +0 -7
- package/HighlightBox/index.js +0 -99
- package/HistorySidebarBox/index.js +0 -71
- package/ImageCanvas/index.js +0 -424
- package/ImageCanvas/region-tools.js +0 -165
- package/ImageCanvas/use-mouse.js +0 -180
- package/ImageCanvas/use-project-box.js +0 -27
- package/ImageCanvas/use-wasd-mode.js +0 -62
- package/ImageMask/index.js +0 -133
- package/ImageMask/load-image.js +0 -25
- package/ImageSelectorSidebarBox/index.js +0 -60
- package/KeyframeTimeline/get-time-string.js +0 -27
- package/KeyframeTimeline/index.js +0 -233
- package/KeyframesSelectorSidebarBox/index.js +0 -93
- package/LandingPage/index.js +0 -159
- package/MainLayout/icon-dictionary.js +0 -104
- package/MainLayout/index.js +0 -352
- package/MainLayout/types.js +0 -0
- package/MainLayout/use-implied-video-regions.js +0 -13
- package/PointDistances/index.js +0 -73
- package/PreventScrollToParents/index.js +0 -51
- package/RegionLabel/index.js +0 -191
- package/RegionSelectAndTransformBoxes/index.js +0 -167
- package/RegionSelectorSidebarBox/index.js +0 -248
- package/RegionShapes/index.js +0 -274
- package/RegionTags/index.js +0 -138
- package/SettingsDialog/index.js +0 -52
- package/SettingsProvider/index.js +0 -53
- package/Shortcuts/ShortcutField.js +0 -46
- package/Shortcuts/index.js +0 -133
- package/ShortcutsManager/index.js +0 -155
- package/Sidebar/index.js +0 -69
- package/SidebarBoxContainer/index.js +0 -93
- package/SmallToolButton/index.js +0 -42
- package/TagsSidebarBox/index.js +0 -105
- package/TaskDescriptionSidebarBox/index.js +0 -58
- package/Theme/index.js +0 -30
- package/VideoOrImageCanvasBackground/index.js +0 -151
- package/colors.js +0 -14
- package/hooks/use-event-callback.js +0 -10
- package/hooks/use-exclude-pattern.js +0 -24
- package/hooks/use-load-image.js +0 -26
- package/hooks/use-window-size.js +0 -46
- package/index.js +0 -3
- package/lib.js +0 -3
- package/stories.js +0 -5
- package/utils/get-from-local-storage.js +0 -7
- package/utils/get-hotkey-help-text.js +0 -9
- package/utils/get-landmarks-with-transform.js +0 -40
- package/utils/set-in-local-storage.js +0 -3
package/MainLayout/index.js
DELETED
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import { FullScreen, useFullScreenHandle } from "react-full-screen";
|
|
4
|
-
import React, { useCallback, useRef } from "react";
|
|
5
|
-
import { makeStyles } from "@mui/styles";
|
|
6
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
7
|
-
import { styled } from "@mui/material/styles";
|
|
8
|
-
import ClassSelectionMenu from "../ClassSelectionMenu";
|
|
9
|
-
import DebugBox from "../DebugSidebarBox";
|
|
10
|
-
import HistorySidebarBox from "../HistorySidebarBox";
|
|
11
|
-
import ImageCanvas from "../ImageCanvas";
|
|
12
|
-
import ImageSelector from "../ImageSelectorSidebarBox";
|
|
13
|
-
import KeyframeTimeline from "../KeyframeTimeline";
|
|
14
|
-
import KeyframesSelector from "../KeyframesSelectorSidebarBox";
|
|
15
|
-
import RegionSelector from "../RegionSelectorSidebarBox";
|
|
16
|
-
import SettingsDialog from "../SettingsDialog";
|
|
17
|
-
import TagsSidebarBox from "../TagsSidebarBox";
|
|
18
|
-
import TaskDescription from "../TaskDescriptionSidebarBox";
|
|
19
|
-
import Workspace from "react-material-workspace-layout/Workspace";
|
|
20
|
-
import classnames from "classnames";
|
|
21
|
-
import getActiveImage from "../Annotator/reducers/get-active-image";
|
|
22
|
-
import getHotkeyHelpText from "../utils/get-hotkey-help-text";
|
|
23
|
-
import iconDictionary from "./icon-dictionary";
|
|
24
|
-
import styles from "./styles";
|
|
25
|
-
import { useDispatchHotkeyHandlers } from "../ShortcutsManager";
|
|
26
|
-
import useEventCallback from "use-event-callback";
|
|
27
|
-
import useImpliedVideoRegions from "./use-implied-video-regions";
|
|
28
|
-
import useKey from "use-key-hook";
|
|
29
|
-
import { useSettings } from "../SettingsProvider";
|
|
30
|
-
import { withHotKeys } from "react-hotkeys"; // import Fullscreen from "../Fullscreen"
|
|
31
|
-
|
|
32
|
-
var emptyArr = [];
|
|
33
|
-
var theme = createTheme();
|
|
34
|
-
var useStyles = makeStyles(function (theme) {
|
|
35
|
-
return styles;
|
|
36
|
-
});
|
|
37
|
-
var HotkeyDiv = withHotKeys(function (_ref) {
|
|
38
|
-
var hotKeys = _ref.hotKeys,
|
|
39
|
-
children = _ref.children,
|
|
40
|
-
divRef = _ref.divRef,
|
|
41
|
-
props = _objectWithoutProperties(_ref, ["hotKeys", "children", "divRef"]);
|
|
42
|
-
|
|
43
|
-
return React.createElement("div", Object.assign({}, _objectSpread({}, hotKeys, props), {
|
|
44
|
-
ref: divRef
|
|
45
|
-
}), children);
|
|
46
|
-
});
|
|
47
|
-
var FullScreenContainer = styled("div")(function (_ref2) {
|
|
48
|
-
var theme = _ref2.theme;
|
|
49
|
-
return {
|
|
50
|
-
width: "100%",
|
|
51
|
-
height: "100%",
|
|
52
|
-
"& .fullscreen": {
|
|
53
|
-
width: "100%",
|
|
54
|
-
height: "100%"
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
export var MainLayout = function MainLayout(_ref3) {
|
|
59
|
-
var state = _ref3.state,
|
|
60
|
-
dispatch = _ref3.dispatch,
|
|
61
|
-
_ref3$alwaysShowNextB = _ref3.alwaysShowNextButton,
|
|
62
|
-
alwaysShowNextButton = _ref3$alwaysShowNextB === void 0 ? false : _ref3$alwaysShowNextB,
|
|
63
|
-
_ref3$alwaysShowPrevB = _ref3.alwaysShowPrevButton,
|
|
64
|
-
alwaysShowPrevButton = _ref3$alwaysShowPrevB === void 0 ? false : _ref3$alwaysShowPrevB,
|
|
65
|
-
RegionEditLabel = _ref3.RegionEditLabel,
|
|
66
|
-
onRegionClassAdded = _ref3.onRegionClassAdded,
|
|
67
|
-
hideHeader = _ref3.hideHeader,
|
|
68
|
-
hideHeaderText = _ref3.hideHeaderText,
|
|
69
|
-
_ref3$hideNext = _ref3.hideNext,
|
|
70
|
-
hideNext = _ref3$hideNext === void 0 ? false : _ref3$hideNext,
|
|
71
|
-
_ref3$hidePrev = _ref3.hidePrev,
|
|
72
|
-
hidePrev = _ref3$hidePrev === void 0 ? false : _ref3$hidePrev,
|
|
73
|
-
_ref3$hideClone = _ref3.hideClone,
|
|
74
|
-
hideClone = _ref3$hideClone === void 0 ? false : _ref3$hideClone,
|
|
75
|
-
_ref3$hideSettings = _ref3.hideSettings,
|
|
76
|
-
hideSettings = _ref3$hideSettings === void 0 ? false : _ref3$hideSettings,
|
|
77
|
-
_ref3$hideFullScreen = _ref3.hideFullScreen,
|
|
78
|
-
hideFullScreen = _ref3$hideFullScreen === void 0 ? false : _ref3$hideFullScreen,
|
|
79
|
-
_ref3$hideSave = _ref3.hideSave,
|
|
80
|
-
hideSave = _ref3$hideSave === void 0 ? false : _ref3$hideSave;
|
|
81
|
-
var classes = useStyles();
|
|
82
|
-
var settings = useSettings();
|
|
83
|
-
var fullScreenHandle = useFullScreenHandle();
|
|
84
|
-
var memoizedActionFns = useRef({});
|
|
85
|
-
|
|
86
|
-
var action = function action(type) {
|
|
87
|
-
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
88
|
-
params[_key - 1] = arguments[_key];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var fnKey = "".concat(type, "(").concat(params.join(","), ")");
|
|
92
|
-
if (memoizedActionFns.current[fnKey]) return memoizedActionFns.current[fnKey];
|
|
93
|
-
|
|
94
|
-
var fn = function fn() {
|
|
95
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
96
|
-
args[_key2] = arguments[_key2];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return params.length > 0 ? dispatch(_objectSpread({
|
|
100
|
-
type: type
|
|
101
|
-
}, params.reduce(function (acc, p, i) {
|
|
102
|
-
return acc[p] = args[i], acc;
|
|
103
|
-
}, {}))) : dispatch(_objectSpread({
|
|
104
|
-
type: type
|
|
105
|
-
}, args[0]));
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
memoizedActionFns.current[fnKey] = fn;
|
|
109
|
-
return fn;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
var _getActiveImage = getActiveImage(state),
|
|
113
|
-
currentImageIndex = _getActiveImage.currentImageIndex,
|
|
114
|
-
activeImage = _getActiveImage.activeImage;
|
|
115
|
-
|
|
116
|
-
var nextImage;
|
|
117
|
-
|
|
118
|
-
if (currentImageIndex !== null) {
|
|
119
|
-
nextImage = state.images[currentImageIndex + 1];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
useKey(function () {
|
|
123
|
-
return dispatch({
|
|
124
|
-
type: "CANCEL"
|
|
125
|
-
});
|
|
126
|
-
}, {
|
|
127
|
-
detectKeys: [27]
|
|
128
|
-
});
|
|
129
|
-
var isAVideoFrame = activeImage && activeImage.frameTime !== undefined;
|
|
130
|
-
var innerContainerRef = useRef();
|
|
131
|
-
var hotkeyHandlers = useDispatchHotkeyHandlers({
|
|
132
|
-
dispatch: dispatch
|
|
133
|
-
});
|
|
134
|
-
var impliedVideoRegions = useImpliedVideoRegions(state);
|
|
135
|
-
var refocusOnMouseEvent = useCallback(function (e) {
|
|
136
|
-
if (!innerContainerRef.current) return;
|
|
137
|
-
if (innerContainerRef.current.contains(document.activeElement)) return;
|
|
138
|
-
|
|
139
|
-
if (innerContainerRef.current.contains(e.target)) {
|
|
140
|
-
innerContainerRef.current.focus();
|
|
141
|
-
e.target.focus();
|
|
142
|
-
}
|
|
143
|
-
}, []);
|
|
144
|
-
var canvas = React.createElement(ImageCanvas, Object.assign({}, settings, {
|
|
145
|
-
showCrosshairs: settings.showCrosshairs && !["select", "pan", "zoom"].includes(state.selectedTool),
|
|
146
|
-
key: state.selectedImage,
|
|
147
|
-
showMask: state.showMask,
|
|
148
|
-
fullImageSegmentationMode: state.fullImageSegmentationMode,
|
|
149
|
-
autoSegmentationOptions: state.autoSegmentationOptions,
|
|
150
|
-
showTags: state.showTags,
|
|
151
|
-
allowedArea: state.allowedArea,
|
|
152
|
-
modifyingAllowedArea: state.selectedTool === "modify-allowed-area",
|
|
153
|
-
regionClsList: state.regionClsList,
|
|
154
|
-
regionTagList: state.regionTagList,
|
|
155
|
-
regions: state.annotationType === "image" ? activeImage.regions || [] : impliedVideoRegions,
|
|
156
|
-
realSize: activeImage ? activeImage.realSize : undefined,
|
|
157
|
-
videoPlaying: state.videoPlaying,
|
|
158
|
-
imageSrc: state.annotationType === "image" ? activeImage.src : null,
|
|
159
|
-
videoSrc: state.annotationType === "video" ? state.videoSrc : null,
|
|
160
|
-
pointDistancePrecision: state.pointDistancePrecision,
|
|
161
|
-
createWithPrimary: state.selectedTool.includes("create"),
|
|
162
|
-
dragWithPrimary: state.selectedTool === "pan",
|
|
163
|
-
zoomWithPrimary: state.selectedTool === "zoom",
|
|
164
|
-
showPointDistances: state.showPointDistances,
|
|
165
|
-
videoTime: state.annotationType === "image" ? state.selectedImageFrameTime : state.currentVideoTime,
|
|
166
|
-
keypointDefinitions: state.keypointDefinitions,
|
|
167
|
-
onMouseMove: action("MOUSE_MOVE"),
|
|
168
|
-
onMouseDown: action("MOUSE_DOWN"),
|
|
169
|
-
onMouseUp: action("MOUSE_UP"),
|
|
170
|
-
onChangeRegion: action("CHANGE_REGION", "region"),
|
|
171
|
-
onBeginRegionEdit: action("OPEN_REGION_EDITOR", "region"),
|
|
172
|
-
onCloseRegionEdit: action("CLOSE_REGION_EDITOR", "region"),
|
|
173
|
-
onDeleteRegion: action("DELETE_REGION", "region"),
|
|
174
|
-
onBeginBoxTransform: action("BEGIN_BOX_TRANSFORM", "box", "directions"),
|
|
175
|
-
onBeginMovePolygonPoint: action("BEGIN_MOVE_POLYGON_POINT", "polygon", "pointIndex"),
|
|
176
|
-
onBeginMoveKeypoint: action("BEGIN_MOVE_KEYPOINT", "region", "keypointId"),
|
|
177
|
-
onAddPolygonPoint: action("ADD_POLYGON_POINT", "polygon", "point", "pointIndex"),
|
|
178
|
-
onSelectRegion: action("SELECT_REGION", "region"),
|
|
179
|
-
onBeginMovePoint: action("BEGIN_MOVE_POINT", "point"),
|
|
180
|
-
onImageLoaded: action("IMAGE_LOADED", "image"),
|
|
181
|
-
RegionEditLabel: RegionEditLabel,
|
|
182
|
-
onImageOrVideoLoaded: action("IMAGE_OR_VIDEO_LOADED", "metadata"),
|
|
183
|
-
onChangeVideoTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
184
|
-
onChangeVideoPlaying: action("CHANGE_VIDEO_PLAYING", "isPlaying"),
|
|
185
|
-
onRegionClassAdded: onRegionClassAdded,
|
|
186
|
-
allowComments: state.allowComments
|
|
187
|
-
}));
|
|
188
|
-
var onClickIconSidebarItem = useEventCallback(function (item) {
|
|
189
|
-
dispatch({
|
|
190
|
-
type: "SELECT_TOOL",
|
|
191
|
-
selectedTool: item.name
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
var onClickHeaderItem = useEventCallback(function (item) {
|
|
195
|
-
if (item.name === "Fullscreen") {
|
|
196
|
-
fullScreenHandle.enter();
|
|
197
|
-
} else if (item.name === "Window") {
|
|
198
|
-
fullScreenHandle.exit();
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
dispatch({
|
|
202
|
-
type: "HEADER_BUTTON_CLICKED",
|
|
203
|
-
buttonName: item.name
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
var debugModeOn = Boolean(window.localStorage.$ANNOTATE_DEBUG_MODE && state);
|
|
207
|
-
var nextImageHasRegions = !nextImage || nextImage.regions && nextImage.regions.length > 0;
|
|
208
|
-
return React.createElement(ThemeProvider, {
|
|
209
|
-
theme: theme
|
|
210
|
-
}, React.createElement(FullScreenContainer, null, React.createElement(FullScreen, {
|
|
211
|
-
handle: fullScreenHandle,
|
|
212
|
-
onChange: function onChange(open) {
|
|
213
|
-
if (!open) {
|
|
214
|
-
fullScreenHandle.exit();
|
|
215
|
-
action("HEADER_BUTTON_CLICKED", "buttonName")("Window");
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}, React.createElement(HotkeyDiv, {
|
|
219
|
-
tabIndex: -1,
|
|
220
|
-
divRef: innerContainerRef,
|
|
221
|
-
onMouseDown: refocusOnMouseEvent,
|
|
222
|
-
onMouseOver: refocusOnMouseEvent,
|
|
223
|
-
allowChanges: true,
|
|
224
|
-
handlers: hotkeyHandlers,
|
|
225
|
-
className: classnames(classes.container, state.fullScreen && "Fullscreen")
|
|
226
|
-
}, React.createElement(Workspace, {
|
|
227
|
-
allowFullscreen: true,
|
|
228
|
-
iconDictionary: iconDictionary,
|
|
229
|
-
hideHeader: hideHeader,
|
|
230
|
-
hideHeaderText: hideHeaderText,
|
|
231
|
-
headerLeftSide: [state.annotationType === "video" ? React.createElement(KeyframeTimeline, {
|
|
232
|
-
currentTime: state.currentVideoTime,
|
|
233
|
-
duration: state.videoDuration,
|
|
234
|
-
onChangeCurrentTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
235
|
-
keyframes: state.keyframes
|
|
236
|
-
}) : activeImage ? React.createElement("div", {
|
|
237
|
-
className: classes.headerTitle
|
|
238
|
-
}, activeImage.name) : null].filter(Boolean),
|
|
239
|
-
headerItems: [!hidePrev && {
|
|
240
|
-
name: "Prev"
|
|
241
|
-
}, !hideNext && {
|
|
242
|
-
name: "Next"
|
|
243
|
-
}, state.annotationType !== "video" ? null : !state.videoPlaying ? {
|
|
244
|
-
name: "Play"
|
|
245
|
-
} : {
|
|
246
|
-
name: "Pause"
|
|
247
|
-
}, !hideClone && !nextImageHasRegions && activeImage.regions && {
|
|
248
|
-
name: "Clone"
|
|
249
|
-
}, !hideSettings && {
|
|
250
|
-
name: "Settings"
|
|
251
|
-
}, !hideFullScreen && (state.fullScreen ? {
|
|
252
|
-
name: "Window"
|
|
253
|
-
} : {
|
|
254
|
-
name: "Fullscreen"
|
|
255
|
-
}), !hideSave && {
|
|
256
|
-
name: "Save"
|
|
257
|
-
}].filter(Boolean),
|
|
258
|
-
onClickHeaderItem: onClickHeaderItem,
|
|
259
|
-
onClickIconSidebarItem: onClickIconSidebarItem,
|
|
260
|
-
selectedTools: [state.selectedTool, state.showTags && "show-tags", state.showMask && "show-mask"].filter(Boolean),
|
|
261
|
-
iconSidebarItems: [{
|
|
262
|
-
name: "select",
|
|
263
|
-
helperText: "Select" + getHotkeyHelpText("select_tool"),
|
|
264
|
-
alwaysShowing: true
|
|
265
|
-
}, {
|
|
266
|
-
name: "pan",
|
|
267
|
-
helperText: "Drag/Pan (right or middle click)" + getHotkeyHelpText("pan_tool"),
|
|
268
|
-
alwaysShowing: true
|
|
269
|
-
}, {
|
|
270
|
-
name: "zoom",
|
|
271
|
-
helperText: "Zoom In/Out (scroll)" + getHotkeyHelpText("zoom_tool"),
|
|
272
|
-
alwaysShowing: true
|
|
273
|
-
}, {
|
|
274
|
-
name: "show-tags",
|
|
275
|
-
helperText: "Show / Hide Tags",
|
|
276
|
-
alwaysShowing: true
|
|
277
|
-
}, {
|
|
278
|
-
name: "create-point",
|
|
279
|
-
helperText: "Add Point" + getHotkeyHelpText("create_point")
|
|
280
|
-
}, {
|
|
281
|
-
name: "create-box",
|
|
282
|
-
helperText: "Add Bounding Box" + getHotkeyHelpText("create_bounding_box")
|
|
283
|
-
}, {
|
|
284
|
-
name: "create-polygon",
|
|
285
|
-
helperText: "Add Polygon" + getHotkeyHelpText("create_polygon")
|
|
286
|
-
}, {
|
|
287
|
-
name: "create-line",
|
|
288
|
-
helperText: "Add Line"
|
|
289
|
-
}, {
|
|
290
|
-
name: "create-expanding-line",
|
|
291
|
-
helperText: "Add Expanding Line"
|
|
292
|
-
}, {
|
|
293
|
-
name: "create-keypoints",
|
|
294
|
-
helperText: "Add Keypoints (Pose)"
|
|
295
|
-
}, state.fullImageSegmentationMode && {
|
|
296
|
-
name: "show-mask",
|
|
297
|
-
alwaysShowing: true,
|
|
298
|
-
helperText: "Show / Hide Mask"
|
|
299
|
-
}, {
|
|
300
|
-
name: "modify-allowed-area",
|
|
301
|
-
helperText: "Modify Allowed Area"
|
|
302
|
-
}].filter(Boolean).filter(function (a) {
|
|
303
|
-
return a.alwaysShowing || state.enabledTools.includes(a.name);
|
|
304
|
-
}),
|
|
305
|
-
rightSidebarItems: [debugModeOn && React.createElement(DebugBox, {
|
|
306
|
-
state: debugModeOn,
|
|
307
|
-
lastAction: state.lastAction
|
|
308
|
-
}), state.taskDescription && React.createElement(TaskDescription, {
|
|
309
|
-
description: state.taskDescription
|
|
310
|
-
}), state.regionClsList && React.createElement(ClassSelectionMenu, {
|
|
311
|
-
selectedCls: state.selectedCls,
|
|
312
|
-
regionClsList: state.regionClsList,
|
|
313
|
-
onSelectCls: action("SELECT_CLASSIFICATION", "cls")
|
|
314
|
-
}), state.labelImages && React.createElement(TagsSidebarBox, {
|
|
315
|
-
currentImage: activeImage,
|
|
316
|
-
imageClsList: state.imageClsList,
|
|
317
|
-
imageTagList: state.imageTagList,
|
|
318
|
-
onChangeImage: action("CHANGE_IMAGE", "delta"),
|
|
319
|
-
expandedByDefault: true
|
|
320
|
-
}), // (state.images?.length || 0) > 1 && (
|
|
321
|
-
// <ImageSelector
|
|
322
|
-
// onSelect={action("SELECT_REGION", "region")}
|
|
323
|
-
// images={state.images}
|
|
324
|
-
// />
|
|
325
|
-
// ),
|
|
326
|
-
React.createElement(RegionSelector, {
|
|
327
|
-
regions: activeImage ? activeImage.regions : emptyArr,
|
|
328
|
-
onSelectRegion: action("SELECT_REGION", "region"),
|
|
329
|
-
onDeleteRegion: action("DELETE_REGION", "region"),
|
|
330
|
-
onChangeRegion: action("CHANGE_REGION", "region")
|
|
331
|
-
}), state.keyframes && React.createElement(KeyframesSelector, {
|
|
332
|
-
onChangeVideoTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
333
|
-
onDeleteKeyframe: action("DELETE_KEYFRAME", "time"),
|
|
334
|
-
onChangeCurrentTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
335
|
-
currentTime: state.currentVideoTime,
|
|
336
|
-
duration: state.videoDuration,
|
|
337
|
-
keyframes: state.keyframes
|
|
338
|
-
}), React.createElement(HistorySidebarBox, {
|
|
339
|
-
history: state.history,
|
|
340
|
-
onRestoreHistory: action("RESTORE_HISTORY")
|
|
341
|
-
})].filter(Boolean)
|
|
342
|
-
}, canvas), React.createElement(SettingsDialog, {
|
|
343
|
-
open: state.settingsOpen,
|
|
344
|
-
onClose: function onClose() {
|
|
345
|
-
return dispatch({
|
|
346
|
-
type: "HEADER_BUTTON_CLICKED",
|
|
347
|
-
buttonName: "Settings"
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
})))));
|
|
351
|
-
};
|
|
352
|
-
export default MainLayout;
|
package/MainLayout/types.js
DELETED
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import getImpliedVideoRegions from "../Annotator/reducers/get-implied-video-regions.js";
|
|
3
|
-
var emptyArr = [];
|
|
4
|
-
export default (function (state) {
|
|
5
|
-
if (state.annotationType !== "video") return emptyArr;
|
|
6
|
-
var keyframes = state.keyframes,
|
|
7
|
-
_state$currentVideoTi = state.currentVideoTime,
|
|
8
|
-
currentVideoTime = _state$currentVideoTi === void 0 ? 0 : _state$currentVideoTi; // TODO memoize
|
|
9
|
-
|
|
10
|
-
return useMemo(function () {
|
|
11
|
-
return getImpliedVideoRegions(keyframes, currentVideoTime);
|
|
12
|
-
}, [keyframes, currentVideoTime]);
|
|
13
|
-
});
|
package/PointDistances/index.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
2
|
-
import { styled } from "@mui/material/styles";
|
|
3
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
4
|
-
var theme = createTheme();
|
|
5
|
-
var Svg = styled("svg")(function (_ref) {
|
|
6
|
-
var theme = _ref.theme;
|
|
7
|
-
return {
|
|
8
|
-
pointerEvents: "none",
|
|
9
|
-
position: "absolute",
|
|
10
|
-
zIndex: 1,
|
|
11
|
-
left: 0,
|
|
12
|
-
top: 0,
|
|
13
|
-
width: "100%",
|
|
14
|
-
height: "100%",
|
|
15
|
-
"& text": {
|
|
16
|
-
fill: "#fff"
|
|
17
|
-
},
|
|
18
|
-
"& path": {
|
|
19
|
-
vectorEffect: "non-scaling-stroke",
|
|
20
|
-
strokeWidth: 2,
|
|
21
|
-
opacity: 0.5,
|
|
22
|
-
stroke: "#FFF",
|
|
23
|
-
fill: "none",
|
|
24
|
-
strokeDasharray: 5,
|
|
25
|
-
animationDuration: "4s",
|
|
26
|
-
animationTimingFunction: "linear",
|
|
27
|
-
animationIterationCount: "infinite",
|
|
28
|
-
animationPlayState: "running"
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
export var PointDistances = function PointDistances(_ref2) {
|
|
33
|
-
var projectRegionBox = _ref2.projectRegionBox,
|
|
34
|
-
regions = _ref2.regions,
|
|
35
|
-
pointDistancePrecision = _ref2.pointDistancePrecision,
|
|
36
|
-
realSize = _ref2.realSize;
|
|
37
|
-
return React.createElement(ThemeProvider, {
|
|
38
|
-
theme: theme
|
|
39
|
-
}, React.createElement(Svg, null, regions.filter(function (r1) {
|
|
40
|
-
return r1.type === "point";
|
|
41
|
-
}).flatMap(function (r1, i1) {
|
|
42
|
-
return regions.filter(function (r2, i2) {
|
|
43
|
-
return i2 > i1;
|
|
44
|
-
}).filter(function (r2) {
|
|
45
|
-
return r2.type === "point";
|
|
46
|
-
}).map(function (r2) {
|
|
47
|
-
var pr1 = projectRegionBox(r1);
|
|
48
|
-
var pr2 = projectRegionBox(r2);
|
|
49
|
-
var prm = {
|
|
50
|
-
x: (pr1.x + pr1.w / 2 + pr2.x + pr2.w / 2) / 2,
|
|
51
|
-
y: (pr1.y + pr1.h / 2 + pr2.y + pr2.h / 2) / 2
|
|
52
|
-
};
|
|
53
|
-
var displayDistance;
|
|
54
|
-
|
|
55
|
-
if (realSize) {
|
|
56
|
-
var w = realSize.w,
|
|
57
|
-
h = realSize.h,
|
|
58
|
-
unitName = realSize.unitName;
|
|
59
|
-
displayDistance = Math.sqrt(Math.pow(r1.x * w - r2.x * w, 2) + Math.pow(r1.y * h - r2.y * h, 2)).toFixed(pointDistancePrecision) + unitName;
|
|
60
|
-
} else {
|
|
61
|
-
displayDistance = (Math.sqrt(Math.pow(r1.x - r2.x, 2) + Math.pow(r1.y - r2.y, 2)) * 100).toFixed(pointDistancePrecision) + "%";
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return React.createElement(Fragment, null, React.createElement("path", {
|
|
65
|
-
d: "M".concat(pr1.x + pr1.w / 2, ",").concat(pr1.y + pr1.h / 2, " L").concat(pr2.x + pr2.w / 2, ",").concat(pr2.y + pr2.h / 2)
|
|
66
|
-
}), React.createElement("text", {
|
|
67
|
-
x: prm.x,
|
|
68
|
-
y: prm.y
|
|
69
|
-
}, displayDistance));
|
|
70
|
-
});
|
|
71
|
-
})));
|
|
72
|
-
};
|
|
73
|
-
export default PointDistances;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
import { RemoveScroll } from "react-remove-scroll";
|
|
5
|
-
import { styled } from "@mui/material/styles";
|
|
6
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
7
|
-
import useEventCallback from "use-event-callback";
|
|
8
|
-
var theme = createTheme();
|
|
9
|
-
var Container = styled("div")(function (_ref) {
|
|
10
|
-
var theme = _ref.theme;
|
|
11
|
-
return {
|
|
12
|
-
"& > div": {
|
|
13
|
-
width: "100%",
|
|
14
|
-
height: "100%"
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
export var PreventScrollToParents = function PreventScrollToParents(_ref2) {
|
|
19
|
-
var children = _ref2.children,
|
|
20
|
-
otherProps = _objectWithoutProperties(_ref2, ["children"]);
|
|
21
|
-
|
|
22
|
-
var _useState = useState(false),
|
|
23
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
-
mouseOver = _useState2[0],
|
|
25
|
-
changeMouseOver = _useState2[1];
|
|
26
|
-
|
|
27
|
-
var onMouseMove = useEventCallback(function (e) {
|
|
28
|
-
if (!mouseOver) changeMouseOver(true);
|
|
29
|
-
|
|
30
|
-
if (otherProps.onMouseMove) {
|
|
31
|
-
otherProps.onMouseMove(e);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
var onMouseLeave = useEventCallback(function (e) {
|
|
35
|
-
setTimeout(function () {
|
|
36
|
-
if (mouseOver) {
|
|
37
|
-
changeMouseOver(false);
|
|
38
|
-
}
|
|
39
|
-
}, 100);
|
|
40
|
-
});
|
|
41
|
-
return React.createElement(ThemeProvider, {
|
|
42
|
-
theme: theme
|
|
43
|
-
}, React.createElement(Container, Object.assign({}, otherProps, {
|
|
44
|
-
onMouseMove: onMouseMove,
|
|
45
|
-
onMouseLeave: onMouseLeave
|
|
46
|
-
}), React.createElement(RemoveScroll, {
|
|
47
|
-
enabled: mouseOver,
|
|
48
|
-
removeScrollBar: false
|
|
49
|
-
}, children)));
|
|
50
|
-
};
|
|
51
|
-
export default PreventScrollToParents;
|
package/RegionLabel/index.js
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";
|
|
2
|
-
import React, { useRef, memo } from "react";
|
|
3
|
-
import Paper from "@mui/material/Paper";
|
|
4
|
-
import { makeStyles } from "@mui/styles";
|
|
5
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
6
|
-
import styles from "./styles";
|
|
7
|
-
import classnames from "classnames";
|
|
8
|
-
import IconButton from "@mui/material/IconButton";
|
|
9
|
-
import Button from "@mui/material/Button";
|
|
10
|
-
import TrashIcon from "@mui/icons-material/Delete";
|
|
11
|
-
import CheckIcon from "@mui/icons-material/Check";
|
|
12
|
-
import TextField from "@mui/material/TextField";
|
|
13
|
-
import Select from "react-select";
|
|
14
|
-
import CreatableSelect from "react-select/creatable";
|
|
15
|
-
import { asMutable } from "seamless-immutable";
|
|
16
|
-
var theme = createTheme();
|
|
17
|
-
var useStyles = makeStyles(function (theme) {
|
|
18
|
-
return styles;
|
|
19
|
-
});
|
|
20
|
-
export var RegionLabel = function RegionLabel(_ref) {
|
|
21
|
-
var region = _ref.region,
|
|
22
|
-
editing = _ref.editing,
|
|
23
|
-
allowedClasses = _ref.allowedClasses,
|
|
24
|
-
allowedTags = _ref.allowedTags,
|
|
25
|
-
onDelete = _ref.onDelete,
|
|
26
|
-
_onChange = _ref.onChange,
|
|
27
|
-
onClose = _ref.onClose,
|
|
28
|
-
onOpen = _ref.onOpen,
|
|
29
|
-
onRegionClassAdded = _ref.onRegionClassAdded,
|
|
30
|
-
allowComments = _ref.allowComments;
|
|
31
|
-
var classes = useStyles();
|
|
32
|
-
var commentInputRef = useRef(null);
|
|
33
|
-
|
|
34
|
-
var onCommentInputClick = function onCommentInputClick(_) {
|
|
35
|
-
// The TextField wraps the <input> tag with two divs
|
|
36
|
-
var commentInput = commentInputRef.current.children[0].children[0];
|
|
37
|
-
if (commentInput) return commentInput.focus();
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return React.createElement(ThemeProvider, {
|
|
41
|
-
theme: theme
|
|
42
|
-
}, React.createElement(Paper, {
|
|
43
|
-
onClick: function onClick() {
|
|
44
|
-
return !editing ? onOpen(region) : null;
|
|
45
|
-
},
|
|
46
|
-
className: classnames(classes.regionInfo, {
|
|
47
|
-
highlighted: region.highlighted
|
|
48
|
-
})
|
|
49
|
-
}, !editing ? React.createElement("div", null, region.cls && React.createElement("div", {
|
|
50
|
-
className: "name"
|
|
51
|
-
}, React.createElement("div", {
|
|
52
|
-
className: "circle",
|
|
53
|
-
style: {
|
|
54
|
-
backgroundColor: region.color
|
|
55
|
-
}
|
|
56
|
-
}), region.cls), region.tags && React.createElement("div", {
|
|
57
|
-
className: "tags"
|
|
58
|
-
}, region.tags.map(function (t) {
|
|
59
|
-
return React.createElement("div", {
|
|
60
|
-
key: t,
|
|
61
|
-
className: "tag"
|
|
62
|
-
}, t);
|
|
63
|
-
}))) : React.createElement("div", {
|
|
64
|
-
style: {
|
|
65
|
-
width: 200
|
|
66
|
-
}
|
|
67
|
-
}, React.createElement("div", {
|
|
68
|
-
style: {
|
|
69
|
-
display: "flex",
|
|
70
|
-
flexDirection: "row"
|
|
71
|
-
}
|
|
72
|
-
}, React.createElement("div", {
|
|
73
|
-
style: {
|
|
74
|
-
display: "flex",
|
|
75
|
-
backgroundColor: region.color || "#888",
|
|
76
|
-
color: "#fff",
|
|
77
|
-
padding: 4,
|
|
78
|
-
paddingLeft: 8,
|
|
79
|
-
paddingRight: 8,
|
|
80
|
-
borderRadius: 4,
|
|
81
|
-
fontWeight: "bold",
|
|
82
|
-
textShadow: "0px 0px 5px rgba(0,0,0,0.4)"
|
|
83
|
-
}
|
|
84
|
-
}, region.type), React.createElement("div", {
|
|
85
|
-
style: {
|
|
86
|
-
flexGrow: 1
|
|
87
|
-
}
|
|
88
|
-
}), React.createElement(IconButton, {
|
|
89
|
-
onClick: function onClick() {
|
|
90
|
-
return onDelete(region);
|
|
91
|
-
},
|
|
92
|
-
tabIndex: -1,
|
|
93
|
-
style: {
|
|
94
|
-
width: 22,
|
|
95
|
-
height: 22
|
|
96
|
-
},
|
|
97
|
-
size: "small",
|
|
98
|
-
variant: "outlined"
|
|
99
|
-
}, React.createElement(TrashIcon, {
|
|
100
|
-
style: {
|
|
101
|
-
marginTop: -8,
|
|
102
|
-
width: 16,
|
|
103
|
-
height: 16
|
|
104
|
-
}
|
|
105
|
-
}))), (allowedClasses || []).length > 0 && React.createElement("div", {
|
|
106
|
-
style: {
|
|
107
|
-
marginTop: 6
|
|
108
|
-
}
|
|
109
|
-
}, React.createElement(CreatableSelect, {
|
|
110
|
-
placeholder: "Classification",
|
|
111
|
-
onChange: function onChange(o, actionMeta) {
|
|
112
|
-
if (actionMeta.action == "create-option") {
|
|
113
|
-
onRegionClassAdded(o.value);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return _onChange(_objectSpread({}, region, {
|
|
117
|
-
cls: o.value
|
|
118
|
-
}));
|
|
119
|
-
},
|
|
120
|
-
value: region.cls ? {
|
|
121
|
-
label: region.cls,
|
|
122
|
-
value: region.cls
|
|
123
|
-
} : null,
|
|
124
|
-
options: asMutable(allowedClasses.map(function (c) {
|
|
125
|
-
return {
|
|
126
|
-
value: c,
|
|
127
|
-
label: c
|
|
128
|
-
};
|
|
129
|
-
}))
|
|
130
|
-
})), (allowedTags || []).length > 0 && React.createElement("div", {
|
|
131
|
-
style: {
|
|
132
|
-
marginTop: 4
|
|
133
|
-
}
|
|
134
|
-
}, React.createElement(Select, {
|
|
135
|
-
onChange: function onChange(newTags) {
|
|
136
|
-
return _onChange(_objectSpread({}, region, {
|
|
137
|
-
tags: newTags.map(function (t) {
|
|
138
|
-
return t.value;
|
|
139
|
-
})
|
|
140
|
-
}));
|
|
141
|
-
},
|
|
142
|
-
placeholder: "Tags",
|
|
143
|
-
value: (region.tags || []).map(function (c) {
|
|
144
|
-
return {
|
|
145
|
-
label: c,
|
|
146
|
-
value: c
|
|
147
|
-
};
|
|
148
|
-
}),
|
|
149
|
-
isMulti: true,
|
|
150
|
-
options: asMutable(allowedTags.map(function (c) {
|
|
151
|
-
return {
|
|
152
|
-
value: c,
|
|
153
|
-
label: c
|
|
154
|
-
};
|
|
155
|
-
}))
|
|
156
|
-
})), allowComments && React.createElement(TextField, {
|
|
157
|
-
InputProps: {
|
|
158
|
-
className: classes.commentBox
|
|
159
|
-
},
|
|
160
|
-
fullWidth: true,
|
|
161
|
-
multiline: true,
|
|
162
|
-
rows: 3,
|
|
163
|
-
ref: commentInputRef,
|
|
164
|
-
onClick: onCommentInputClick,
|
|
165
|
-
value: region.comment || "",
|
|
166
|
-
onChange: function onChange(event) {
|
|
167
|
-
return _onChange(_objectSpread({}, region, {
|
|
168
|
-
comment: event.target.value
|
|
169
|
-
}));
|
|
170
|
-
}
|
|
171
|
-
}), onClose && React.createElement("div", {
|
|
172
|
-
style: {
|
|
173
|
-
marginTop: 4,
|
|
174
|
-
display: "flex"
|
|
175
|
-
}
|
|
176
|
-
}, React.createElement("div", {
|
|
177
|
-
style: {
|
|
178
|
-
flexGrow: 1
|
|
179
|
-
}
|
|
180
|
-
}), React.createElement(Button, {
|
|
181
|
-
onClick: function onClick() {
|
|
182
|
-
return onClose(region);
|
|
183
|
-
},
|
|
184
|
-
size: "small",
|
|
185
|
-
variant: "contained",
|
|
186
|
-
color: "primary"
|
|
187
|
-
}, React.createElement(CheckIcon, null))))));
|
|
188
|
-
};
|
|
189
|
-
export default memo(RegionLabel, function (prevProps, nextProps) {
|
|
190
|
-
return prevProps.editing === nextProps.editing && prevProps.region === nextProps.region;
|
|
191
|
-
});
|