@searpent/react-image-annotate 2.0.5 → 2.0.6
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/Annotator/examplePhotos.js +6976 -0
- package/Annotator/index.js +262 -0
- package/Annotator/reducers/combine-reducers.js +14 -0
- package/Annotator/reducers/convert-expanding-line-to-polygon.js +73 -0
- package/{src/Annotator → Annotator}/reducers/fix-twisted.js +3 -5
- package/Annotator/reducers/general-reducer.js +1152 -0
- package/Annotator/reducers/get-active-image.js +27 -0
- package/Annotator/reducers/get-implied-video-regions.js +180 -0
- package/Annotator/reducers/history-handler.js +38 -0
- package/Annotator/reducers/image-reducer.js +20 -0
- package/Annotator/reducers/video-reducer.js +88 -0
- package/ClassSelectionMenu/index.js +135 -0
- package/Crosshairs/index.js +53 -0
- package/DebugSidebarBox/index.js +20 -0
- package/DemoSite/Editor.js +194 -0
- package/DemoSite/ErrorBoundaryDialog.js +64 -0
- package/DemoSite/index.js +40 -0
- package/Editor/annotation-plugin/annotation.js +613 -0
- package/Editor/index.js +57 -0
- package/{src/Editor → Editor}/tools.js +2 -3
- package/FullImageSegmentationAnnotator/index.js +7 -0
- package/GroupSelectorSidebarBox/index.js +63 -0
- package/HighlightBox/index.js +99 -0
- package/HistorySidebarBox/index.js +71 -0
- package/ImageCanvas/index.js +429 -0
- package/ImageCanvas/region-tools.js +165 -0
- package/{src/ImageCanvas → ImageCanvas}/styles.js +12 -8
- package/ImageCanvas/use-mouse.js +180 -0
- package/ImageCanvas/use-project-box.js +27 -0
- package/ImageCanvas/use-wasd-mode.js +62 -0
- package/ImageMask/index.js +133 -0
- package/ImageMask/load-image.js +25 -0
- package/ImageSelectorSidebarBox/index.js +60 -0
- package/KeyframeTimeline/get-time-string.js +27 -0
- package/KeyframeTimeline/index.js +233 -0
- package/KeyframesSelectorSidebarBox/index.js +93 -0
- package/LandingPage/index.js +159 -0
- package/MainLayout/icon-dictionary.js +104 -0
- package/MainLayout/index.js +469 -0
- package/{src/MainLayout → MainLayout}/styles.js +6 -7
- package/MainLayout/types.js +0 -0
- package/MainLayout/use-implied-video-regions.js +13 -0
- package/MetadataEditorSidebarBox/index.js +126 -0
- package/PageSelector/index.js +67 -0
- package/PointDistances/index.js +73 -0
- package/PreventScrollToParents/index.js +51 -0
- package/RegionLabel/index.js +205 -0
- package/{src/RegionLabel → RegionLabel}/styles.js +12 -15
- package/RegionSelectAndTransformBoxes/index.js +167 -0
- package/RegionSelectorSidebarBox/index.js +248 -0
- package/{src/RegionSelectorSidebarBox → RegionSelectorSidebarBox}/styles.js +13 -14
- package/RegionShapes/index.js +294 -0
- package/RegionTags/index.js +142 -0
- package/SettingsDialog/index.js +52 -0
- package/SettingsProvider/index.js +58 -0
- package/Shortcuts/ShortcutField.js +46 -0
- package/Shortcuts/index.js +133 -0
- package/ShortcutsManager/index.js +155 -0
- package/Sidebar/index.js +69 -0
- package/SidebarBoxContainer/index.js +93 -0
- package/SmallToolButton/index.js +42 -0
- package/TagsSidebarBox/index.js +105 -0
- package/TaskDescriptionSidebarBox/index.js +58 -0
- package/Theme/index.js +30 -0
- package/VideoOrImageCanvasBackground/index.js +151 -0
- package/colors.js +14 -0
- package/hooks/use-colors.js +101 -0
- package/hooks/use-event-callback.js +10 -0
- package/hooks/use-exclude-pattern.js +24 -0
- package/hooks/use-load-image.js +26 -0
- package/hooks/use-window-size.js +46 -0
- package/{src/hooks → hooks}/xpattern.js +1 -1
- package/index.js +3 -0
- package/lib.js +3 -0
- package/package.json +1 -1
- package/stories.js +5 -0
- package/{src/utils → utils}/filter-only-unique.js +1 -1
- package/utils/get-from-local-storage.js +7 -0
- package/utils/get-hotkey-help-text.js +9 -0
- package/utils/get-landmarks-with-transform.js +40 -0
- package/utils/photosToImages.js +53 -0
- package/utils/regions-to-blocks.js +16 -0
- package/utils/set-in-local-storage.js +3 -0
- package/.babelrc +0 -6
- package/.env +0 -1
- package/.flowconfig +0 -2
- package/.github/workflows/release-on-master.yml +0 -32
- package/.github/workflows/test.yml +0 -16
- package/.prettierrc +0 -3
- package/.releaserc.js +0 -18
- package/.storybook/addons.js +0 -2
- package/.storybook/config.js +0 -16
- package/LICENSE +0 -21
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -38
- package/src/Annotator/bike-pic.png +0 -0
- package/src/Annotator/bike-pic2.png +0 -0
- package/src/Annotator/dab-keyframes.story.json +0 -1
- package/src/Annotator/examplePhotos.js +0 -7601
- package/src/Annotator/index.js +0 -291
- package/src/Annotator/index.story.js +0 -807
- package/src/Annotator/poses.story.js +0 -150
- package/src/Annotator/reducers/combine-reducers.js +0 -7
- package/src/Annotator/reducers/convert-expanding-line-to-polygon.js +0 -53
- package/src/Annotator/reducers/general-reducer.js +0 -996
- package/src/Annotator/reducers/get-active-image.js +0 -21
- package/src/Annotator/reducers/get-implied-video-regions.js +0 -115
- package/src/Annotator/reducers/history-handler.js +0 -60
- package/src/Annotator/reducers/image-reducer.js +0 -23
- package/src/Annotator/reducers/video-reducer.js +0 -85
- package/src/Annotator/video.story.js +0 -51
- package/src/ClassSelectionMenu/index.js +0 -108
- package/src/Crosshairs/index.js +0 -64
- package/src/DebugSidebarBox/index.js +0 -36
- package/src/DemoSite/Editor.js +0 -235
- package/src/DemoSite/ErrorBoundaryDialog.js +0 -34
- package/src/DemoSite/index.js +0 -41
- package/src/DemoSite/index.story.js +0 -10
- package/src/DemoSite/simple-segmentation-example.json +0 -572
- package/src/Editor/annotation-plugin/annotation.css +0 -46
- package/src/Editor/annotation-plugin/annotation.js +0 -515
- package/src/Editor/index.js +0 -24
- 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 +0 -7
- package/src/FullImageSegmentationAnnotator/index.story.js +0 -177
- package/src/FullImageSegmentationAnnotator/orange.story.png +0 -0
- package/src/GroupSelectorSidebarBox/index.js +0 -48
- package/src/HighlightBox/index.js +0 -143
- package/src/HistorySidebarBox/index.js +0 -78
- package/src/ImageCanvas/dancing-man.story.jpg +0 -0
- package/src/ImageCanvas/index.js +0 -494
- package/src/ImageCanvas/index.story.js +0 -314
- package/src/ImageCanvas/mouse_mask.story.png +0 -0
- package/src/ImageCanvas/region-tools.js +0 -171
- package/src/ImageCanvas/seves_desk.story.jpg +0 -0
- package/src/ImageCanvas/use-mouse.js +0 -168
- package/src/ImageCanvas/use-project-box.js +0 -23
- package/src/ImageCanvas/use-wasd-mode.js +0 -50
- package/src/ImageMask/index.js +0 -127
- package/src/ImageMask/load-image.js +0 -32
- package/src/ImageSelectorSidebarBox/index.js +0 -54
- package/src/KeyframeTimeline/get-time-string.js +0 -25
- package/src/KeyframeTimeline/index.js +0 -223
- package/src/KeyframesSelectorSidebarBox/index.js +0 -93
- package/src/LandingPage/content.md +0 -57
- package/src/LandingPage/github-markdown.css +0 -964
- package/src/LandingPage/index.js +0 -147
- package/src/MainLayout/icon-dictionary.js +0 -79
- package/src/MainLayout/index.js +0 -510
- package/src/MainLayout/index.story.js +0 -240
- package/src/MainLayout/types.js +0 -164
- package/src/MainLayout/use-implied-video-regions.js +0 -17
- package/src/MetadataEditorSidebarBox/index.js +0 -98
- package/src/PageSelector/index.js +0 -76
- package/src/PageSelector/page-selector.css +0 -69
- package/src/PointDistances/index.js +0 -90
- package/src/PreventScrollToParents/index.js +0 -48
- package/src/PreventScrollToParents/index.story.js +0 -23
- package/src/RegionLabel/index.js +0 -222
- package/src/RegionSelectAndTransformBoxes/index.js +0 -234
- package/src/RegionSelectorSidebarBox/index.js +0 -216
- package/src/RegionShapes/index.js +0 -254
- package/src/RegionTags/index.js +0 -134
- package/src/SettingsDialog/index.js +0 -58
- package/src/SettingsProvider/index.js +0 -48
- package/src/Shortcuts/ShortcutField.js +0 -44
- package/src/Shortcuts/index.js +0 -129
- package/src/ShortcutsManager/index.js +0 -162
- package/src/Sidebar/index.js +0 -117
- package/src/SidebarBoxContainer/index.js +0 -93
- package/src/SmallToolButton/index.js +0 -57
- package/src/TagsSidebarBox/index.js +0 -93
- package/src/TaskDescriptionSidebarBox/index.js +0 -43
- package/src/Theme/index.js +0 -36
- package/src/VideoOrImageCanvasBackground/index.js +0 -170
- package/src/colors.js +0 -32
- package/src/hooks/use-colors.js +0 -74
- package/src/hooks/use-event-callback.js +0 -11
- package/src/hooks/use-exclude-pattern.js +0 -27
- package/src/hooks/use-load-image.js +0 -21
- package/src/hooks/use-window-size.js +0 -46
- package/src/hooks/xpattern.png +0 -0
- package/src/index.js +0 -18
- package/src/lib.js +0 -7
- package/src/screenshot.png +0 -0
- package/src/site.css +0 -5
- package/src/stories.js +0 -2
- package/src/utils/get-from-local-storage.js +0 -7
- package/src/utils/get-hotkey-help-text.js +0 -11
- package/src/utils/get-landmarks-with-transform.js +0 -23
- package/src/utils/photosToImages.js +0 -40
- package/src/utils/regions-to-blocks.js +0 -14
- package/src/utils/set-in-local-storage.js +0 -6
|
@@ -0,0 +1,469 @@
|
|
|
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 GroupSelector from "../GroupSelectorSidebarBox";
|
|
14
|
+
import KeyframeTimeline from "../KeyframeTimeline";
|
|
15
|
+
import KeyframesSelector from "../KeyframesSelectorSidebarBox";
|
|
16
|
+
import RegionSelector from "../RegionSelectorSidebarBox";
|
|
17
|
+
import SettingsDialog from "../SettingsDialog";
|
|
18
|
+
import TagsSidebarBox from "../TagsSidebarBox";
|
|
19
|
+
import TaskDescription from "../TaskDescriptionSidebarBox";
|
|
20
|
+
import MetadataEditor from "../MetadataEditorSidebarBox";
|
|
21
|
+
import Workspace from "react-material-workspace-layout/Workspace";
|
|
22
|
+
import classnames from "classnames";
|
|
23
|
+
import getActiveImage from "../Annotator/reducers/get-active-image";
|
|
24
|
+
import getHotkeyHelpText from "../utils/get-hotkey-help-text";
|
|
25
|
+
import iconDictionary from "./icon-dictionary";
|
|
26
|
+
import styles from "./styles";
|
|
27
|
+
import { useDispatchHotkeyHandlers } from "../ShortcutsManager";
|
|
28
|
+
import useEventCallback from "use-event-callback";
|
|
29
|
+
import useImpliedVideoRegions from "./use-implied-video-regions";
|
|
30
|
+
import useKey from "use-key-hook";
|
|
31
|
+
import { useSettings } from "../SettingsProvider";
|
|
32
|
+
import { withHotKeys } from "react-hotkeys";
|
|
33
|
+
import Editor from "../Editor";
|
|
34
|
+
import regionsToBlocks from '../utils/regions-to-blocks';
|
|
35
|
+
import PagesSelector from "../PageSelector"; // import Fullscreen from "../Fullscreen"
|
|
36
|
+
|
|
37
|
+
var emptyArr = [];
|
|
38
|
+
var theme = createTheme();
|
|
39
|
+
var useStyles = makeStyles(function (theme) {
|
|
40
|
+
return styles;
|
|
41
|
+
});
|
|
42
|
+
var HotkeyDiv = withHotKeys(function (_ref) {
|
|
43
|
+
var hotKeys = _ref.hotKeys,
|
|
44
|
+
children = _ref.children,
|
|
45
|
+
divRef = _ref.divRef,
|
|
46
|
+
props = _objectWithoutProperties(_ref, ["hotKeys", "children", "divRef"]);
|
|
47
|
+
|
|
48
|
+
return React.createElement("div", Object.assign({}, _objectSpread({}, hotKeys, props), {
|
|
49
|
+
ref: divRef
|
|
50
|
+
}), children);
|
|
51
|
+
});
|
|
52
|
+
var FullScreenContainer = styled("div")(function (_ref2) {
|
|
53
|
+
var theme = _ref2.theme;
|
|
54
|
+
return {
|
|
55
|
+
width: "100%",
|
|
56
|
+
height: "100%",
|
|
57
|
+
"& .fullscreen": {
|
|
58
|
+
width: "100%",
|
|
59
|
+
height: "100%"
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
var EditorWrapper = styled("div")(function (_ref3) {
|
|
64
|
+
var theme = _ref3.theme;
|
|
65
|
+
return {
|
|
66
|
+
width: "45%",
|
|
67
|
+
padding: "1rem",
|
|
68
|
+
paddingLeft: "2rem"
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
export var MainLayout = function MainLayout(_ref4) {
|
|
72
|
+
var _state$images$state$s, _state$images$state$s2;
|
|
73
|
+
|
|
74
|
+
var state = _ref4.state,
|
|
75
|
+
dispatch = _ref4.dispatch,
|
|
76
|
+
_ref4$alwaysShowNextB = _ref4.alwaysShowNextButton,
|
|
77
|
+
alwaysShowNextButton = _ref4$alwaysShowNextB === void 0 ? false : _ref4$alwaysShowNextB,
|
|
78
|
+
_ref4$alwaysShowPrevB = _ref4.alwaysShowPrevButton,
|
|
79
|
+
alwaysShowPrevButton = _ref4$alwaysShowPrevB === void 0 ? false : _ref4$alwaysShowPrevB,
|
|
80
|
+
RegionEditLabel = _ref4.RegionEditLabel,
|
|
81
|
+
onRegionClassAdded = _ref4.onRegionClassAdded,
|
|
82
|
+
hideHeader = _ref4.hideHeader,
|
|
83
|
+
hideHeaderText = _ref4.hideHeaderText,
|
|
84
|
+
_ref4$hideNext = _ref4.hideNext,
|
|
85
|
+
hideNext = _ref4$hideNext === void 0 ? false : _ref4$hideNext,
|
|
86
|
+
_ref4$hidePrev = _ref4.hidePrev,
|
|
87
|
+
hidePrev = _ref4$hidePrev === void 0 ? false : _ref4$hidePrev,
|
|
88
|
+
_ref4$hideClone = _ref4.hideClone,
|
|
89
|
+
hideClone = _ref4$hideClone === void 0 ? false : _ref4$hideClone,
|
|
90
|
+
_ref4$hideSettings = _ref4.hideSettings,
|
|
91
|
+
hideSettings = _ref4$hideSettings === void 0 ? false : _ref4$hideSettings,
|
|
92
|
+
_ref4$hideFullScreen = _ref4.hideFullScreen,
|
|
93
|
+
hideFullScreen = _ref4$hideFullScreen === void 0 ? false : _ref4$hideFullScreen,
|
|
94
|
+
_ref4$hideSave = _ref4.hideSave,
|
|
95
|
+
hideSave = _ref4$hideSave === void 0 ? false : _ref4$hideSave,
|
|
96
|
+
_ref4$groups = _ref4.groups,
|
|
97
|
+
groups = _ref4$groups === void 0 ? [] : _ref4$groups,
|
|
98
|
+
_ref4$onGroupSelect = _ref4.onGroupSelect,
|
|
99
|
+
onGroupSelect = _ref4$onGroupSelect === void 0 ? function () {} : _ref4$onGroupSelect,
|
|
100
|
+
_ref4$hideHistory = _ref4.hideHistory,
|
|
101
|
+
hideHistory = _ref4$hideHistory === void 0 ? false : _ref4$hideHistory,
|
|
102
|
+
_ref4$hideNotEditingL = _ref4.hideNotEditingLabel,
|
|
103
|
+
hideNotEditingLabel = _ref4$hideNotEditingL === void 0 ? false : _ref4$hideNotEditingL,
|
|
104
|
+
_ref4$showEditor = _ref4.showEditor,
|
|
105
|
+
showEditor = _ref4$showEditor === void 0 ? false : _ref4$showEditor,
|
|
106
|
+
_ref4$showPageSelecto = _ref4.showPageSelector,
|
|
107
|
+
showPageSelector = _ref4$showPageSelecto === void 0 ? false : _ref4$showPageSelecto,
|
|
108
|
+
_ref4$onRecalc = _ref4.onRecalc,
|
|
109
|
+
onRecalc = _ref4$onRecalc === void 0 ? function () {} : _ref4$onRecalc,
|
|
110
|
+
_ref4$onSave = _ref4.onSave,
|
|
111
|
+
onSave = _ref4$onSave === void 0 ? function () {} : _ref4$onSave,
|
|
112
|
+
_ref4$recalcActive = _ref4.recalcActive,
|
|
113
|
+
recalcActive = _ref4$recalcActive === void 0 ? false : _ref4$recalcActive,
|
|
114
|
+
_ref4$saveActive = _ref4.saveActive,
|
|
115
|
+
saveActive = _ref4$saveActive === void 0 ? false : _ref4$saveActive,
|
|
116
|
+
_ref4$allowedGroups = _ref4.allowedGroups,
|
|
117
|
+
allowedGroups = _ref4$allowedGroups === void 0 ? {} : _ref4$allowedGroups,
|
|
118
|
+
onMetadataChange = _ref4.onMetadataChange;
|
|
119
|
+
var classes = useStyles();
|
|
120
|
+
var settings = useSettings();
|
|
121
|
+
var fullScreenHandle = useFullScreenHandle();
|
|
122
|
+
var memoizedActionFns = useRef({});
|
|
123
|
+
|
|
124
|
+
var action = function action(type) {
|
|
125
|
+
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
126
|
+
params[_key - 1] = arguments[_key];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
var fnKey = "".concat(type, "(").concat(params.join(","), ")");
|
|
130
|
+
if (memoizedActionFns.current[fnKey]) return memoizedActionFns.current[fnKey];
|
|
131
|
+
|
|
132
|
+
var fn = function fn() {
|
|
133
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
134
|
+
args[_key2] = arguments[_key2];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return params.length > 0 ? dispatch(_objectSpread({
|
|
138
|
+
type: type
|
|
139
|
+
}, params.reduce(function (acc, p, i) {
|
|
140
|
+
return acc[p] = args[i], acc;
|
|
141
|
+
}, {}))) : dispatch(_objectSpread({
|
|
142
|
+
type: type
|
|
143
|
+
}, args[0]));
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
memoizedActionFns.current[fnKey] = fn;
|
|
147
|
+
return fn;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
var _getActiveImage = getActiveImage(state),
|
|
151
|
+
currentImageIndex = _getActiveImage.currentImageIndex,
|
|
152
|
+
activeImage = _getActiveImage.activeImage;
|
|
153
|
+
|
|
154
|
+
var nextImage;
|
|
155
|
+
|
|
156
|
+
if (currentImageIndex !== null) {
|
|
157
|
+
nextImage = state.images[currentImageIndex + 1];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
useKey(function () {
|
|
161
|
+
return dispatch({
|
|
162
|
+
type: "CANCEL"
|
|
163
|
+
});
|
|
164
|
+
}, {
|
|
165
|
+
detectKeys: [27]
|
|
166
|
+
});
|
|
167
|
+
var isAVideoFrame = activeImage && activeImage.frameTime !== undefined;
|
|
168
|
+
var innerContainerRef = useRef();
|
|
169
|
+
var hotkeyHandlers = useDispatchHotkeyHandlers({
|
|
170
|
+
dispatch: dispatch
|
|
171
|
+
});
|
|
172
|
+
var impliedVideoRegions = useImpliedVideoRegions(state);
|
|
173
|
+
var refocusOnMouseEvent = useCallback(function (e) {
|
|
174
|
+
if (!innerContainerRef.current) return;
|
|
175
|
+
if (innerContainerRef.current.contains(document.activeElement)) return;
|
|
176
|
+
|
|
177
|
+
if (innerContainerRef.current.contains(e.target)) {
|
|
178
|
+
innerContainerRef.current.focus();
|
|
179
|
+
e.target.focus();
|
|
180
|
+
}
|
|
181
|
+
}, []);
|
|
182
|
+
var canvas = React.createElement(ImageCanvas, Object.assign({}, settings, {
|
|
183
|
+
showCrosshairs: settings.showCrosshairs && !["select", "pan", "zoom"].includes(state.selectedTool),
|
|
184
|
+
key: state.selectedImage,
|
|
185
|
+
showMask: state.showMask,
|
|
186
|
+
fullImageSegmentationMode: state.fullImageSegmentationMode,
|
|
187
|
+
autoSegmentationOptions: state.autoSegmentationOptions,
|
|
188
|
+
showTags: state.showTags,
|
|
189
|
+
allowedArea: state.allowedArea,
|
|
190
|
+
modifyingAllowedArea: state.selectedTool === "modify-allowed-area",
|
|
191
|
+
regionClsList: state.regionClsList,
|
|
192
|
+
regionTagList: state.regionTagList,
|
|
193
|
+
regions: state.annotationType === "image" ? activeImage.regions || [] : impliedVideoRegions,
|
|
194
|
+
realSize: activeImage ? activeImage.realSize : undefined,
|
|
195
|
+
videoPlaying: state.videoPlaying,
|
|
196
|
+
imageSrc: state.annotationType === "image" ? activeImage.src : null,
|
|
197
|
+
videoSrc: state.annotationType === "video" ? state.videoSrc : null,
|
|
198
|
+
pointDistancePrecision: state.pointDistancePrecision,
|
|
199
|
+
createWithPrimary: state.selectedTool.includes("create"),
|
|
200
|
+
dragWithPrimary: state.selectedTool === "pan",
|
|
201
|
+
zoomWithPrimary: state.selectedTool === "zoom",
|
|
202
|
+
showPointDistances: state.showPointDistances,
|
|
203
|
+
videoTime: state.annotationType === "image" ? state.selectedImageFrameTime : state.currentVideoTime,
|
|
204
|
+
keypointDefinitions: state.keypointDefinitions,
|
|
205
|
+
onMouseMove: action("MOUSE_MOVE"),
|
|
206
|
+
onMouseDown: action("MOUSE_DOWN"),
|
|
207
|
+
onMouseUp: action("MOUSE_UP"),
|
|
208
|
+
onChangeRegion: action("CHANGE_REGION", "region"),
|
|
209
|
+
onBeginRegionEdit: action("OPEN_REGION_EDITOR", "region"),
|
|
210
|
+
onCloseRegionEdit: action("CLOSE_REGION_EDITOR", "region"),
|
|
211
|
+
onDeleteRegion: action("DELETE_REGION", "region"),
|
|
212
|
+
onBeginBoxTransform: action("BEGIN_BOX_TRANSFORM", "box", "directions"),
|
|
213
|
+
onBeginMovePolygonPoint: action("BEGIN_MOVE_POLYGON_POINT", "polygon", "pointIndex"),
|
|
214
|
+
onBeginMoveKeypoint: action("BEGIN_MOVE_KEYPOINT", "region", "keypointId"),
|
|
215
|
+
onAddPolygonPoint: action("ADD_POLYGON_POINT", "polygon", "point", "pointIndex"),
|
|
216
|
+
onSelectRegion: action("SELECT_REGION", "region"),
|
|
217
|
+
onBeginMovePoint: action("BEGIN_MOVE_POINT", "point"),
|
|
218
|
+
onImageLoaded: action("IMAGE_LOADED", "image"),
|
|
219
|
+
RegionEditLabel: RegionEditLabel,
|
|
220
|
+
onImageOrVideoLoaded: action("IMAGE_OR_VIDEO_LOADED", "metadata"),
|
|
221
|
+
onChangeVideoTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
222
|
+
onChangeVideoPlaying: action("CHANGE_VIDEO_PLAYING", "isPlaying"),
|
|
223
|
+
onRegionClassAdded: onRegionClassAdded,
|
|
224
|
+
allowComments: state.allowComments,
|
|
225
|
+
hideNotEditingLabel: hideNotEditingLabel,
|
|
226
|
+
allowedGroups: allowedGroups
|
|
227
|
+
}));
|
|
228
|
+
var onClickIconSidebarItem = useEventCallback(function (item) {
|
|
229
|
+
dispatch({
|
|
230
|
+
type: "SELECT_TOOL",
|
|
231
|
+
selectedTool: item.name
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
var onClickHeaderItem = useEventCallback(function (item) {
|
|
235
|
+
if (item.name === "Fullscreen") {
|
|
236
|
+
fullScreenHandle.enter();
|
|
237
|
+
} else if (item.name === "Window") {
|
|
238
|
+
fullScreenHandle.exit();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
dispatch({
|
|
242
|
+
type: "HEADER_BUTTON_CLICKED",
|
|
243
|
+
buttonName: item.name
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
var debugModeOn = Boolean(window.localStorage.$ANNOTATE_DEBUG_MODE && state);
|
|
247
|
+
var nextImageHasRegions = !nextImage || nextImage.regions && nextImage.regions.length > 0; // Editor.js blocks
|
|
248
|
+
|
|
249
|
+
var selectedGroupId = ((_state$images$state$s = state.images[state.selectedImage]) === null || _state$images$state$s === void 0 ? void 0 : _state$images$state$s.selectedGroupId) || null;
|
|
250
|
+
var editorBlocks = regionsToBlocks(((_state$images$state$s2 = state.images[state.selectedImage]) === null || _state$images$state$s2 === void 0 ? void 0 : _state$images$state$s2.regions) || []);
|
|
251
|
+
var blocks = editorBlocks.filter(function (i) {
|
|
252
|
+
var _i$data;
|
|
253
|
+
|
|
254
|
+
return (i === null || i === void 0 ? void 0 : (_i$data = i.data) === null || _i$data === void 0 ? void 0 : _i$data.groupId) === selectedGroupId;
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
var handleEditorChange = function handleEditorChange(_ref5) {
|
|
258
|
+
var imageIndex = _ref5.imageIndex,
|
|
259
|
+
data = _ref5.data;
|
|
260
|
+
var newRegions = data.blocks.map(function (i) {
|
|
261
|
+
return {
|
|
262
|
+
id: i.id,
|
|
263
|
+
cls: i.data.labelName,
|
|
264
|
+
text: i.data.text
|
|
265
|
+
};
|
|
266
|
+
});
|
|
267
|
+
dispatch({
|
|
268
|
+
type: "UPDATE_REGIONS",
|
|
269
|
+
regions: newRegions,
|
|
270
|
+
imageIndex: imageIndex
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
var pages = state.images.map(function (i, idx) {
|
|
275
|
+
var _i$metadata;
|
|
276
|
+
|
|
277
|
+
return {
|
|
278
|
+
id: idx,
|
|
279
|
+
src: i.src,
|
|
280
|
+
isActive: idx === state.selectedImage,
|
|
281
|
+
pageNumber: (i === null || i === void 0 ? void 0 : (_i$metadata = i.metadata) === null || _i$metadata === void 0 ? void 0 : _i$metadata.find(function (md) {
|
|
282
|
+
return md.key === "page";
|
|
283
|
+
}).value) || null
|
|
284
|
+
};
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
var handlePageClick = function handlePageClick(pageIndex) {
|
|
288
|
+
dispatch({
|
|
289
|
+
type: "SELECT_IMAGE",
|
|
290
|
+
imageIndex: pageIndex
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
return React.createElement(ThemeProvider, {
|
|
295
|
+
theme: theme
|
|
296
|
+
}, React.createElement(FullScreenContainer, null, React.createElement(FullScreen, {
|
|
297
|
+
handle: fullScreenHandle,
|
|
298
|
+
onChange: function onChange(open) {
|
|
299
|
+
if (!open) {
|
|
300
|
+
fullScreenHandle.exit();
|
|
301
|
+
action("HEADER_BUTTON_CLICKED", "buttonName")("Window");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}, React.createElement(HotkeyDiv, {
|
|
305
|
+
tabIndex: -1,
|
|
306
|
+
divRef: innerContainerRef,
|
|
307
|
+
onMouseDown: refocusOnMouseEvent,
|
|
308
|
+
onMouseOver: refocusOnMouseEvent,
|
|
309
|
+
allowChanges: true,
|
|
310
|
+
handlers: hotkeyHandlers,
|
|
311
|
+
className: classnames(classes.container, state.fullScreen && "Fullscreen")
|
|
312
|
+
}, React.createElement("div", {
|
|
313
|
+
style: {
|
|
314
|
+
display: 'flex',
|
|
315
|
+
flexDirection: 'row'
|
|
316
|
+
}
|
|
317
|
+
}, showPageSelector && React.createElement(PagesSelector, {
|
|
318
|
+
pages: pages,
|
|
319
|
+
onPageClick: handlePageClick,
|
|
320
|
+
onRecalc: onRecalc,
|
|
321
|
+
onSave: onSave,
|
|
322
|
+
saveActive: saveActive,
|
|
323
|
+
recalcActive: recalcActive
|
|
324
|
+
}), React.createElement(Workspace, {
|
|
325
|
+
allowFullscreen: true,
|
|
326
|
+
iconDictionary: iconDictionary,
|
|
327
|
+
hideHeader: hideHeader,
|
|
328
|
+
hideHeaderText: hideHeaderText,
|
|
329
|
+
headerLeftSide: [state.annotationType === "video" ? React.createElement(KeyframeTimeline, {
|
|
330
|
+
currentTime: state.currentVideoTime,
|
|
331
|
+
duration: state.videoDuration,
|
|
332
|
+
onChangeCurrentTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
333
|
+
keyframes: state.keyframes
|
|
334
|
+
}) : activeImage ? React.createElement("div", {
|
|
335
|
+
className: classes.headerTitle
|
|
336
|
+
}, activeImage.name) : null].filter(Boolean),
|
|
337
|
+
headerItems: [!hidePrev && {
|
|
338
|
+
name: "Prev"
|
|
339
|
+
}, !hideNext && {
|
|
340
|
+
name: "Next"
|
|
341
|
+
}, state.annotationType !== "video" ? null : !state.videoPlaying ? {
|
|
342
|
+
name: "Play"
|
|
343
|
+
} : {
|
|
344
|
+
name: "Pause"
|
|
345
|
+
}, !hideClone && !nextImageHasRegions && activeImage.regions && {
|
|
346
|
+
name: "Clone"
|
|
347
|
+
}, !hideSettings && {
|
|
348
|
+
name: "Settings"
|
|
349
|
+
}, !hideFullScreen && (state.fullScreen ? {
|
|
350
|
+
name: "Window"
|
|
351
|
+
} : {
|
|
352
|
+
name: "Fullscreen"
|
|
353
|
+
}), !hideSave && {
|
|
354
|
+
name: "Save"
|
|
355
|
+
}].filter(Boolean),
|
|
356
|
+
onClickHeaderItem: onClickHeaderItem,
|
|
357
|
+
onClickIconSidebarItem: onClickIconSidebarItem,
|
|
358
|
+
selectedTools: [state.selectedTool, state.showTags && "show-tags", state.showMask && "show-mask"].filter(Boolean),
|
|
359
|
+
iconSidebarItems: [{
|
|
360
|
+
name: "select",
|
|
361
|
+
helperText: "Select" + getHotkeyHelpText("select_tool"),
|
|
362
|
+
alwaysShowing: true
|
|
363
|
+
}, {
|
|
364
|
+
name: "pan",
|
|
365
|
+
helperText: "Drag/Pan (right or middle click)" + getHotkeyHelpText("pan_tool"),
|
|
366
|
+
alwaysShowing: true
|
|
367
|
+
}, {
|
|
368
|
+
name: "zoom",
|
|
369
|
+
helperText: "Zoom In/Out (scroll)" + getHotkeyHelpText("zoom_tool"),
|
|
370
|
+
alwaysShowing: true
|
|
371
|
+
}, {
|
|
372
|
+
name: "show-tags",
|
|
373
|
+
helperText: "Show / Hide Tags",
|
|
374
|
+
alwaysShowing: true
|
|
375
|
+
}, {
|
|
376
|
+
name: "create-point",
|
|
377
|
+
helperText: "Add Point" + getHotkeyHelpText("create_point")
|
|
378
|
+
}, {
|
|
379
|
+
name: "create-box",
|
|
380
|
+
helperText: "Add Bounding Box" + getHotkeyHelpText("create_bounding_box")
|
|
381
|
+
}, {
|
|
382
|
+
name: "create-polygon",
|
|
383
|
+
helperText: "Add Polygon" + getHotkeyHelpText("create_polygon")
|
|
384
|
+
}, {
|
|
385
|
+
name: "create-line",
|
|
386
|
+
helperText: "Add Line"
|
|
387
|
+
}, {
|
|
388
|
+
name: "create-expanding-line",
|
|
389
|
+
helperText: "Add Expanding Line"
|
|
390
|
+
}, {
|
|
391
|
+
name: "create-keypoints",
|
|
392
|
+
helperText: "Add Keypoints (Pose)"
|
|
393
|
+
}, state.fullImageSegmentationMode && {
|
|
394
|
+
name: "show-mask",
|
|
395
|
+
alwaysShowing: true,
|
|
396
|
+
helperText: "Show / Hide Mask"
|
|
397
|
+
}, {
|
|
398
|
+
name: "modify-allowed-area",
|
|
399
|
+
helperText: "Modify Allowed Area"
|
|
400
|
+
}].filter(Boolean).filter(function (a) {
|
|
401
|
+
return a.alwaysShowing || state.enabledTools.includes(a.name);
|
|
402
|
+
}),
|
|
403
|
+
rightSidebarItems: [debugModeOn && React.createElement(DebugBox, {
|
|
404
|
+
state: debugModeOn,
|
|
405
|
+
lastAction: state.lastAction
|
|
406
|
+
}), state.taskDescription && React.createElement(TaskDescription, {
|
|
407
|
+
description: state.taskDescription
|
|
408
|
+
}), state.regionClsList && React.createElement(ClassSelectionMenu, {
|
|
409
|
+
selectedCls: state.selectedCls,
|
|
410
|
+
regionClsList: state.regionClsList,
|
|
411
|
+
onSelectCls: action("SELECT_CLASSIFICATION", "cls")
|
|
412
|
+
}), state.labelImages && React.createElement(TagsSidebarBox, {
|
|
413
|
+
currentImage: activeImage,
|
|
414
|
+
imageClsList: state.imageClsList,
|
|
415
|
+
imageTagList: state.imageTagList,
|
|
416
|
+
onChangeImage: action("CHANGE_IMAGE", "delta"),
|
|
417
|
+
expandedByDefault: true
|
|
418
|
+
}),, // (state.images?.length || 0) > 1 && (
|
|
419
|
+
// <ImageSelector
|
|
420
|
+
// onSelect={action("SELECT_REGION", "region")}
|
|
421
|
+
// images={state.images}
|
|
422
|
+
// />
|
|
423
|
+
// ),
|
|
424
|
+
// groups && (
|
|
425
|
+
// <GroupSelector
|
|
426
|
+
// title="Articles"
|
|
427
|
+
// groups={groups}
|
|
428
|
+
// selectedGroupId={selectedGroupId}
|
|
429
|
+
// onSelect={onGroupSelect}
|
|
430
|
+
// />
|
|
431
|
+
// )
|
|
432
|
+
React.createElement(RegionSelector, {
|
|
433
|
+
regions: activeImage ? activeImage.regions : emptyArr,
|
|
434
|
+
onSelectRegion: action("SELECT_REGION", "region"),
|
|
435
|
+
onDeleteRegion: action("DELETE_REGION", "region"),
|
|
436
|
+
onChangeRegion: action("CHANGE_REGION", "region")
|
|
437
|
+
}), state.keyframes && React.createElement(KeyframesSelector, {
|
|
438
|
+
onChangeVideoTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
439
|
+
onDeleteKeyframe: action("DELETE_KEYFRAME", "time"),
|
|
440
|
+
onChangeCurrentTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
441
|
+
currentTime: state.currentVideoTime,
|
|
442
|
+
duration: state.videoDuration,
|
|
443
|
+
keyframes: state.keyframes
|
|
444
|
+
}), !hideHistory && React.createElement(HistorySidebarBox, {
|
|
445
|
+
history: state.history,
|
|
446
|
+
onRestoreHistory: action("RESTORE_HISTORY")
|
|
447
|
+
}), React.createElement(MetadataEditor, {
|
|
448
|
+
state: state,
|
|
449
|
+
onMetadataChange: onMetadataChange
|
|
450
|
+
})].filter(Boolean)
|
|
451
|
+
}, canvas), showEditor && React.createElement(EditorWrapper, {
|
|
452
|
+
id: "editor-wrapper"
|
|
453
|
+
}, React.createElement(Editor, {
|
|
454
|
+
id: "editor",
|
|
455
|
+
blocks: blocks,
|
|
456
|
+
imageIndex: state.selectedImage,
|
|
457
|
+
key: "".concat(state.selectedImage, "#").concat(selectedGroupId),
|
|
458
|
+
onChange: handleEditorChange
|
|
459
|
+
}))), React.createElement(SettingsDialog, {
|
|
460
|
+
open: state.settingsOpen,
|
|
461
|
+
onClose: function onClose() {
|
|
462
|
+
return dispatch({
|
|
463
|
+
type: "HEADER_BUTTON_CLICKED",
|
|
464
|
+
buttonName: "Settings"
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
})))));
|
|
468
|
+
};
|
|
469
|
+
export default MainLayout;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { grey } from "@mui/material/colors"
|
|
2
|
-
|
|
1
|
+
import { grey } from "@mui/material/colors";
|
|
3
2
|
export default {
|
|
4
3
|
container: {
|
|
5
4
|
display: "flex",
|
|
@@ -15,12 +14,12 @@ export default {
|
|
|
15
14
|
left: 0,
|
|
16
15
|
right: 0,
|
|
17
16
|
top: 0,
|
|
18
|
-
bottom: 0
|
|
19
|
-
}
|
|
17
|
+
bottom: 0
|
|
18
|
+
}
|
|
20
19
|
},
|
|
21
20
|
headerTitle: {
|
|
22
21
|
fontWeight: "bold",
|
|
23
22
|
color: grey[700],
|
|
24
|
-
paddingLeft: 16
|
|
25
|
-
}
|
|
26
|
-
}
|
|
23
|
+
paddingLeft: 16
|
|
24
|
+
}
|
|
25
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import SidebarBoxContainer from "../SidebarBoxContainer";
|
|
3
|
+
import DescriptionIcon from "@mui/icons-material/Description";
|
|
4
|
+
import { styled } from "@mui/material/styles";
|
|
5
|
+
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
6
|
+
import { grey } from "@mui/material/colors";
|
|
7
|
+
var MetadataItemDiv = styled("div")(function (_ref) {
|
|
8
|
+
var theme = _ref.theme;
|
|
9
|
+
return {
|
|
10
|
+
display: "flex",
|
|
11
|
+
flexDirection: "column",
|
|
12
|
+
marginBottom: "1rem",
|
|
13
|
+
"& > label": {
|
|
14
|
+
fontSize: "1rem",
|
|
15
|
+
marginBottom: ".5rem",
|
|
16
|
+
textTransform: "capitalize"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var MetadataItem = function MetadataItem(_ref2) {
|
|
22
|
+
var name = _ref2.name,
|
|
23
|
+
value = _ref2.value,
|
|
24
|
+
imageIndex = _ref2.imageIndex,
|
|
25
|
+
onChange = _ref2.onChange;
|
|
26
|
+
|
|
27
|
+
var handleChange = function handleChange(e) {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
var _e$target = e.target,
|
|
30
|
+
name = _e$target.name,
|
|
31
|
+
value = _e$target.value;
|
|
32
|
+
onChange({
|
|
33
|
+
name: name,
|
|
34
|
+
value: value,
|
|
35
|
+
imageIndex: imageIndex
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return React.createElement(MetadataItemDiv, null, React.createElement("label", {
|
|
40
|
+
for: name
|
|
41
|
+
}, name), React.createElement("input", {
|
|
42
|
+
type: "text",
|
|
43
|
+
value: value,
|
|
44
|
+
name: name,
|
|
45
|
+
onChange: handleChange
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var MetadataList = function MetadataList(_ref3) {
|
|
50
|
+
var title = _ref3.title,
|
|
51
|
+
metadata = _ref3.metadata,
|
|
52
|
+
imageIndex = _ref3.imageIndex,
|
|
53
|
+
onMetadataChange = _ref3.onMetadataChange;
|
|
54
|
+
return React.createElement("div", null, React.createElement("h2", null, title), metadata.map(function (_ref4) {
|
|
55
|
+
var key = _ref4.key,
|
|
56
|
+
value = _ref4.value;
|
|
57
|
+
return React.createElement(MetadataItem, {
|
|
58
|
+
name: key,
|
|
59
|
+
value: value,
|
|
60
|
+
imageIndex: imageIndex,
|
|
61
|
+
onChange: onMetadataChange
|
|
62
|
+
});
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var theme = createTheme();
|
|
67
|
+
var DivContainer = styled("div")(function (_ref5) {
|
|
68
|
+
var theme = _ref5.theme;
|
|
69
|
+
return {
|
|
70
|
+
paddingLeft: 16,
|
|
71
|
+
paddingRight: 16,
|
|
72
|
+
fontSize: 12,
|
|
73
|
+
"& h1": {
|
|
74
|
+
fontSize: 18
|
|
75
|
+
},
|
|
76
|
+
"& h2": {
|
|
77
|
+
fontSize: 14
|
|
78
|
+
},
|
|
79
|
+
"& h3": {
|
|
80
|
+
fontSize: 12
|
|
81
|
+
},
|
|
82
|
+
"& h4": {
|
|
83
|
+
fontSize: 12
|
|
84
|
+
},
|
|
85
|
+
"& h5": {
|
|
86
|
+
fontSize: 12
|
|
87
|
+
},
|
|
88
|
+
"& h6": {
|
|
89
|
+
fontSize: 12
|
|
90
|
+
},
|
|
91
|
+
"& p": {
|
|
92
|
+
fontSize: 12
|
|
93
|
+
},
|
|
94
|
+
"& a": {},
|
|
95
|
+
"& img": {
|
|
96
|
+
width: "100%"
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
export var MetadataEditorSidebarBox = function MetadataEditorSidebarBox(_ref6) {
|
|
101
|
+
var _state$images$state$s;
|
|
102
|
+
|
|
103
|
+
var state = _ref6.state,
|
|
104
|
+
onMetadataChange = _ref6.onMetadataChange;
|
|
105
|
+
return React.createElement(ThemeProvider, {
|
|
106
|
+
theme: theme
|
|
107
|
+
}, React.createElement(SidebarBoxContainer, {
|
|
108
|
+
title: "Metadata",
|
|
109
|
+
icon: React.createElement(DescriptionIcon, {
|
|
110
|
+
style: {
|
|
111
|
+
color: grey[700]
|
|
112
|
+
}
|
|
113
|
+
}),
|
|
114
|
+
expandedByDefault: true
|
|
115
|
+
}, React.createElement(DivContainer, null, React.createElement(MetadataList, {
|
|
116
|
+
title: "Global",
|
|
117
|
+
metadata: state.metadata,
|
|
118
|
+
onMetadataChange: onMetadataChange
|
|
119
|
+
}), (state === null || state === void 0 ? void 0 : (_state$images$state$s = state.images[state.selectedImage]) === null || _state$images$state$s === void 0 ? void 0 : _state$images$state$s.metadata) && React.createElement(MetadataList, {
|
|
120
|
+
title: "Local",
|
|
121
|
+
metadata: state.images[state.selectedImage].metadata,
|
|
122
|
+
imageIndex: state.selectedImage,
|
|
123
|
+
onMetadataChange: onMetadataChange
|
|
124
|
+
}))));
|
|
125
|
+
};
|
|
126
|
+
export default memo(MetadataEditorSidebarBox);
|