@searpent/react-image-annotate 2.3.3 → 2.3.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/Annotator/examplePhotos.js +30 -30
- package/Annotator/examplePhotos_repr.js +28 -28
- package/Annotator/index.js +69 -32
- package/Annotator/index.story_bugdemo_15_1.js +895 -773
- package/Annotator/index.story_repr.js +1048 -933
- package/Annotator/reducers/convert-expanding-line-to-polygon.js +15 -16
- package/ClassSelectionMenu/index.js +55 -35
- package/Crosshairs/index.js +30 -23
- package/DebugSidebarBox/index.js +40 -9
- package/DemoSite/Editor.js +124 -79
- package/DemoSite/ErrorBoundaryDialog.js +19 -6
- package/DemoSite/index.js +26 -17
- package/Editor/index.js +70 -36
- package/Editor/index_bugdemo_15_1.js +68 -35
- package/Editor/readOnly.js +178 -127
- package/Errorer/index.js +8 -3
- package/FullImageSegmentationAnnotator/index.js +6 -3
- package/GroupSelectorSidebarBox/index.js +48 -32
- package/GroupsEditorSidebarBox/index.js +75 -40
- package/HelpSidebarBox/index.js +24 -13
- package/HighlightBox/index.js +37 -30
- package/HistorySidebarBox/index.js +51 -29
- package/ImageCanvas/index.js +165 -130
- package/ImageMask/index.js +9 -6
- package/ImageSelectorSidebarBox/index.js +44 -26
- package/KeyframeTimeline/index.js +65 -45
- package/KeyframesSelectorSidebarBox/index.js +76 -54
- package/LandingPage/index.js +76 -38
- package/Locker/index.js +8 -3
- package/MainLayout/RightSidebarItemsWrapper.js +7 -4
- package/MainLayout/icon-dictionary.js +99 -66
- package/MainLayout/index.js +256 -196
- package/MainLayout/index_bugdemo_15_1.js +253 -195
- package/MetadataEditorSidebarBox/index.js +152 -102
- package/MetadataEditorSidebarBox/index_14_01_25.js +152 -102
- package/MetadataEditorSidebarBox/index_repr.js +183 -128
- package/PageSelector/UpdatedBySemaphore.js +54 -0
- package/PageSelector/index.js +172 -96
- package/PageSelector/page-selector.css +126 -2
- package/PointDistances/index.js +45 -33
- package/PreventScrollToParents/index.js +16 -9
- package/RegionLabel/index.js +217 -165
- package/RegionSelectAndTransformBoxes/index.js +131 -105
- package/RegionSelectorSidebarBox/index.js +243 -165
- package/RegionShapes/index.js +213 -153
- package/RegionTags/index.js +83 -69
- package/SettingsDialog/index.js +50 -37
- package/SettingsProvider/index.js +8 -5
- package/Shortcuts/ShortcutField.js +21 -14
- package/Shortcuts/index.js +18 -12
- package/ShortcutsManager/index.js +7 -4
- package/Sidebar/index.js +46 -29
- package/SidebarBoxContainer/index.js +14 -7
- package/SmallToolButton/index.js +23 -16
- package/TagsSidebarBox/index.js +41 -28
- package/TaskDescriptionSidebarBox/index.js +24 -13
- package/Theme/index.js +8 -3
- package/VideoOrImageCanvasBackground/index.js +30 -17
- package/package.json +1 -1
- package/utils/spellcheck-nspell.js +2 -2
|
@@ -11,92 +11,125 @@ var faStyle = {
|
|
|
11
11
|
};
|
|
12
12
|
export var iconDictionary = {
|
|
13
13
|
select: function select() {
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
return (
|
|
15
|
+
/*#__PURE__*/
|
|
16
|
+
React.createElement(FontAwesomeIcon, {
|
|
17
|
+
style: faStyle,
|
|
18
|
+
size: "xs",
|
|
19
|
+
fixedWidth: true,
|
|
20
|
+
icon: faMousePointer
|
|
21
|
+
})
|
|
22
|
+
);
|
|
20
23
|
},
|
|
21
24
|
pan: function pan() {
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
React.createElement(FontAwesomeIcon, {
|
|
28
|
+
style: faStyle,
|
|
29
|
+
size: "xs",
|
|
30
|
+
fixedWidth: true,
|
|
31
|
+
icon: faHandPaper
|
|
32
|
+
})
|
|
33
|
+
);
|
|
28
34
|
},
|
|
29
35
|
zoom: function zoom() {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
return (
|
|
37
|
+
/*#__PURE__*/
|
|
38
|
+
React.createElement(FontAwesomeIcon, {
|
|
39
|
+
style: faStyle,
|
|
40
|
+
size: "xs",
|
|
41
|
+
fixedWidth: true,
|
|
42
|
+
icon: faSearch
|
|
43
|
+
})
|
|
44
|
+
);
|
|
36
45
|
},
|
|
37
46
|
"show-tags": function showTags() {
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
return (
|
|
48
|
+
/*#__PURE__*/
|
|
49
|
+
React.createElement(FontAwesomeIcon, {
|
|
50
|
+
style: faStyle,
|
|
51
|
+
size: "xs",
|
|
52
|
+
fixedWidth: true,
|
|
53
|
+
icon: faTag
|
|
54
|
+
})
|
|
55
|
+
);
|
|
44
56
|
},
|
|
45
57
|
"create-point": function createPoint() {
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
return (
|
|
59
|
+
/*#__PURE__*/
|
|
60
|
+
React.createElement(FontAwesomeIcon, {
|
|
61
|
+
style: faStyle,
|
|
62
|
+
size: "xs",
|
|
63
|
+
fixedWidth: true,
|
|
64
|
+
icon: faCrosshairs
|
|
65
|
+
})
|
|
66
|
+
);
|
|
52
67
|
},
|
|
53
68
|
"create-box": function createBox() {
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
return (
|
|
70
|
+
/*#__PURE__*/
|
|
71
|
+
React.createElement(FontAwesomeIcon, {
|
|
72
|
+
style: faStyle,
|
|
73
|
+
size: "xs",
|
|
74
|
+
fixedWidth: true,
|
|
75
|
+
icon: faVectorSquare
|
|
76
|
+
})
|
|
77
|
+
);
|
|
60
78
|
},
|
|
61
79
|
"create-polygon": function createPolygon() {
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
80
|
+
return (
|
|
81
|
+
/*#__PURE__*/
|
|
82
|
+
React.createElement(FontAwesomeIcon, {
|
|
83
|
+
style: faStyle,
|
|
84
|
+
size: "xs",
|
|
85
|
+
fixedWidth: true,
|
|
86
|
+
icon: faDrawPolygon
|
|
87
|
+
})
|
|
88
|
+
);
|
|
68
89
|
},
|
|
69
90
|
"create-expanding-line": function createExpandingLine() {
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
91
|
+
return (
|
|
92
|
+
/*#__PURE__*/
|
|
93
|
+
React.createElement(FontAwesomeIcon, {
|
|
94
|
+
style: faStyle,
|
|
95
|
+
size: "xs",
|
|
96
|
+
fixedWidth: true,
|
|
97
|
+
icon: faGripLines
|
|
98
|
+
})
|
|
99
|
+
);
|
|
76
100
|
},
|
|
77
101
|
"create-line": function createLine() {
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
102
|
+
return (
|
|
103
|
+
/*#__PURE__*/
|
|
104
|
+
React.createElement(FontAwesomeIcon, {
|
|
105
|
+
style: faStyle,
|
|
106
|
+
size: "xs",
|
|
107
|
+
fixedWidth: true,
|
|
108
|
+
icon: faChartLine
|
|
109
|
+
})
|
|
110
|
+
);
|
|
84
111
|
},
|
|
85
112
|
"show-mask": function showMask() {
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
113
|
+
return (
|
|
114
|
+
/*#__PURE__*/
|
|
115
|
+
React.createElement(FontAwesomeIcon, {
|
|
116
|
+
style: faStyle,
|
|
117
|
+
size: "xs",
|
|
118
|
+
fixedWidth: true,
|
|
119
|
+
icon: faMask
|
|
120
|
+
})
|
|
121
|
+
);
|
|
92
122
|
},
|
|
93
123
|
"modify-allowed-area": function modifyAllowedArea() {
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
124
|
+
return (
|
|
125
|
+
/*#__PURE__*/
|
|
126
|
+
React.createElement(FontAwesomeIcon, {
|
|
127
|
+
style: faStyle,
|
|
128
|
+
size: "xs",
|
|
129
|
+
fixedWidth: true,
|
|
130
|
+
icon: faEdit
|
|
131
|
+
})
|
|
132
|
+
);
|
|
100
133
|
},
|
|
101
134
|
"create-keypoints": AccessibilityNewIcon,
|
|
102
135
|
window: FullscreenIcon
|
package/MainLayout/index.js
CHANGED
|
@@ -53,9 +53,12 @@ var HotkeyDiv = withHotKeys(function (_ref) {
|
|
|
53
53
|
divRef = _ref.divRef,
|
|
54
54
|
props = _objectWithoutProperties(_ref, ["hotKeys", "children", "divRef"]);
|
|
55
55
|
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
return (
|
|
57
|
+
/*#__PURE__*/
|
|
58
|
+
React.createElement("div", Object.assign({}, _objectSpread({}, hotKeys, props), {
|
|
59
|
+
ref: divRef
|
|
60
|
+
}), children)
|
|
61
|
+
);
|
|
59
62
|
});
|
|
60
63
|
var FullScreenContainer = styled("div")(function (_ref2) {
|
|
61
64
|
var theme = _ref2.theme;
|
|
@@ -130,7 +133,8 @@ export var MainLayout = function MainLayout(_ref5) {
|
|
|
130
133
|
saveActive = _ref5$saveActive === void 0 ? false : _ref5$saveActive,
|
|
131
134
|
onMetadataChange = _ref5.onMetadataChange,
|
|
132
135
|
onAddGroup = _ref5.onAddGroup,
|
|
133
|
-
onRecalcClick = _ref5.onRecalcClick
|
|
136
|
+
onRecalcClick = _ref5.onRecalcClick,
|
|
137
|
+
updatedBy = _ref5.updatedBy;
|
|
134
138
|
var classes = useStyles();
|
|
135
139
|
var settings = useSettings();
|
|
136
140
|
var fullScreenHandle = useFullScreenHandle();
|
|
@@ -201,7 +205,9 @@ export var MainLayout = function MainLayout(_ref5) {
|
|
|
201
205
|
var allowedGroups = useMemo(function () {
|
|
202
206
|
return regionsGroups(state.images[state.selectedImage].regions);
|
|
203
207
|
}, [state.images, state.selectedImage]);
|
|
204
|
-
var canvas =
|
|
208
|
+
var canvas =
|
|
209
|
+
/*#__PURE__*/
|
|
210
|
+
React.createElement(ImageCanvas, Object.assign({}, settings, {
|
|
205
211
|
showCrosshairs: settings.showCrosshairs && !["select", "pan", "zoom"].includes(state.selectedTool),
|
|
206
212
|
key: state.selectedImage,
|
|
207
213
|
showMask: state.showMask,
|
|
@@ -330,199 +336,253 @@ export var MainLayout = function MainLayout(_ref5) {
|
|
|
330
336
|
var selectedFrame = ((_state$images$state$s4 = state.images[state.selectedImage]) === null || _state$images$state$s4 === void 0 ? void 0 : (_state$images$state$s5 = _state$images$state$s4.regions.find(function (i) {
|
|
331
337
|
return i.highlighted === true;
|
|
332
338
|
})) === null || _state$images$state$s5 === void 0 ? void 0 : _state$images$state$s5.id) || '';
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
return (
|
|
340
|
+
/*#__PURE__*/
|
|
341
|
+
React.createElement(ThemeProvider, {
|
|
342
|
+
theme: theme
|
|
343
|
+
},
|
|
344
|
+
/*#__PURE__*/
|
|
345
|
+
React.createElement(FullScreenContainer, null,
|
|
346
|
+
/*#__PURE__*/
|
|
347
|
+
React.createElement(FullScreen, {
|
|
348
|
+
handle: fullScreenHandle,
|
|
349
|
+
onChange: function onChange(open) {
|
|
350
|
+
if (!open) {
|
|
351
|
+
fullScreenHandle.exit();
|
|
352
|
+
action("HEADER_BUTTON_CLICKED", "buttonName")("Window");
|
|
353
|
+
}
|
|
341
354
|
}
|
|
342
|
-
}
|
|
343
|
-
}, React.createElement(HotkeyDiv, {
|
|
344
|
-
tabIndex: -1,
|
|
345
|
-
divRef: innerContainerRef,
|
|
346
|
-
onMouseDown: refocusOnMouseEvent,
|
|
347
|
-
onMouseOver: refocusOnMouseEvent,
|
|
348
|
-
allowChanges: true,
|
|
349
|
-
handlers: hotkeyHandlers,
|
|
350
|
-
className: classnames(classes.container, state.fullScreen && "Fullscreen")
|
|
351
|
-
}, React.createElement("div", {
|
|
352
|
-
style: {
|
|
353
|
-
display: 'flex',
|
|
354
|
-
flexDirection: 'row'
|
|
355
|
-
}
|
|
356
|
-
}, showPageSelector && React.createElement(PageSelector, {
|
|
357
|
-
pages: pages,
|
|
358
|
-
onPageClick: handlePageClick,
|
|
359
|
-
onMetadataChange: onMetadataChange,
|
|
360
|
-
metadataConfigs: state.metadataConfigs || [],
|
|
361
|
-
onRecalcClick: onRecalcClick
|
|
362
|
-
}), React.createElement(WorkspaceWrapper, null, React.createElement(Workspace, {
|
|
363
|
-
style: {
|
|
364
|
-
width: "auto"
|
|
365
355
|
},
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
},
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
name: "Clone"
|
|
388
|
-
}, !hideSettings && {
|
|
389
|
-
name: "Settings"
|
|
390
|
-
}, !hideFullScreen && (state.fullScreen ? {
|
|
391
|
-
name: "Window"
|
|
392
|
-
} : {
|
|
393
|
-
name: "Fullscreen"
|
|
394
|
-
}), !hideSave && {
|
|
395
|
-
name: "Save"
|
|
396
|
-
}].filter(Boolean),
|
|
397
|
-
onClickHeaderItem: onClickHeaderItem,
|
|
398
|
-
onClickIconSidebarItem: onClickIconSidebarItem,
|
|
399
|
-
selectedTools: [state.selectedTool, state.showTags && "show-tags", state.showMask && "show-mask"].filter(Boolean),
|
|
400
|
-
iconSidebarItems: !state.enabledTools ? [] : [{
|
|
401
|
-
name: "select",
|
|
402
|
-
helperText: "Select" + getHotkeyHelpText("select_tool"),
|
|
403
|
-
alwaysShowing: false
|
|
404
|
-
}, {
|
|
405
|
-
name: "pan",
|
|
406
|
-
helperText: "Drag/Pan (right or middle click)" + getHotkeyHelpText("pan_tool"),
|
|
407
|
-
alwaysShowing: false
|
|
408
|
-
}, {
|
|
409
|
-
name: "zoom",
|
|
410
|
-
helperText: "Zoom In/Out (scroll)" + getHotkeyHelpText("zoom_tool"),
|
|
411
|
-
alwaysShowing: false
|
|
412
|
-
}, {
|
|
413
|
-
name: "show-tags",
|
|
414
|
-
helperText: "Show / Hide Tags",
|
|
415
|
-
alwaysShowing: false
|
|
416
|
-
}, {
|
|
417
|
-
name: "create-point",
|
|
418
|
-
helperText: "Add Point" + getHotkeyHelpText("create_point")
|
|
419
|
-
}, {
|
|
420
|
-
name: "create-box",
|
|
421
|
-
helperText: "Add Bounding Box" + getHotkeyHelpText("create_bounding_box")
|
|
422
|
-
}, {
|
|
423
|
-
name: "create-polygon",
|
|
424
|
-
helperText: "Add Polygon" + getHotkeyHelpText("create_polygon")
|
|
425
|
-
}, {
|
|
426
|
-
name: "create-line",
|
|
427
|
-
helperText: "Add Line"
|
|
428
|
-
}, {
|
|
429
|
-
name: "create-expanding-line",
|
|
430
|
-
helperText: "Add Expanding Line"
|
|
431
|
-
}, {
|
|
432
|
-
name: "create-keypoints",
|
|
433
|
-
helperText: "Add Keypoints (Pose)"
|
|
434
|
-
}, state.fullImageSegmentationMode && {
|
|
435
|
-
name: "show-mask",
|
|
436
|
-
alwaysShowing: false,
|
|
437
|
-
helperText: "Show / Hide Mask"
|
|
438
|
-
}, {
|
|
439
|
-
name: "modify-allowed-area",
|
|
440
|
-
helperText: "Modify Allowed Area"
|
|
441
|
-
}].filter(Boolean).filter(function (a) {
|
|
442
|
-
return a.alwaysShowing || state.enabledTools.includes(a.name);
|
|
443
|
-
}),
|
|
444
|
-
rightSidebarItems: [React.createElement(RightSidebarItemsWrapper, null, [isSelectedImageLocked && React.createElement(Locker, null), debugModeOn && React.createElement(DebugBox, {
|
|
445
|
-
state: debugModeOn,
|
|
446
|
-
lastAction: state.lastAction,
|
|
447
|
-
key: "debug-box"
|
|
448
|
-
}), state.taskDescription && React.createElement(TaskDescription, {
|
|
449
|
-
description: state.taskDescription,
|
|
450
|
-
key: "task-description"
|
|
451
|
-
}), state.help && React.createElement(Help, {
|
|
452
|
-
help: state.help,
|
|
453
|
-
key: "help"
|
|
454
|
-
}), state.regionClsList && React.createElement(ClassSelectionMenu, {
|
|
455
|
-
selectedCls: state.selectedCls,
|
|
456
|
-
regionClsList: state.regionClsList,
|
|
457
|
-
onSelectCls: action("SELECT_CLASSIFICATION", "cls"),
|
|
458
|
-
key: "class-selection-menu"
|
|
459
|
-
}), state.labelImages && React.createElement(TagsSidebarBox, {
|
|
460
|
-
currentImage: activeImage,
|
|
461
|
-
imageClsList: state.imageClsList,
|
|
462
|
-
imageTagList: state.imageTagList,
|
|
463
|
-
onChangeImage: action("CHANGE_IMAGE", "delta"),
|
|
464
|
-
expandedByDefault: true,
|
|
465
|
-
key: "tags-sidebar-box"
|
|
466
|
-
}),, // (state.images?.length || 0) > 1 && (
|
|
467
|
-
// <ImageSelector
|
|
468
|
-
// onSelect={action("SELECT_REGION", "region")}
|
|
469
|
-
// images={state.images}
|
|
470
|
-
// />
|
|
471
|
-
// ),
|
|
472
|
-
// groups && (
|
|
473
|
-
// <GroupSelector
|
|
474
|
-
// title="Articles"
|
|
475
|
-
// groups={groups}
|
|
476
|
-
// selectedGroupId={selectedGroupId}
|
|
477
|
-
// onSelect={onGroupSelect}
|
|
478
|
-
// />
|
|
479
|
-
// )
|
|
480
|
-
React.createElement(RegionSelector, {
|
|
481
|
-
regions: activeImage ? activeImage.regions : emptyArr,
|
|
482
|
-
onSelectRegion: action("SELECT_REGION", "region"),
|
|
483
|
-
onDeleteRegion: action("DELETE_REGION", "region"),
|
|
484
|
-
onDeleteAllRegions: action("DELETE_ALL_REGIONS"),
|
|
485
|
-
onChangeRegion: action("CHANGE_REGION", "region"),
|
|
486
|
-
key: "region-selector"
|
|
487
|
-
}), state.keyframes && React.createElement(KeyframesSelector, {
|
|
488
|
-
onChangeVideoTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
489
|
-
onDeleteKeyframe: action("DELETE_KEYFRAME", "time"),
|
|
490
|
-
onDeleteAllKeyframes: action("DELETE_ALL_KEYFRAMES"),
|
|
491
|
-
onChangeCurrentTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
492
|
-
currentTime: state.currentVideoTime,
|
|
493
|
-
duration: state.videoDuration,
|
|
494
|
-
keyframes: state.keyframes,
|
|
495
|
-
key: "key-frame-selector"
|
|
496
|
-
}), !hideHistory && React.createElement(HistorySidebarBox, {
|
|
497
|
-
history: state.history,
|
|
498
|
-
onRestoreHistory: action("RESTORE_HISTORY"),
|
|
499
|
-
key: "history-sidebar"
|
|
500
|
-
}), React.createElement(MetadataEditor, {
|
|
501
|
-
state: state,
|
|
356
|
+
/*#__PURE__*/
|
|
357
|
+
React.createElement(HotkeyDiv, {
|
|
358
|
+
tabIndex: -1,
|
|
359
|
+
divRef: innerContainerRef,
|
|
360
|
+
onMouseDown: refocusOnMouseEvent,
|
|
361
|
+
onMouseOver: refocusOnMouseEvent,
|
|
362
|
+
allowChanges: true,
|
|
363
|
+
handlers: hotkeyHandlers,
|
|
364
|
+
className: classnames(classes.container, state.fullScreen && "Fullscreen")
|
|
365
|
+
},
|
|
366
|
+
/*#__PURE__*/
|
|
367
|
+
React.createElement("div", {
|
|
368
|
+
style: {
|
|
369
|
+
display: 'flex',
|
|
370
|
+
flexDirection: 'row'
|
|
371
|
+
}
|
|
372
|
+
}, showPageSelector &&
|
|
373
|
+
/*#__PURE__*/
|
|
374
|
+
React.createElement(PageSelector, {
|
|
375
|
+
pages: pages,
|
|
376
|
+
onPageClick: handlePageClick,
|
|
502
377
|
onMetadataChange: onMetadataChange,
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
378
|
+
metadataConfigs: state.metadataConfigs || [],
|
|
379
|
+
onRecalcClick: onRecalcClick,
|
|
380
|
+
updatedBy: updatedBy
|
|
381
|
+
}),
|
|
382
|
+
/*#__PURE__*/
|
|
383
|
+
React.createElement(WorkspaceWrapper, null,
|
|
384
|
+
/*#__PURE__*/
|
|
385
|
+
React.createElement(Workspace, {
|
|
386
|
+
style: {
|
|
387
|
+
width: "auto"
|
|
388
|
+
},
|
|
389
|
+
allowFullscreen: true,
|
|
390
|
+
iconDictionary: iconDictionary,
|
|
391
|
+
hideHeader: hideHeader,
|
|
392
|
+
hideHeaderText: hideHeaderText,
|
|
393
|
+
headerLeftSide: [state.annotationType === "video" ?
|
|
394
|
+
/*#__PURE__*/
|
|
395
|
+
React.createElement(KeyframeTimeline, {
|
|
396
|
+
currentTime: state.currentVideoTime,
|
|
397
|
+
duration: state.videoDuration,
|
|
398
|
+
onChangeCurrentTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
399
|
+
keyframes: state.keyframes
|
|
400
|
+
}) : activeImage ?
|
|
401
|
+
/*#__PURE__*/
|
|
402
|
+
React.createElement("div", {
|
|
403
|
+
className: classes.headerTitle
|
|
404
|
+
}, activeImage.name) : null].filter(Boolean),
|
|
405
|
+
headerItems: [!hidePrev && {
|
|
406
|
+
name: "Prev"
|
|
407
|
+
}, !hideNext && {
|
|
408
|
+
name: "Next"
|
|
409
|
+
}, state.annotationType !== "video" ? null : !state.videoPlaying ? {
|
|
410
|
+
name: "Play"
|
|
411
|
+
} : {
|
|
412
|
+
name: "Pause"
|
|
413
|
+
}, !hideClone && !nextImageHasRegions && activeImage.regions && {
|
|
414
|
+
name: "Clone"
|
|
415
|
+
}, !hideSettings && {
|
|
416
|
+
name: "Settings"
|
|
417
|
+
}, !hideFullScreen && (state.fullScreen ? {
|
|
418
|
+
name: "Window"
|
|
419
|
+
} : {
|
|
420
|
+
name: "Fullscreen"
|
|
421
|
+
}), !hideSave && {
|
|
422
|
+
name: "Save"
|
|
423
|
+
}].filter(Boolean),
|
|
424
|
+
onClickHeaderItem: onClickHeaderItem,
|
|
425
|
+
onClickIconSidebarItem: onClickIconSidebarItem,
|
|
426
|
+
selectedTools: [state.selectedTool, state.showTags && "show-tags", state.showMask && "show-mask"].filter(Boolean),
|
|
427
|
+
iconSidebarItems: !state.enabledTools ? [] : [{
|
|
428
|
+
name: "select",
|
|
429
|
+
helperText: "Select" + getHotkeyHelpText("select_tool"),
|
|
430
|
+
alwaysShowing: false
|
|
431
|
+
}, {
|
|
432
|
+
name: "pan",
|
|
433
|
+
helperText: "Drag/Pan (right or middle click)" + getHotkeyHelpText("pan_tool"),
|
|
434
|
+
alwaysShowing: false
|
|
435
|
+
}, {
|
|
436
|
+
name: "zoom",
|
|
437
|
+
helperText: "Zoom In/Out (scroll)" + getHotkeyHelpText("zoom_tool"),
|
|
438
|
+
alwaysShowing: false
|
|
439
|
+
}, {
|
|
440
|
+
name: "show-tags",
|
|
441
|
+
helperText: "Show / Hide Tags",
|
|
442
|
+
alwaysShowing: false
|
|
443
|
+
}, {
|
|
444
|
+
name: "create-point",
|
|
445
|
+
helperText: "Add Point" + getHotkeyHelpText("create_point")
|
|
446
|
+
}, {
|
|
447
|
+
name: "create-box",
|
|
448
|
+
helperText: "Add Bounding Box" + getHotkeyHelpText("create_bounding_box")
|
|
449
|
+
}, {
|
|
450
|
+
name: "create-polygon",
|
|
451
|
+
helperText: "Add Polygon" + getHotkeyHelpText("create_polygon")
|
|
452
|
+
}, {
|
|
453
|
+
name: "create-line",
|
|
454
|
+
helperText: "Add Line"
|
|
455
|
+
}, {
|
|
456
|
+
name: "create-expanding-line",
|
|
457
|
+
helperText: "Add Expanding Line"
|
|
458
|
+
}, {
|
|
459
|
+
name: "create-keypoints",
|
|
460
|
+
helperText: "Add Keypoints (Pose)"
|
|
461
|
+
}, state.fullImageSegmentationMode && {
|
|
462
|
+
name: "show-mask",
|
|
463
|
+
alwaysShowing: false,
|
|
464
|
+
helperText: "Show / Hide Mask"
|
|
465
|
+
}, {
|
|
466
|
+
name: "modify-allowed-area",
|
|
467
|
+
helperText: "Modify Allowed Area"
|
|
468
|
+
}].filter(Boolean).filter(function (a) {
|
|
469
|
+
return a.alwaysShowing || state.enabledTools.includes(a.name);
|
|
470
|
+
}),
|
|
471
|
+
rightSidebarItems: [
|
|
472
|
+
/*#__PURE__*/
|
|
473
|
+
React.createElement(RightSidebarItemsWrapper, null, [isSelectedImageLocked &&
|
|
474
|
+
/*#__PURE__*/
|
|
475
|
+
React.createElement(Locker, null), debugModeOn &&
|
|
476
|
+
/*#__PURE__*/
|
|
477
|
+
React.createElement(DebugBox, {
|
|
478
|
+
state: debugModeOn,
|
|
479
|
+
lastAction: state.lastAction,
|
|
480
|
+
key: "debug-box"
|
|
481
|
+
}), state.taskDescription &&
|
|
482
|
+
/*#__PURE__*/
|
|
483
|
+
React.createElement(TaskDescription, {
|
|
484
|
+
description: state.taskDescription,
|
|
485
|
+
key: "task-description"
|
|
486
|
+
}), state.help &&
|
|
487
|
+
/*#__PURE__*/
|
|
488
|
+
React.createElement(Help, {
|
|
489
|
+
help: state.help,
|
|
490
|
+
key: "help"
|
|
491
|
+
}), state.regionClsList &&
|
|
492
|
+
/*#__PURE__*/
|
|
493
|
+
React.createElement(ClassSelectionMenu, {
|
|
494
|
+
selectedCls: state.selectedCls,
|
|
495
|
+
regionClsList: state.regionClsList,
|
|
496
|
+
onSelectCls: action("SELECT_CLASSIFICATION", "cls"),
|
|
497
|
+
key: "class-selection-menu"
|
|
498
|
+
}), state.labelImages &&
|
|
499
|
+
/*#__PURE__*/
|
|
500
|
+
React.createElement(TagsSidebarBox, {
|
|
501
|
+
currentImage: activeImage,
|
|
502
|
+
imageClsList: state.imageClsList,
|
|
503
|
+
imageTagList: state.imageTagList,
|
|
504
|
+
onChangeImage: action("CHANGE_IMAGE", "delta"),
|
|
505
|
+
expandedByDefault: true,
|
|
506
|
+
key: "tags-sidebar-box"
|
|
507
|
+
}),,
|
|
508
|
+
/*#__PURE__*/
|
|
509
|
+
// (state.images?.length || 0) > 1 && (
|
|
510
|
+
// <ImageSelector
|
|
511
|
+
// onSelect={action("SELECT_REGION", "region")}
|
|
512
|
+
// images={state.images}
|
|
513
|
+
// />
|
|
514
|
+
// ),
|
|
515
|
+
// groups && (
|
|
516
|
+
// <GroupSelector
|
|
517
|
+
// title="Articles"
|
|
518
|
+
// groups={groups}
|
|
519
|
+
// selectedGroupId={selectedGroupId}
|
|
520
|
+
// onSelect={onGroupSelect}
|
|
521
|
+
// />
|
|
522
|
+
// )
|
|
523
|
+
React.createElement(RegionSelector, {
|
|
524
|
+
regions: activeImage ? activeImage.regions : emptyArr,
|
|
525
|
+
onSelectRegion: action("SELECT_REGION", "region"),
|
|
526
|
+
onDeleteRegion: action("DELETE_REGION", "region"),
|
|
527
|
+
onDeleteAllRegions: action("DELETE_ALL_REGIONS"),
|
|
528
|
+
onChangeRegion: action("CHANGE_REGION", "region"),
|
|
529
|
+
key: "region-selector"
|
|
530
|
+
}), state.keyframes &&
|
|
531
|
+
/*#__PURE__*/
|
|
532
|
+
React.createElement(KeyframesSelector, {
|
|
533
|
+
onChangeVideoTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
534
|
+
onDeleteKeyframe: action("DELETE_KEYFRAME", "time"),
|
|
535
|
+
onDeleteAllKeyframes: action("DELETE_ALL_KEYFRAMES"),
|
|
536
|
+
onChangeCurrentTime: action("CHANGE_VIDEO_TIME", "newTime"),
|
|
537
|
+
currentTime: state.currentVideoTime,
|
|
538
|
+
duration: state.videoDuration,
|
|
539
|
+
keyframes: state.keyframes,
|
|
540
|
+
key: "key-frame-selector"
|
|
541
|
+
}), !hideHistory &&
|
|
542
|
+
/*#__PURE__*/
|
|
543
|
+
React.createElement(HistorySidebarBox, {
|
|
544
|
+
history: state.history,
|
|
545
|
+
onRestoreHistory: action("RESTORE_HISTORY"),
|
|
546
|
+
key: "history-sidebar"
|
|
547
|
+
}),
|
|
548
|
+
/*#__PURE__*/
|
|
549
|
+
React.createElement(MetadataEditor, {
|
|
550
|
+
state: state,
|
|
551
|
+
onMetadataChange: onMetadataChange,
|
|
552
|
+
key: "metadata-editor"
|
|
553
|
+
}),
|
|
554
|
+
/*#__PURE__*/
|
|
555
|
+
React.createElement(GroupsEditor, {
|
|
556
|
+
groups: allowedGroups,
|
|
557
|
+
onAddGroup: onAddGroup,
|
|
558
|
+
key: "groups-editor"
|
|
559
|
+
})].filter(Boolean))]
|
|
560
|
+
}, isSelectedImageLocked &&
|
|
561
|
+
/*#__PURE__*/
|
|
562
|
+
React.createElement(Locker, null), canvas)), showEditor && !isSelectedImageLocked &&
|
|
563
|
+
/*#__PURE__*/
|
|
564
|
+
React.createElement(EditorWrapper, {
|
|
565
|
+
id: "editor-wrapper"
|
|
566
|
+
},
|
|
567
|
+
/*#__PURE__*/
|
|
568
|
+
React.createElement(Editor, {
|
|
569
|
+
id: "editor",
|
|
570
|
+
blocks: blocks,
|
|
571
|
+
imageIndex: state.selectedImage,
|
|
572
|
+
key: "".concat(state.selectedImage, "#").concat(selectedGroupId),
|
|
573
|
+
selectedFrame: selectedFrame,
|
|
574
|
+
onChange: handleEditorChange
|
|
575
|
+
}))),
|
|
576
|
+
/*#__PURE__*/
|
|
577
|
+
React.createElement(SettingsDialog, {
|
|
578
|
+
open: state.settingsOpen,
|
|
579
|
+
onClose: function onClose() {
|
|
580
|
+
return dispatch({
|
|
581
|
+
type: "HEADER_BUTTON_CLICKED",
|
|
582
|
+
buttonName: "Settings"
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
})))))
|
|
586
|
+
);
|
|
527
587
|
};
|
|
528
588
|
export default MainLayout;
|