@searpent/react-image-annotate 2.3.4 → 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 +28 -28
- package/Annotator/examplePhotos_repr.js +28 -28
- package/Annotator/index.js +38 -31
- 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
|
@@ -36,16 +36,23 @@ var Chip = function Chip(_ref2) {
|
|
|
36
36
|
var color = _ref2.color,
|
|
37
37
|
text = _ref2.text;
|
|
38
38
|
var classes = useStyles();
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
return (
|
|
40
|
+
/*#__PURE__*/
|
|
41
|
+
React.createElement("span", {
|
|
42
|
+
className: classes.chip
|
|
43
|
+
},
|
|
44
|
+
/*#__PURE__*/
|
|
45
|
+
React.createElement("div", {
|
|
46
|
+
className: "color",
|
|
47
|
+
style: {
|
|
48
|
+
backgroundColor: color
|
|
49
|
+
}
|
|
50
|
+
}),
|
|
51
|
+
/*#__PURE__*/
|
|
52
|
+
React.createElement("div", {
|
|
53
|
+
className: "text"
|
|
54
|
+
}, text))
|
|
55
|
+
);
|
|
49
56
|
};
|
|
50
57
|
|
|
51
58
|
var RowLayout = function RowLayout(_ref3) {
|
|
@@ -66,77 +73,113 @@ var RowLayout = function RowLayout(_ref3) {
|
|
|
66
73
|
mouseOver = _useState2[0],
|
|
67
74
|
changeMouseOver = _useState2[1];
|
|
68
75
|
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
return (
|
|
77
|
+
/*#__PURE__*/
|
|
78
|
+
React.createElement("div", {
|
|
79
|
+
onClick: onClick,
|
|
80
|
+
onMouseEnter: function onMouseEnter() {
|
|
81
|
+
return changeMouseOver(true);
|
|
82
|
+
},
|
|
83
|
+
onMouseLeave: function onMouseLeave() {
|
|
84
|
+
return changeMouseOver(false);
|
|
85
|
+
},
|
|
86
|
+
className: classnames(classes.row, {
|
|
87
|
+
header: header,
|
|
88
|
+
highlighted: highlighted
|
|
89
|
+
})
|
|
73
90
|
},
|
|
74
|
-
|
|
75
|
-
|
|
91
|
+
/*#__PURE__*/
|
|
92
|
+
React.createElement(Grid, {
|
|
93
|
+
container: true,
|
|
94
|
+
alignItems: "center"
|
|
76
95
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
96
|
+
/*#__PURE__*/
|
|
97
|
+
React.createElement(Grid, {
|
|
98
|
+
item: true,
|
|
99
|
+
xs: 2
|
|
100
|
+
},
|
|
101
|
+
/*#__PURE__*/
|
|
102
|
+
React.createElement("div", {
|
|
103
|
+
style: {
|
|
104
|
+
textAlign: "right",
|
|
105
|
+
paddingRight: 10
|
|
106
|
+
}
|
|
107
|
+
}, order)),
|
|
108
|
+
/*#__PURE__*/
|
|
109
|
+
React.createElement(Grid, {
|
|
110
|
+
item: true,
|
|
111
|
+
xs: 5
|
|
112
|
+
}, classification),
|
|
113
|
+
/*#__PURE__*/
|
|
114
|
+
React.createElement(Grid, {
|
|
115
|
+
item: true,
|
|
116
|
+
xs: 2
|
|
117
|
+
},
|
|
118
|
+
/*#__PURE__*/
|
|
119
|
+
React.createElement("div", {
|
|
120
|
+
style: {
|
|
121
|
+
textAlign: "right",
|
|
122
|
+
paddingRight: 6
|
|
123
|
+
}
|
|
124
|
+
}, area)),
|
|
125
|
+
/*#__PURE__*/
|
|
126
|
+
React.createElement(Grid, {
|
|
127
|
+
item: true,
|
|
128
|
+
xs: 1
|
|
129
|
+
}, trash),
|
|
130
|
+
/*#__PURE__*/
|
|
131
|
+
React.createElement(Grid, {
|
|
132
|
+
item: true,
|
|
133
|
+
xs: 1
|
|
134
|
+
}, lock),
|
|
135
|
+
/*#__PURE__*/
|
|
136
|
+
React.createElement(Grid, {
|
|
137
|
+
item: true,
|
|
138
|
+
xs: 1
|
|
139
|
+
}, visible)))
|
|
140
|
+
);
|
|
113
141
|
};
|
|
114
142
|
|
|
115
143
|
var RowHeader = function RowHeader() {
|
|
116
|
-
return
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
144
|
+
return (
|
|
145
|
+
/*#__PURE__*/
|
|
146
|
+
React.createElement(RowLayout, {
|
|
147
|
+
header: true,
|
|
148
|
+
highlighted: false,
|
|
149
|
+
order:
|
|
150
|
+
/*#__PURE__*/
|
|
151
|
+
React.createElement(ReorderIcon, {
|
|
152
|
+
className: "icon"
|
|
153
|
+
}),
|
|
154
|
+
classification:
|
|
155
|
+
/*#__PURE__*/
|
|
156
|
+
React.createElement("div", {
|
|
157
|
+
style: {
|
|
158
|
+
paddingLeft: 10
|
|
159
|
+
}
|
|
160
|
+
}, "Class"),
|
|
161
|
+
area:
|
|
162
|
+
/*#__PURE__*/
|
|
163
|
+
React.createElement(PieChartIcon, {
|
|
164
|
+
className: "icon"
|
|
165
|
+
}),
|
|
166
|
+
trash:
|
|
167
|
+
/*#__PURE__*/
|
|
168
|
+
React.createElement(TrashIcon, {
|
|
169
|
+
className: "icon"
|
|
170
|
+
}),
|
|
171
|
+
lock:
|
|
172
|
+
/*#__PURE__*/
|
|
173
|
+
React.createElement(LockIcon, {
|
|
174
|
+
className: "icon"
|
|
175
|
+
}),
|
|
176
|
+
visible:
|
|
177
|
+
/*#__PURE__*/
|
|
178
|
+
React.createElement(VisibleIcon, {
|
|
179
|
+
className: "icon"
|
|
180
|
+
})
|
|
138
181
|
})
|
|
139
|
-
|
|
182
|
+
);
|
|
140
183
|
};
|
|
141
184
|
|
|
142
185
|
var MemoRowHeader = memo(RowHeader);
|
|
@@ -157,55 +200,70 @@ var Row = function Row(_ref4) {
|
|
|
157
200
|
groupColor = _useColors.groupColor;
|
|
158
201
|
|
|
159
202
|
var gc = groupColor(r.groupId);
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
order: "#".concat(index + 1),
|
|
167
|
-
classification: React.createElement(Chip, {
|
|
168
|
-
text: cls || "",
|
|
169
|
-
color: color || gc || "lime"
|
|
170
|
-
}),
|
|
171
|
-
area: "",
|
|
172
|
-
trash: React.createElement(TrashIcon, {
|
|
173
|
-
onClick: function onClick() {
|
|
174
|
-
return onDeleteRegion(r);
|
|
175
|
-
},
|
|
176
|
-
className: "icon2"
|
|
177
|
-
}),
|
|
178
|
-
lock: r.locked ? React.createElement(LockIcon, {
|
|
179
|
-
onClick: function onClick() {
|
|
180
|
-
return onChangeRegion(_objectSpread({}, r, {
|
|
181
|
-
locked: false
|
|
182
|
-
}));
|
|
183
|
-
},
|
|
184
|
-
className: "icon2"
|
|
185
|
-
}) : React.createElement(UnlockIcon, {
|
|
186
|
-
onClick: function onClick() {
|
|
187
|
-
return onChangeRegion(_objectSpread({}, r, {
|
|
188
|
-
locked: true
|
|
189
|
-
}));
|
|
190
|
-
},
|
|
191
|
-
className: "icon2"
|
|
192
|
-
}),
|
|
193
|
-
visible: r.visible || r.visible === undefined ? React.createElement(VisibleIcon, {
|
|
203
|
+
return (
|
|
204
|
+
/*#__PURE__*/
|
|
205
|
+
React.createElement(RowLayout, {
|
|
206
|
+
header: false,
|
|
207
|
+
highlighted: highlighted,
|
|
194
208
|
onClick: function onClick() {
|
|
195
|
-
return
|
|
196
|
-
visible: false
|
|
197
|
-
}));
|
|
209
|
+
return onSelectRegion(r);
|
|
198
210
|
},
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
|
|
211
|
+
order: "#".concat(index + 1),
|
|
212
|
+
classification:
|
|
213
|
+
/*#__PURE__*/
|
|
214
|
+
React.createElement(Chip, {
|
|
215
|
+
text: cls || "",
|
|
216
|
+
color: color || gc || "lime"
|
|
217
|
+
}),
|
|
218
|
+
area: "",
|
|
219
|
+
trash:
|
|
220
|
+
/*#__PURE__*/
|
|
221
|
+
React.createElement(TrashIcon, {
|
|
222
|
+
onClick: function onClick() {
|
|
223
|
+
return onDeleteRegion(r);
|
|
224
|
+
},
|
|
225
|
+
className: "icon2"
|
|
226
|
+
}),
|
|
227
|
+
lock: r.locked ?
|
|
228
|
+
/*#__PURE__*/
|
|
229
|
+
React.createElement(LockIcon, {
|
|
230
|
+
onClick: function onClick() {
|
|
231
|
+
return onChangeRegion(_objectSpread({}, r, {
|
|
232
|
+
locked: false
|
|
233
|
+
}));
|
|
234
|
+
},
|
|
235
|
+
className: "icon2"
|
|
236
|
+
}) :
|
|
237
|
+
/*#__PURE__*/
|
|
238
|
+
React.createElement(UnlockIcon, {
|
|
239
|
+
onClick: function onClick() {
|
|
240
|
+
return onChangeRegion(_objectSpread({}, r, {
|
|
241
|
+
locked: true
|
|
242
|
+
}));
|
|
243
|
+
},
|
|
244
|
+
className: "icon2"
|
|
245
|
+
}),
|
|
246
|
+
visible: r.visible || r.visible === undefined ?
|
|
247
|
+
/*#__PURE__*/
|
|
248
|
+
React.createElement(VisibleIcon, {
|
|
249
|
+
onClick: function onClick() {
|
|
250
|
+
return onChangeRegion(_objectSpread({}, r, {
|
|
251
|
+
visible: false
|
|
252
|
+
}));
|
|
253
|
+
},
|
|
254
|
+
className: "icon2"
|
|
255
|
+
}) :
|
|
256
|
+
/*#__PURE__*/
|
|
257
|
+
React.createElement(VisibleOffIcon, {
|
|
258
|
+
onClick: function onClick() {
|
|
259
|
+
return onChangeRegion(_objectSpread({}, r, {
|
|
260
|
+
visible: true
|
|
261
|
+
}));
|
|
262
|
+
},
|
|
263
|
+
className: "icon2"
|
|
264
|
+
})
|
|
207
265
|
})
|
|
208
|
-
|
|
266
|
+
);
|
|
209
267
|
};
|
|
210
268
|
|
|
211
269
|
var MemoRow = memo(Row, function (prevProps, nextProps) {
|
|
@@ -220,54 +278,74 @@ export var RegionSelectorSidebarBox = function RegionSelectorSidebarBox(_ref5) {
|
|
|
220
278
|
onChangeRegion = _ref5.onChangeRegion,
|
|
221
279
|
onSelectRegion = _ref5.onSelectRegion;
|
|
222
280
|
var classes = useStyles();
|
|
223
|
-
return
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
281
|
+
return (
|
|
282
|
+
/*#__PURE__*/
|
|
283
|
+
React.createElement(ThemeProvider, {
|
|
284
|
+
theme: theme
|
|
285
|
+
},
|
|
286
|
+
/*#__PURE__*/
|
|
287
|
+
React.createElement(SidebarBoxContainer, {
|
|
288
|
+
title: "Regions",
|
|
289
|
+
subTitle: "",
|
|
290
|
+
icon:
|
|
291
|
+
/*#__PURE__*/
|
|
292
|
+
React.createElement(RegionIcon, {
|
|
293
|
+
style: {
|
|
294
|
+
color: grey[700]
|
|
295
|
+
}
|
|
296
|
+
}),
|
|
297
|
+
expandedByDefault: true
|
|
298
|
+
},
|
|
299
|
+
/*#__PURE__*/
|
|
300
|
+
React.createElement("div", {
|
|
301
|
+
className: classes.container
|
|
302
|
+
}, regions.length > 0 && onDeleteAllRegions &&
|
|
303
|
+
/*#__PURE__*/
|
|
304
|
+
React.createElement("div", {
|
|
229
305
|
style: {
|
|
230
|
-
|
|
306
|
+
display: "flex",
|
|
307
|
+
justifyContent: "flex-end",
|
|
308
|
+
marginBottom: 4
|
|
231
309
|
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
display: "flex",
|
|
239
|
-
justifyContent: "flex-end",
|
|
240
|
-
marginBottom: 4
|
|
241
|
-
}
|
|
242
|
-
}, React.createElement("button", {
|
|
243
|
-
type: "button",
|
|
244
|
-
onClick: function onClick(e) {
|
|
245
|
-
e.stopPropagation();
|
|
310
|
+
},
|
|
311
|
+
/*#__PURE__*/
|
|
312
|
+
React.createElement("button", {
|
|
313
|
+
type: "button",
|
|
314
|
+
onClick: function onClick(e) {
|
|
315
|
+
e.stopPropagation();
|
|
246
316
|
|
|
247
|
-
|
|
248
|
-
|
|
317
|
+
if (window.confirm("Are you really sure you want to delete all frames on this page? This will remove all non-metadata regions.")) {
|
|
318
|
+
onDeleteAllRegions();
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
style: {
|
|
322
|
+
fontSize: 12,
|
|
323
|
+
color: "#d32f2f",
|
|
324
|
+
background: "none",
|
|
325
|
+
border: "none",
|
|
326
|
+
cursor: "pointer",
|
|
327
|
+
padding: 0,
|
|
328
|
+
textDecoration: "underline"
|
|
249
329
|
}
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}));
|
|
270
|
-
}))));
|
|
330
|
+
}, "Delete all frames")),
|
|
331
|
+
/*#__PURE__*/
|
|
332
|
+
React.createElement(MemoRowHeader, null),
|
|
333
|
+
/*#__PURE__*/
|
|
334
|
+
React.createElement(HeaderSep, null), regions.map(function (r, i) {
|
|
335
|
+
return (
|
|
336
|
+
/*#__PURE__*/
|
|
337
|
+
React.createElement(MemoRow, Object.assign({
|
|
338
|
+
key: r.id
|
|
339
|
+
}, r, {
|
|
340
|
+
region: r,
|
|
341
|
+
index: i,
|
|
342
|
+
onSelectRegion: onSelectRegion,
|
|
343
|
+
onDeleteRegion: onDeleteRegion,
|
|
344
|
+
onChangeRegion: onChangeRegion
|
|
345
|
+
}))
|
|
346
|
+
);
|
|
347
|
+
}))))
|
|
348
|
+
);
|
|
271
349
|
};
|
|
272
350
|
|
|
273
351
|
var mapUsedRegionProperties = function mapUsedRegionProperties(r) {
|