@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
|
@@ -23,17 +23,28 @@ var GroupItemDiv = styled("div")(function (_ref) {
|
|
|
23
23
|
|
|
24
24
|
var GroupItem = function GroupItem(_ref2) {
|
|
25
25
|
var group = _ref2.group;
|
|
26
|
-
return
|
|
26
|
+
return (
|
|
27
|
+
/*#__PURE__*/
|
|
28
|
+
React.createElement(GroupItemDiv, null, uuidToHash(group.id))
|
|
29
|
+
);
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
var GroupList = function GroupList(_ref3) {
|
|
30
33
|
var groups = _ref3.groups;
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
return (
|
|
35
|
+
/*#__PURE__*/
|
|
36
|
+
React.createElement("div", null,
|
|
37
|
+
/*#__PURE__*/
|
|
38
|
+
React.createElement("h2", null, "Groups"), groups.map(function (g, idx) {
|
|
39
|
+
return (
|
|
40
|
+
/*#__PURE__*/
|
|
41
|
+
React.createElement(GroupItem, {
|
|
42
|
+
key: "".concat(g, "-").concat(idx),
|
|
43
|
+
group: g
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
}))
|
|
47
|
+
);
|
|
37
48
|
};
|
|
38
49
|
|
|
39
50
|
var AddGroupFormDiv = styled("div")(function (_ref4) {
|
|
@@ -62,25 +73,34 @@ var AddGroupFrom = function AddGroupFrom(_ref5) {
|
|
|
62
73
|
setValue('');
|
|
63
74
|
};
|
|
64
75
|
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
return (
|
|
77
|
+
/*#__PURE__*/
|
|
78
|
+
React.createElement(AddGroupFormDiv, null,
|
|
79
|
+
/*#__PURE__*/
|
|
80
|
+
React.createElement("form", {
|
|
81
|
+
onSubmit: handleSubmit,
|
|
82
|
+
style: {
|
|
83
|
+
display: "flex",
|
|
84
|
+
paddingRight: "6px"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
/*#__PURE__*/
|
|
88
|
+
React.createElement("input", {
|
|
89
|
+
type: "text",
|
|
90
|
+
value: value,
|
|
91
|
+
name: "new-group",
|
|
92
|
+
placeholder: "New group name",
|
|
93
|
+
onChange: handleChange,
|
|
94
|
+
style: {
|
|
95
|
+
marginRight: "1rem"
|
|
96
|
+
}
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/
|
|
99
|
+
React.createElement("input", {
|
|
100
|
+
type: "submit",
|
|
101
|
+
value: "Create group"
|
|
102
|
+
})))
|
|
103
|
+
);
|
|
84
104
|
};
|
|
85
105
|
|
|
86
106
|
var DivContainer = styled("div")(function (_ref6) {
|
|
@@ -119,20 +139,35 @@ var DivContainer = styled("div")(function (_ref6) {
|
|
|
119
139
|
export var GroupsEditorSidebarBox = function GroupsEditorSidebarBox(_ref7) {
|
|
120
140
|
var groups = _ref7.groups,
|
|
121
141
|
onAddGroup = _ref7.onAddGroup;
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
142
|
+
return (
|
|
143
|
+
/*#__PURE__*/
|
|
144
|
+
React.createElement(ThemeProvider, {
|
|
145
|
+
theme: theme
|
|
146
|
+
},
|
|
147
|
+
/*#__PURE__*/
|
|
148
|
+
React.createElement(SidebarBoxContainer, {
|
|
149
|
+
title: "Groups",
|
|
150
|
+
icon:
|
|
151
|
+
/*#__PURE__*/
|
|
152
|
+
React.createElement(FilterNoneIcon, {
|
|
153
|
+
style: {
|
|
154
|
+
color: grey[700]
|
|
155
|
+
}
|
|
156
|
+
}),
|
|
157
|
+
expandedByDefault: true
|
|
158
|
+
},
|
|
159
|
+
/*#__PURE__*/
|
|
160
|
+
React.createElement(DivContainer, null,
|
|
161
|
+
/*#__PURE__*/
|
|
162
|
+
React.createElement("h2", null, "Add new group"),
|
|
163
|
+
/*#__PURE__*/
|
|
164
|
+
React.createElement(AddGroupFrom, {
|
|
165
|
+
onAddGroup: onAddGroup
|
|
130
166
|
}),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}))));
|
|
167
|
+
/*#__PURE__*/
|
|
168
|
+
React.createElement(GroupList, {
|
|
169
|
+
groups: groups
|
|
170
|
+
}))))
|
|
171
|
+
);
|
|
137
172
|
};
|
|
138
173
|
export default memo(GroupsEditorSidebarBox);
|
package/HelpSidebarBox/index.js
CHANGED
|
@@ -41,18 +41,29 @@ var MarkdownContainer = styled("div")(function (_ref) {
|
|
|
41
41
|
});
|
|
42
42
|
export var HelpSidebarBox = function HelpSidebarBox(_ref2) {
|
|
43
43
|
var help = _ref2.help;
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
return (
|
|
45
|
+
/*#__PURE__*/
|
|
46
|
+
React.createElement(ThemeProvider, {
|
|
47
|
+
theme: theme
|
|
48
|
+
},
|
|
49
|
+
/*#__PURE__*/
|
|
50
|
+
React.createElement(SidebarBoxContainer, {
|
|
51
|
+
title: "Help",
|
|
52
|
+
icon:
|
|
53
|
+
/*#__PURE__*/
|
|
54
|
+
React.createElement(HelpIcon, {
|
|
55
|
+
style: {
|
|
56
|
+
color: grey[700]
|
|
57
|
+
}
|
|
58
|
+
}),
|
|
59
|
+
expandedByDefault: help && help !== "" ? false : true
|
|
60
|
+
},
|
|
61
|
+
/*#__PURE__*/
|
|
62
|
+
React.createElement(MarkdownContainer, null,
|
|
63
|
+
/*#__PURE__*/
|
|
64
|
+
React.createElement(Markdown, {
|
|
65
|
+
source: help
|
|
66
|
+
}))))
|
|
67
|
+
);
|
|
57
68
|
};
|
|
58
69
|
export default memo(HelpSidebarBox);
|
package/HighlightBox/index.js
CHANGED
|
@@ -67,36 +67,43 @@ export var HighlightBox = function HighlightBox(_ref) {
|
|
|
67
67
|
height: pbox.h + 10
|
|
68
68
|
};
|
|
69
69
|
var pathD = r.type === "point" ? "M5,5 L".concat(styleCoords.width - 5, " 5L").concat(styleCoords.width - 5, " ").concat(styleCoords.height - 5, "L5 ").concat(styleCoords.height - 5, "Z") : "M5,5 L".concat(pbox.w + 5, ",5 L").concat(pbox.w + 5, ",").concat(pbox.h + 5, " L5,").concat(pbox.h + 5, " Z");
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
return (
|
|
71
|
+
/*#__PURE__*/
|
|
72
|
+
React.createElement(ThemeProvider, {
|
|
73
|
+
theme: theme
|
|
74
|
+
},
|
|
75
|
+
/*#__PURE__*/
|
|
76
|
+
React.createElement("svg", Object.assign({
|
|
77
|
+
key: r.id,
|
|
78
|
+
className: classnames(classes.highlightBox, {
|
|
79
|
+
highlighted: r.highlighted
|
|
80
|
+
})
|
|
81
|
+
}, mouseEvents, !zoomWithPrimary && !dragWithPrimary ? {
|
|
82
|
+
onMouseDown: function onMouseDown(e) {
|
|
83
|
+
if (!r.locked && r.type === "point" && r.highlighted && e.button === 0) {
|
|
84
|
+
return onBeginMovePoint(r);
|
|
85
|
+
}
|
|
82
86
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
if (e.button === 0 && !createWithPrimary) return onSelectRegion(_objectSpread({}, r, {
|
|
88
|
+
ctrlKey: e.ctrlKey
|
|
89
|
+
}));
|
|
90
|
+
mouseEvents.onMouseDown(e);
|
|
91
|
+
}
|
|
92
|
+
} : {}, {
|
|
93
|
+
style: _objectSpread({}, r.highlighted ? {
|
|
94
|
+
pointerEvents: r.type !== "point" ? "none" : undefined,
|
|
95
|
+
cursor: "grab"
|
|
96
|
+
} : {
|
|
97
|
+
cursor: !(zoomWithPrimary || dragWithPrimary || createWithPrimary) ? "pointer" : undefined,
|
|
98
|
+
pointerEvents: zoomWithPrimary || dragWithPrimary || createWithPrimary && !r.highlighted ? "none" : undefined
|
|
99
|
+
}, {
|
|
100
|
+
position: "absolute"
|
|
101
|
+
}, styleCoords)
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/
|
|
104
|
+
React.createElement("path", {
|
|
105
|
+
d: pathD
|
|
106
|
+
})))
|
|
107
|
+
);
|
|
101
108
|
};
|
|
102
109
|
export default HighlightBox;
|
|
@@ -32,35 +32,57 @@ export var HistorySidebarBox = function HistorySidebarBox(_ref) {
|
|
|
32
32
|
var history = _ref.history,
|
|
33
33
|
onRestoreHistory = _ref.onRestoreHistory;
|
|
34
34
|
var classes = useStyles();
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
35
|
+
return (
|
|
36
|
+
/*#__PURE__*/
|
|
37
|
+
React.createElement(ThemeProvider, {
|
|
38
|
+
theme: theme
|
|
39
|
+
},
|
|
40
|
+
/*#__PURE__*/
|
|
41
|
+
React.createElement(SidebarBoxContainer, {
|
|
42
|
+
title: "History",
|
|
43
|
+
icon:
|
|
44
|
+
/*#__PURE__*/
|
|
45
|
+
React.createElement(HistoryIcon, {
|
|
46
|
+
style: {
|
|
47
|
+
color: grey[700]
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
expandedByDefault: true
|
|
51
|
+
},
|
|
52
|
+
/*#__PURE__*/
|
|
53
|
+
React.createElement(List, null, history.length === 0 &&
|
|
54
|
+
/*#__PURE__*/
|
|
55
|
+
React.createElement("div", {
|
|
56
|
+
className: classes.emptyText
|
|
57
|
+
}, "No History Yet"), history.map(function (_ref2, i) {
|
|
58
|
+
var name = _ref2.name,
|
|
59
|
+
time = _ref2.time;
|
|
60
|
+
return (
|
|
61
|
+
/*#__PURE__*/
|
|
62
|
+
React.createElement(ListItem, {
|
|
63
|
+
button: true,
|
|
64
|
+
dense: true,
|
|
65
|
+
key: i
|
|
66
|
+
},
|
|
67
|
+
/*#__PURE__*/
|
|
68
|
+
React.createElement(ListItemText, {
|
|
69
|
+
style: listItemTextStyle,
|
|
70
|
+
primary: name,
|
|
71
|
+
secondary: moment(time).format("LT")
|
|
72
|
+
}), i === 0 &&
|
|
73
|
+
/*#__PURE__*/
|
|
74
|
+
React.createElement(ListItemSecondaryAction, {
|
|
75
|
+
onClick: function onClick() {
|
|
76
|
+
return onRestoreHistory();
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
/*#__PURE__*/
|
|
80
|
+
React.createElement(IconButton, null,
|
|
81
|
+
/*#__PURE__*/
|
|
82
|
+
React.createElement(UndoIcon, null))))
|
|
83
|
+
);
|
|
84
|
+
}))))
|
|
85
|
+
);
|
|
64
86
|
};
|
|
65
87
|
export default memo(HistorySidebarBox, function (prevProps, nextProps) {
|
|
66
88
|
return isEqual(prevProps.history.map(function (a) {
|
package/ImageCanvas/index.js
CHANGED
|
@@ -306,136 +306,171 @@ export var ImageCanvas = function ImageCanvas(_ref2) {
|
|
|
306
306
|
if (highlightedRegions.length !== 1) return null;
|
|
307
307
|
return highlightedRegions[0];
|
|
308
308
|
}, [regions]);
|
|
309
|
-
return
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
width: "100%",
|
|
314
|
-
height: "100vh",
|
|
315
|
-
position: "relative",
|
|
316
|
-
overflow: "hidden",
|
|
317
|
-
cursor: createWithPrimary ? "crosshair" : dragging ? "grabbing" : dragWithPrimary ? "grab" : zoomWithPrimary ? mat.a < 1 ? "zoom-out" : "zoom-in" : undefined
|
|
318
|
-
}
|
|
319
|
-
}, showCrosshairs && React.createElement(Crosshairs, {
|
|
320
|
-
key: "crossHairs",
|
|
321
|
-
mousePosition: mousePosition
|
|
322
|
-
}), imageLoaded && !dragging && React.createElement(RegionSelectAndTransformBoxes, {
|
|
323
|
-
key: "regionSelectAndTransformBoxes",
|
|
324
|
-
regions: !modifyingAllowedArea || !allowedArea ? regions : [{
|
|
325
|
-
type: "box",
|
|
326
|
-
id: "$$allowed_area",
|
|
327
|
-
cls: "allowed_area",
|
|
328
|
-
highlighted: true,
|
|
329
|
-
x: allowedArea.x,
|
|
330
|
-
y: allowedArea.y,
|
|
331
|
-
w: allowedArea.w,
|
|
332
|
-
h: allowedArea.h,
|
|
333
|
-
visible: true,
|
|
334
|
-
color: "#ff0"
|
|
335
|
-
}],
|
|
336
|
-
mouseEvents: mouseEvents,
|
|
337
|
-
projectRegionBox: projectRegionBox,
|
|
338
|
-
dragWithPrimary: dragWithPrimary,
|
|
339
|
-
createWithPrimary: createWithPrimary,
|
|
340
|
-
zoomWithPrimary: zoomWithPrimary,
|
|
341
|
-
onBeginMovePoint: onBeginMovePoint,
|
|
342
|
-
onSelectRegion: onSelectRegion,
|
|
343
|
-
layoutParams: layoutParams,
|
|
344
|
-
mat: mat,
|
|
345
|
-
onBeginBoxTransform: onBeginBoxTransform,
|
|
346
|
-
onBeginMovePolygonPoint: onBeginMovePolygonPoint,
|
|
347
|
-
onBeginMoveKeypoint: onBeginMoveKeypoint,
|
|
348
|
-
onAddPolygonPoint: onAddPolygonPoint,
|
|
349
|
-
showHighlightBox: showHighlightBox
|
|
350
|
-
}), imageLoaded && showTags && !dragging && React.createElement(PreventScrollToParents, {
|
|
351
|
-
key: "regionTags"
|
|
352
|
-
}, React.createElement(RegionTags, {
|
|
353
|
-
regions: regions,
|
|
354
|
-
projectRegionBox: projectRegionBox,
|
|
355
|
-
mouseEvents: mouseEvents,
|
|
356
|
-
regionClsList: regionClsList,
|
|
357
|
-
regionTagList: regionTagList,
|
|
358
|
-
onBeginRegionEdit: onBeginRegionEdit,
|
|
359
|
-
onChangeRegion: onChangeRegion,
|
|
360
|
-
onCloseRegionEdit: onCloseRegionEdit,
|
|
361
|
-
onDeleteRegion: onDeleteRegion,
|
|
362
|
-
onDeleteGroup: onDeleteGroup,
|
|
363
|
-
layoutParams: layoutParams,
|
|
364
|
-
imageSrc: imageSrc,
|
|
365
|
-
RegionEditLabel: RegionEditLabel,
|
|
366
|
-
onRegionClassAdded: onRegionClassAdded,
|
|
367
|
-
allowComments: allowComments,
|
|
368
|
-
hideNotEditingLabel: hideNotEditingLabel,
|
|
369
|
-
allowedGroups: allowedGroups
|
|
370
|
-
})), !showTags && highlightedRegion && React.createElement("div", {
|
|
371
|
-
key: "topLeftTag",
|
|
372
|
-
className: classes.fixedRegionLabel
|
|
373
|
-
}, React.createElement(RegionLabel, {
|
|
374
|
-
disableClose: true,
|
|
375
|
-
allowedClasses: regionClsList,
|
|
376
|
-
allowedTags: regionTagList,
|
|
377
|
-
onChange: onChangeRegion,
|
|
378
|
-
onDelete: onDeleteRegion,
|
|
379
|
-
onDeleteGroup: onDeleteGroup,
|
|
380
|
-
editing: true,
|
|
381
|
-
region: highlightedRegion,
|
|
382
|
-
imageSrc: imageSrc,
|
|
383
|
-
allowComments: allowComments
|
|
384
|
-
})), zoomWithPrimary && zoomBox !== null && React.createElement("div", {
|
|
385
|
-
key: "zoomBox",
|
|
386
|
-
style: {
|
|
387
|
-
position: "absolute",
|
|
388
|
-
zIndex: 1,
|
|
389
|
-
border: "1px solid #fff",
|
|
390
|
-
pointerEvents: "none",
|
|
391
|
-
left: zoomBox.x,
|
|
392
|
-
top: zoomBox.y,
|
|
393
|
-
width: zoomBox.w,
|
|
394
|
-
height: zoomBox.h
|
|
395
|
-
}
|
|
396
|
-
}), showPointDistances && React.createElement(PointDistances, {
|
|
397
|
-
key: "pointDistances",
|
|
398
|
-
regions: regions,
|
|
399
|
-
realSize: realSize,
|
|
400
|
-
projectRegionBox: projectRegionBox,
|
|
401
|
-
pointDistancePrecision: pointDistancePrecision
|
|
402
|
-
}), React.createElement(PreventScrollToParents, Object.assign({
|
|
403
|
-
style: {
|
|
404
|
-
width: "100%",
|
|
405
|
-
height: "100%"
|
|
406
|
-
}
|
|
407
|
-
}, mouseEvents), React.createElement(React.Fragment, null, fullImageSegmentationMode && React.createElement(ImageMask, {
|
|
408
|
-
hide: !showMask,
|
|
409
|
-
autoSegmentationOptions: autoSegmentationOptions,
|
|
410
|
-
imagePosition: imagePosition,
|
|
411
|
-
regionClsList: regionClsList,
|
|
412
|
-
imageSrc: imageSrc,
|
|
413
|
-
regions: regions
|
|
414
|
-
}), React.createElement("canvas", {
|
|
415
|
-
style: {
|
|
416
|
-
opacity: 0.25
|
|
309
|
+
return (
|
|
310
|
+
/*#__PURE__*/
|
|
311
|
+
React.createElement(ThemeProvider, {
|
|
312
|
+
theme: theme
|
|
417
313
|
},
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
314
|
+
/*#__PURE__*/
|
|
315
|
+
React.createElement("div", {
|
|
316
|
+
style: {
|
|
317
|
+
width: "100%",
|
|
318
|
+
height: "100vh",
|
|
319
|
+
position: "relative",
|
|
320
|
+
overflow: "hidden",
|
|
321
|
+
cursor: createWithPrimary ? "crosshair" : dragging ? "grabbing" : dragWithPrimary ? "grab" : zoomWithPrimary ? mat.a < 1 ? "zoom-out" : "zoom-in" : undefined
|
|
322
|
+
}
|
|
323
|
+
}, showCrosshairs &&
|
|
324
|
+
/*#__PURE__*/
|
|
325
|
+
React.createElement(Crosshairs, {
|
|
326
|
+
key: "crossHairs",
|
|
327
|
+
mousePosition: mousePosition
|
|
328
|
+
}), imageLoaded && !dragging &&
|
|
329
|
+
/*#__PURE__*/
|
|
330
|
+
React.createElement(RegionSelectAndTransformBoxes, {
|
|
331
|
+
key: "regionSelectAndTransformBoxes",
|
|
332
|
+
regions: !modifyingAllowedArea || !allowedArea ? regions : [{
|
|
333
|
+
type: "box",
|
|
334
|
+
id: "$$allowed_area",
|
|
335
|
+
cls: "allowed_area",
|
|
336
|
+
highlighted: true,
|
|
337
|
+
x: allowedArea.x,
|
|
338
|
+
y: allowedArea.y,
|
|
339
|
+
w: allowedArea.w,
|
|
340
|
+
h: allowedArea.h,
|
|
341
|
+
visible: true,
|
|
342
|
+
color: "#ff0"
|
|
343
|
+
}],
|
|
344
|
+
mouseEvents: mouseEvents,
|
|
345
|
+
projectRegionBox: projectRegionBox,
|
|
346
|
+
dragWithPrimary: dragWithPrimary,
|
|
347
|
+
createWithPrimary: createWithPrimary,
|
|
348
|
+
zoomWithPrimary: zoomWithPrimary,
|
|
349
|
+
onBeginMovePoint: onBeginMovePoint,
|
|
350
|
+
onSelectRegion: onSelectRegion,
|
|
351
|
+
layoutParams: layoutParams,
|
|
352
|
+
mat: mat,
|
|
353
|
+
onBeginBoxTransform: onBeginBoxTransform,
|
|
354
|
+
onBeginMovePolygonPoint: onBeginMovePolygonPoint,
|
|
355
|
+
onBeginMoveKeypoint: onBeginMoveKeypoint,
|
|
356
|
+
onAddPolygonPoint: onAddPolygonPoint,
|
|
357
|
+
showHighlightBox: showHighlightBox
|
|
358
|
+
}), imageLoaded && showTags && !dragging &&
|
|
359
|
+
/*#__PURE__*/
|
|
360
|
+
React.createElement(PreventScrollToParents, {
|
|
361
|
+
key: "regionTags"
|
|
362
|
+
},
|
|
363
|
+
/*#__PURE__*/
|
|
364
|
+
React.createElement(RegionTags, {
|
|
365
|
+
regions: regions,
|
|
366
|
+
projectRegionBox: projectRegionBox,
|
|
367
|
+
mouseEvents: mouseEvents,
|
|
368
|
+
regionClsList: regionClsList,
|
|
369
|
+
regionTagList: regionTagList,
|
|
370
|
+
onBeginRegionEdit: onBeginRegionEdit,
|
|
371
|
+
onChangeRegion: onChangeRegion,
|
|
372
|
+
onCloseRegionEdit: onCloseRegionEdit,
|
|
373
|
+
onDeleteRegion: onDeleteRegion,
|
|
374
|
+
onDeleteGroup: onDeleteGroup,
|
|
375
|
+
layoutParams: layoutParams,
|
|
376
|
+
imageSrc: imageSrc,
|
|
377
|
+
RegionEditLabel: RegionEditLabel,
|
|
378
|
+
onRegionClassAdded: onRegionClassAdded,
|
|
379
|
+
allowComments: allowComments,
|
|
380
|
+
hideNotEditingLabel: hideNotEditingLabel,
|
|
381
|
+
allowedGroups: allowedGroups
|
|
382
|
+
})), !showTags && highlightedRegion &&
|
|
383
|
+
/*#__PURE__*/
|
|
384
|
+
React.createElement("div", {
|
|
385
|
+
key: "topLeftTag",
|
|
386
|
+
className: classes.fixedRegionLabel
|
|
387
|
+
},
|
|
388
|
+
/*#__PURE__*/
|
|
389
|
+
React.createElement(RegionLabel, {
|
|
390
|
+
disableClose: true,
|
|
391
|
+
allowedClasses: regionClsList,
|
|
392
|
+
allowedTags: regionTagList,
|
|
393
|
+
onChange: onChangeRegion,
|
|
394
|
+
onDelete: onDeleteRegion,
|
|
395
|
+
onDeleteGroup: onDeleteGroup,
|
|
396
|
+
editing: true,
|
|
397
|
+
region: highlightedRegion,
|
|
398
|
+
imageSrc: imageSrc,
|
|
399
|
+
allowComments: allowComments
|
|
400
|
+
})), zoomWithPrimary && zoomBox !== null &&
|
|
401
|
+
/*#__PURE__*/
|
|
402
|
+
React.createElement("div", {
|
|
403
|
+
key: "zoomBox",
|
|
404
|
+
style: {
|
|
405
|
+
position: "absolute",
|
|
406
|
+
zIndex: 1,
|
|
407
|
+
border: "1px solid #fff",
|
|
408
|
+
pointerEvents: "none",
|
|
409
|
+
left: zoomBox.x,
|
|
410
|
+
top: zoomBox.y,
|
|
411
|
+
width: zoomBox.w,
|
|
412
|
+
height: zoomBox.h
|
|
413
|
+
}
|
|
414
|
+
}), showPointDistances &&
|
|
415
|
+
/*#__PURE__*/
|
|
416
|
+
React.createElement(PointDistances, {
|
|
417
|
+
key: "pointDistances",
|
|
418
|
+
regions: regions,
|
|
419
|
+
realSize: realSize,
|
|
420
|
+
projectRegionBox: projectRegionBox,
|
|
421
|
+
pointDistancePrecision: pointDistancePrecision
|
|
422
|
+
}),
|
|
423
|
+
/*#__PURE__*/
|
|
424
|
+
React.createElement(PreventScrollToParents, Object.assign({
|
|
425
|
+
style: {
|
|
426
|
+
width: "100%",
|
|
427
|
+
height: "100%"
|
|
428
|
+
}
|
|
429
|
+
}, mouseEvents),
|
|
430
|
+
/*#__PURE__*/
|
|
431
|
+
React.createElement(React.Fragment, null, fullImageSegmentationMode &&
|
|
432
|
+
/*#__PURE__*/
|
|
433
|
+
React.createElement(ImageMask, {
|
|
434
|
+
hide: !showMask,
|
|
435
|
+
autoSegmentationOptions: autoSegmentationOptions,
|
|
436
|
+
imagePosition: imagePosition,
|
|
437
|
+
regionClsList: regionClsList,
|
|
438
|
+
imageSrc: imageSrc,
|
|
439
|
+
regions: regions
|
|
440
|
+
}),
|
|
441
|
+
/*#__PURE__*/
|
|
442
|
+
React.createElement("canvas", {
|
|
443
|
+
style: {
|
|
444
|
+
opacity: 0.25
|
|
445
|
+
},
|
|
446
|
+
className: classes.canvas,
|
|
447
|
+
ref: canvasEl
|
|
448
|
+
}),
|
|
449
|
+
/*#__PURE__*/
|
|
450
|
+
React.createElement(RegionShapes, {
|
|
451
|
+
mat: mat,
|
|
452
|
+
keypointDefinitions: keypointDefinitions,
|
|
453
|
+
imagePosition: imagePosition,
|
|
454
|
+
regions: regions,
|
|
455
|
+
fullSegmentationMode: fullImageSegmentationMode
|
|
456
|
+
}),
|
|
457
|
+
/*#__PURE__*/
|
|
458
|
+
React.createElement(VideoOrImageCanvasBackground, {
|
|
459
|
+
videoPlaying: videoPlaying,
|
|
460
|
+
imagePosition: imagePosition,
|
|
461
|
+
mouseEvents: mouseEvents,
|
|
462
|
+
onLoad: onVideoOrImageLoaded,
|
|
463
|
+
videoTime: videoTime,
|
|
464
|
+
videoSrc: videoSrc,
|
|
465
|
+
imageSrc: imageSrc,
|
|
466
|
+
useCrossOrigin: fullImageSegmentationMode,
|
|
467
|
+
onChangeVideoTime: onChangeVideoTime,
|
|
468
|
+
onChangeVideoPlaying: onChangeVideoPlaying
|
|
469
|
+
}))),
|
|
470
|
+
/*#__PURE__*/
|
|
471
|
+
React.createElement("div", {
|
|
472
|
+
className: classes.zoomIndicator
|
|
473
|
+
}, (1 / mat.a * 100).toFixed(0), "%")))
|
|
474
|
+
);
|
|
440
475
|
};
|
|
441
476
|
export default ImageCanvas;
|
package/ImageMask/index.js
CHANGED
|
@@ -123,11 +123,14 @@ export var ImageMask = function ImageMask(_ref3) {
|
|
|
123
123
|
pointerEvents: "none"
|
|
124
124
|
};
|
|
125
125
|
}, [imagePosition.topLeft.x, imagePosition.topLeft.y, imagePosition.bottomRight.x, imagePosition.bottomRight.y, zIndex, hide]);
|
|
126
|
-
return
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
return (
|
|
127
|
+
/*#__PURE__*/
|
|
128
|
+
React.createElement("canvas", {
|
|
129
|
+
style: style,
|
|
130
|
+
width: sampleImageData ? sampleImageData.width : 0,
|
|
131
|
+
height: sampleImageData ? sampleImageData.height : 0,
|
|
132
|
+
ref: setCanvasRef
|
|
133
|
+
})
|
|
134
|
+
);
|
|
132
135
|
};
|
|
133
136
|
export default ImageMask;
|