@searpent/react-image-annotate 2.3.4 → 2.3.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 +28 -28
- package/Annotator/examplePhotos_repr.js +28 -28
- package/Annotator/index.js +40 -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 +258 -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 +95 -0
- package/PageSelector/index.js +181 -97
- package/PageSelector/page-selector.css +118 -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
package/RegionShapes/index.js
CHANGED
|
@@ -12,30 +12,40 @@ var RegionComponents = {
|
|
|
12
12
|
var region = _ref.region,
|
|
13
13
|
iw = _ref.iw,
|
|
14
14
|
ih = _ref.ih;
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
return (
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
React.createElement("g", {
|
|
18
|
+
transform: "translate(".concat(region.x * iw, " ").concat(region.y * ih, ")")
|
|
19
|
+
},
|
|
20
|
+
/*#__PURE__*/
|
|
21
|
+
React.createElement("path", {
|
|
22
|
+
d: "M0 8L8 0L0 -8L-8 0Z",
|
|
23
|
+
strokeWidth: 2,
|
|
24
|
+
stroke: region.color,
|
|
25
|
+
fill: "transparent"
|
|
26
|
+
}))
|
|
27
|
+
);
|
|
23
28
|
}),
|
|
24
29
|
line: memo(function (_ref2) {
|
|
25
30
|
var region = _ref2.region,
|
|
26
31
|
iw = _ref2.iw,
|
|
27
32
|
ih = _ref2.ih;
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
return (
|
|
34
|
+
/*#__PURE__*/
|
|
35
|
+
React.createElement("g", {
|
|
36
|
+
transform: "translate(".concat(region.x1 * iw, " ").concat(region.y1 * ih, ")")
|
|
37
|
+
},
|
|
38
|
+
/*#__PURE__*/
|
|
39
|
+
React.createElement("line", {
|
|
40
|
+
strokeWidth: 2,
|
|
41
|
+
x1: 0,
|
|
42
|
+
y1: 0,
|
|
43
|
+
x2: (region.x2 - region.x1) * iw,
|
|
44
|
+
y2: (region.y2 - region.y1) * ih,
|
|
45
|
+
stroke: colorAlpha(region.color, 0.75),
|
|
46
|
+
fill: colorAlpha(region.color, 0.25)
|
|
47
|
+
}))
|
|
48
|
+
);
|
|
39
49
|
}),
|
|
40
50
|
box: memo(function (_ref3) {
|
|
41
51
|
var region = _ref3.region,
|
|
@@ -47,29 +57,39 @@ var RegionComponents = {
|
|
|
47
57
|
groupColor = _useColors.groupColor;
|
|
48
58
|
|
|
49
59
|
if (region.groupId !== undefined) {
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
return (
|
|
61
|
+
/*#__PURE__*/
|
|
62
|
+
React.createElement("g", {
|
|
63
|
+
transform: "translate(".concat(region.x * iw, " ").concat(region.y * ih, ")")
|
|
64
|
+
},
|
|
65
|
+
/*#__PURE__*/
|
|
66
|
+
React.createElement("rect", {
|
|
67
|
+
strokeWidth: region.groupHighlighted ? 3 : 0,
|
|
68
|
+
x: 0,
|
|
69
|
+
y: 0,
|
|
70
|
+
width: Math.max(region.w * iw, 0),
|
|
71
|
+
height: Math.max(region.h * ih, 0),
|
|
72
|
+
stroke: colorAlpha(clsColor(region.cls), 0.85),
|
|
73
|
+
fill: region.groupHighlighted ? colorAlpha(clsColor(region.cls), 0.15) : colorAlpha(groupColor(region.groupId), 0.5)
|
|
74
|
+
}))
|
|
75
|
+
);
|
|
61
76
|
} else {
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
return (
|
|
78
|
+
/*#__PURE__*/
|
|
79
|
+
React.createElement("g", {
|
|
80
|
+
transform: "translate(".concat(region.x * iw, " ").concat(region.y * ih, ")")
|
|
81
|
+
},
|
|
82
|
+
/*#__PURE__*/
|
|
83
|
+
React.createElement("rect", {
|
|
84
|
+
strokeWidth: 2,
|
|
85
|
+
x: 0,
|
|
86
|
+
y: 0,
|
|
87
|
+
width: Math.max(region.w * iw, 0),
|
|
88
|
+
height: Math.max(region.h * ih, 0),
|
|
89
|
+
stroke: colorAlpha(clsColor(region.cls), 0.85),
|
|
90
|
+
fill: colorAlpha(clsColor(region.cls), 0.85)
|
|
91
|
+
}))
|
|
92
|
+
);
|
|
73
93
|
}
|
|
74
94
|
}),
|
|
75
95
|
polygon: memo(function (_ref4) {
|
|
@@ -79,20 +99,23 @@ var RegionComponents = {
|
|
|
79
99
|
fullSegmentationMode = _ref4.fullSegmentationMode;
|
|
80
100
|
var Component = region.open ? "polyline" : "polygon";
|
|
81
101
|
var alphaBase = fullSegmentationMode ? 0.5 : 1;
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
102
|
+
return (
|
|
103
|
+
/*#__PURE__*/
|
|
104
|
+
React.createElement(Component, {
|
|
105
|
+
points: region.points.map(function (_ref5) {
|
|
106
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
107
|
+
x = _ref6[0],
|
|
108
|
+
y = _ref6[1];
|
|
87
109
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
return [x * iw, y * ih];
|
|
111
|
+
}).map(function (a) {
|
|
112
|
+
return a.join(" ");
|
|
113
|
+
}).join(" "),
|
|
114
|
+
strokeWidth: 2,
|
|
115
|
+
stroke: colorAlpha(region.color, 0.75),
|
|
116
|
+
fill: colorAlpha(region.color, 0.25)
|
|
117
|
+
})
|
|
118
|
+
);
|
|
96
119
|
}),
|
|
97
120
|
keypoints: function keypoints(_ref7) {
|
|
98
121
|
var region = _ref7.region,
|
|
@@ -109,51 +132,66 @@ var RegionComponents = {
|
|
|
109
132
|
var _keypointDefinitions$ = keypointDefinitions[keypointsDefinitionId],
|
|
110
133
|
landmarks = _keypointDefinitions$.landmarks,
|
|
111
134
|
connections = _keypointDefinitions$.connections;
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
135
|
+
return (
|
|
136
|
+
/*#__PURE__*/
|
|
137
|
+
React.createElement("g", null, Object.entries(points).map(function (_ref8, i) {
|
|
138
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
139
|
+
keypointId = _ref9[0],
|
|
140
|
+
_ref9$ = _ref9[1],
|
|
141
|
+
x = _ref9$.x,
|
|
142
|
+
y = _ref9$.y;
|
|
118
143
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
144
|
+
return (
|
|
145
|
+
/*#__PURE__*/
|
|
146
|
+
React.createElement("g", {
|
|
147
|
+
key: i,
|
|
148
|
+
transform: "translate(".concat(x * iw, " ").concat(y * ih, ")")
|
|
149
|
+
},
|
|
150
|
+
/*#__PURE__*/
|
|
151
|
+
React.createElement("path", {
|
|
152
|
+
d: "M0 8L8 0L0 -8L-8 0Z",
|
|
153
|
+
strokeWidth: 2,
|
|
154
|
+
stroke: landmarks[keypointId].color,
|
|
155
|
+
fill: "transparent"
|
|
156
|
+
}))
|
|
157
|
+
);
|
|
158
|
+
}), connections.map(function (_ref10) {
|
|
159
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
160
|
+
kp1Id = _ref11[0],
|
|
161
|
+
kp2Id = _ref11[1];
|
|
132
162
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
163
|
+
var kp1 = points[kp1Id];
|
|
164
|
+
var kp2 = points[kp2Id];
|
|
165
|
+
var midPoint = {
|
|
166
|
+
x: (kp1.x + kp2.x) / 2,
|
|
167
|
+
y: (kp1.y + kp2.y) / 2
|
|
168
|
+
};
|
|
169
|
+
return (
|
|
170
|
+
/*#__PURE__*/
|
|
171
|
+
React.createElement("g", {
|
|
172
|
+
key: "".concat(kp1.x, ",").concat(kp1.y, ".").concat(kp2.x, ",").concat(kp2.y)
|
|
173
|
+
},
|
|
174
|
+
/*#__PURE__*/
|
|
175
|
+
React.createElement("line", {
|
|
176
|
+
x1: kp1.x * iw,
|
|
177
|
+
y1: kp1.y * ih,
|
|
178
|
+
x2: midPoint.x * iw,
|
|
179
|
+
y2: midPoint.y * ih,
|
|
180
|
+
strokeWidth: 2,
|
|
181
|
+
stroke: landmarks[kp1Id].color
|
|
182
|
+
}),
|
|
183
|
+
/*#__PURE__*/
|
|
184
|
+
React.createElement("line", {
|
|
185
|
+
x1: kp2.x * iw,
|
|
186
|
+
y1: kp2.y * ih,
|
|
187
|
+
x2: midPoint.x * iw,
|
|
188
|
+
y2: midPoint.y * ih,
|
|
189
|
+
strokeWidth: 2,
|
|
190
|
+
stroke: landmarks[kp2Id].color
|
|
191
|
+
}))
|
|
192
|
+
);
|
|
193
|
+
}))
|
|
194
|
+
);
|
|
157
195
|
},
|
|
158
196
|
"expanding-line": memo(function (_ref12) {
|
|
159
197
|
var region = _ref12.region,
|
|
@@ -201,38 +239,52 @@ var RegionComponents = {
|
|
|
201
239
|
}).asMutable();
|
|
202
240
|
secondSection.reverse();
|
|
203
241
|
var lastPoint = points.slice(-1)[0];
|
|
204
|
-
return
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
var x = _ref18.x,
|
|
213
|
-
y = _ref18.y,
|
|
214
|
-
angle = _ref18.angle;
|
|
215
|
-
return React.createElement("g", {
|
|
216
|
-
key: i,
|
|
217
|
-
transform: "translate(".concat(x * iw, " ").concat(y * ih, ") rotate(").concat(-(angle || 0) * 180 / Math.PI, ")")
|
|
218
|
-
}, React.createElement("g", null, React.createElement("rect", {
|
|
219
|
-
x: -5,
|
|
220
|
-
y: -5,
|
|
221
|
-
width: 10,
|
|
222
|
-
height: 10,
|
|
242
|
+
return (
|
|
243
|
+
/*#__PURE__*/
|
|
244
|
+
React.createElement(React.Fragment, null,
|
|
245
|
+
/*#__PURE__*/
|
|
246
|
+
React.createElement("polygon", {
|
|
247
|
+
points: firstSection.concat(region.candidatePoint ? [region.candidatePoint] : []).concat(secondSection).map(function (p) {
|
|
248
|
+
return "".concat(p.x * iw, " ").concat(p.y * ih);
|
|
249
|
+
}).join(" "),
|
|
223
250
|
strokeWidth: 2,
|
|
224
251
|
stroke: colorAlpha(region.color, 0.75),
|
|
225
252
|
fill: colorAlpha(region.color, 0.25)
|
|
226
|
-
}))
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
253
|
+
}), points.map(function (_ref18, i) {
|
|
254
|
+
var x = _ref18.x,
|
|
255
|
+
y = _ref18.y,
|
|
256
|
+
angle = _ref18.angle;
|
|
257
|
+
return (
|
|
258
|
+
/*#__PURE__*/
|
|
259
|
+
React.createElement("g", {
|
|
260
|
+
key: i,
|
|
261
|
+
transform: "translate(".concat(x * iw, " ").concat(y * ih, ") rotate(").concat(-(angle || 0) * 180 / Math.PI, ")")
|
|
262
|
+
},
|
|
263
|
+
/*#__PURE__*/
|
|
264
|
+
React.createElement("g", null,
|
|
265
|
+
/*#__PURE__*/
|
|
266
|
+
React.createElement("rect", {
|
|
267
|
+
x: -5,
|
|
268
|
+
y: -5,
|
|
269
|
+
width: 10,
|
|
270
|
+
height: 10,
|
|
271
|
+
strokeWidth: 2,
|
|
272
|
+
stroke: colorAlpha(region.color, 0.75),
|
|
273
|
+
fill: colorAlpha(region.color, 0.25)
|
|
274
|
+
})))
|
|
275
|
+
);
|
|
276
|
+
}),
|
|
277
|
+
/*#__PURE__*/
|
|
278
|
+
React.createElement("rect", {
|
|
279
|
+
x: lastPoint.x * iw - 8,
|
|
280
|
+
y: lastPoint.y * ih - 8,
|
|
281
|
+
width: 16,
|
|
282
|
+
height: 16,
|
|
283
|
+
strokeWidth: 4,
|
|
284
|
+
stroke: colorAlpha(region.color, 0.5),
|
|
285
|
+
fill: "transparent"
|
|
286
|
+
}))
|
|
287
|
+
);
|
|
236
288
|
}),
|
|
237
289
|
pixel: function pixel() {
|
|
238
290
|
return null;
|
|
@@ -248,14 +300,17 @@ export var WrappedRegionList = memo(function (_ref19) {
|
|
|
248
300
|
return r.visible !== false;
|
|
249
301
|
}).map(function (r) {
|
|
250
302
|
var Component = RegionComponents[r.type];
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
303
|
+
return (
|
|
304
|
+
/*#__PURE__*/
|
|
305
|
+
React.createElement(Component, {
|
|
306
|
+
key: r.id,
|
|
307
|
+
region: r,
|
|
308
|
+
iw: iw,
|
|
309
|
+
ih: ih,
|
|
310
|
+
keypointDefinitions: keypointDefinitions,
|
|
311
|
+
fullSegmentationMode: fullSegmentationMode
|
|
312
|
+
})
|
|
313
|
+
);
|
|
259
314
|
});
|
|
260
315
|
}, function (n, p) {
|
|
261
316
|
return n.regions === p.regions && n.iw === p.iw && n.ih === p.ih;
|
|
@@ -270,25 +325,30 @@ export var RegionShapes = function RegionShapes(_ref20) {
|
|
|
270
325
|
var iw = imagePosition.bottomRight.x - imagePosition.topLeft.x;
|
|
271
326
|
var ih = imagePosition.bottomRight.y - imagePosition.topLeft.y;
|
|
272
327
|
if (isNaN(iw) || isNaN(ih)) return null;
|
|
273
|
-
return
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
style: {
|
|
277
|
-
position: "absolute",
|
|
278
|
-
zIndex: 2,
|
|
279
|
-
left: imagePosition.topLeft.x,
|
|
280
|
-
top: imagePosition.topLeft.y,
|
|
281
|
-
pointerEvents: "none",
|
|
328
|
+
return (
|
|
329
|
+
/*#__PURE__*/
|
|
330
|
+
React.createElement("svg", {
|
|
282
331
|
width: iw,
|
|
283
|
-
height: ih
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
332
|
+
height: ih,
|
|
333
|
+
style: {
|
|
334
|
+
position: "absolute",
|
|
335
|
+
zIndex: 2,
|
|
336
|
+
left: imagePosition.topLeft.x,
|
|
337
|
+
top: imagePosition.topLeft.y,
|
|
338
|
+
pointerEvents: "none",
|
|
339
|
+
width: iw,
|
|
340
|
+
height: ih
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
/*#__PURE__*/
|
|
344
|
+
React.createElement(WrappedRegionList, {
|
|
345
|
+
key: "wrapped-region-list",
|
|
346
|
+
regions: regions,
|
|
347
|
+
iw: iw,
|
|
348
|
+
ih: ih,
|
|
349
|
+
keypointDefinitions: keypointDefinitions,
|
|
350
|
+
fullSegmentationMode: fullSegmentationMode
|
|
351
|
+
}))
|
|
352
|
+
);
|
|
293
353
|
};
|
|
294
354
|
export default RegionShapes;
|
package/RegionTags/index.js
CHANGED
|
@@ -58,87 +58,101 @@ export var RegionTags = function RegionTags(_ref) {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
if (region.locked) {
|
|
61
|
-
return
|
|
61
|
+
return (
|
|
62
|
+
/*#__PURE__*/
|
|
63
|
+
React.createElement("div", {
|
|
64
|
+
key: region.id,
|
|
65
|
+
style: _objectSpread({
|
|
66
|
+
position: "absolute"
|
|
67
|
+
}, coords, {
|
|
68
|
+
zIndex: 10 + (region.editingLabels ? 5 : 0)
|
|
69
|
+
})
|
|
70
|
+
},
|
|
71
|
+
/*#__PURE__*/
|
|
72
|
+
React.createElement(Paper, {
|
|
73
|
+
style: _objectSpread({
|
|
74
|
+
position: "absolute",
|
|
75
|
+
left: 0
|
|
76
|
+
}, displayOnTop ? {
|
|
77
|
+
bottom: 0
|
|
78
|
+
} : {
|
|
79
|
+
top: 0
|
|
80
|
+
}, {
|
|
81
|
+
zIndex: 10,
|
|
82
|
+
backgroundColor: "#fff",
|
|
83
|
+
borderRadius: 4,
|
|
84
|
+
padding: 2,
|
|
85
|
+
paddingBottom: 0,
|
|
86
|
+
opacity: 0.5,
|
|
87
|
+
pointerEvents: "none"
|
|
88
|
+
})
|
|
89
|
+
},
|
|
90
|
+
/*#__PURE__*/
|
|
91
|
+
React.createElement(LockIcon, {
|
|
92
|
+
style: {
|
|
93
|
+
width: 16,
|
|
94
|
+
height: 16,
|
|
95
|
+
color: "#333"
|
|
96
|
+
}
|
|
97
|
+
})))
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
/*#__PURE__*/
|
|
103
|
+
React.createElement("div", {
|
|
62
104
|
key: region.id,
|
|
63
105
|
style: _objectSpread({
|
|
64
106
|
position: "absolute"
|
|
65
107
|
}, coords, {
|
|
66
|
-
zIndex: 10 + (region.editingLabels ? 5 : 0)
|
|
67
|
-
|
|
68
|
-
|
|
108
|
+
zIndex: 10 + (region.editingLabels ? 5 : 0),
|
|
109
|
+
width: 200
|
|
110
|
+
}),
|
|
111
|
+
onMouseDown: function onMouseDown(e) {
|
|
112
|
+
return e.preventDefault();
|
|
113
|
+
},
|
|
114
|
+
onMouseUp: function onMouseUp(e) {
|
|
115
|
+
return e.preventDefault();
|
|
116
|
+
},
|
|
117
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
118
|
+
if (region.editingLabels) {
|
|
119
|
+
mouseEvents.onMouseUp(e);
|
|
120
|
+
e.button = 1;
|
|
121
|
+
mouseEvents.onMouseUp(e);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
/*#__PURE__*/
|
|
126
|
+
React.createElement("div", Object.assign({
|
|
69
127
|
style: _objectSpread({
|
|
70
128
|
position: "absolute",
|
|
129
|
+
zIndex: 20,
|
|
71
130
|
left: 0
|
|
72
131
|
}, displayOnTop ? {
|
|
73
132
|
bottom: 0
|
|
74
133
|
} : {
|
|
75
134
|
top: 0
|
|
76
|
-
}, {
|
|
77
|
-
zIndex: 10,
|
|
78
|
-
backgroundColor: "#fff",
|
|
79
|
-
borderRadius: 4,
|
|
80
|
-
padding: 2,
|
|
81
|
-
paddingBottom: 0,
|
|
82
|
-
opacity: 0.5,
|
|
83
|
-
pointerEvents: "none"
|
|
84
135
|
})
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
onMouseUp: function onMouseUp(e) {
|
|
106
|
-
return e.preventDefault();
|
|
107
|
-
},
|
|
108
|
-
onMouseEnter: function onMouseEnter(e) {
|
|
109
|
-
if (region.editingLabels) {
|
|
110
|
-
mouseEvents.onMouseUp(e);
|
|
111
|
-
e.button = 1;
|
|
112
|
-
mouseEvents.onMouseUp(e);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}, React.createElement("div", Object.assign({
|
|
116
|
-
style: _objectSpread({
|
|
117
|
-
position: "absolute",
|
|
118
|
-
zIndex: 20,
|
|
119
|
-
left: 0
|
|
120
|
-
}, displayOnTop ? {
|
|
121
|
-
bottom: 0
|
|
122
|
-
} : {
|
|
123
|
-
top: 0
|
|
124
|
-
})
|
|
125
|
-
}, !region.editingLabels ? copyWithout(mouseEvents, "onMouseDown", "onMouseUp") : {}), React.createElement(RegionLabel, {
|
|
126
|
-
allowedClasses: regionClsList,
|
|
127
|
-
allowedTags: regionTagList,
|
|
128
|
-
onOpen: onBeginRegionEdit,
|
|
129
|
-
onChange: onChangeRegion,
|
|
130
|
-
onClose: onCloseRegionEdit,
|
|
131
|
-
onDelete: onDeleteRegion,
|
|
132
|
-
onDeleteGroup: onDeleteGroup,
|
|
133
|
-
editing: region.editingLabels,
|
|
134
|
-
region: region,
|
|
135
|
-
regions: regions,
|
|
136
|
-
imageSrc: imageSrc,
|
|
137
|
-
onRegionClassAdded: onRegionClassAdded,
|
|
138
|
-
allowComments: allowComments,
|
|
139
|
-
hideNotEditingLabel: hideNotEditingLabel,
|
|
140
|
-
allowedGroups: allowedGroups
|
|
141
|
-
})));
|
|
136
|
+
}, !region.editingLabels ? copyWithout(mouseEvents, "onMouseDown", "onMouseUp") : {}),
|
|
137
|
+
/*#__PURE__*/
|
|
138
|
+
React.createElement(RegionLabel, {
|
|
139
|
+
allowedClasses: regionClsList,
|
|
140
|
+
allowedTags: regionTagList,
|
|
141
|
+
onOpen: onBeginRegionEdit,
|
|
142
|
+
onChange: onChangeRegion,
|
|
143
|
+
onClose: onCloseRegionEdit,
|
|
144
|
+
onDelete: onDeleteRegion,
|
|
145
|
+
onDeleteGroup: onDeleteGroup,
|
|
146
|
+
editing: region.editingLabels,
|
|
147
|
+
region: region,
|
|
148
|
+
regions: regions,
|
|
149
|
+
imageSrc: imageSrc,
|
|
150
|
+
onRegionClassAdded: onRegionClassAdded,
|
|
151
|
+
allowComments: allowComments,
|
|
152
|
+
hideNotEditingLabel: hideNotEditingLabel,
|
|
153
|
+
allowedGroups: allowedGroups
|
|
154
|
+
})))
|
|
155
|
+
);
|
|
142
156
|
});
|
|
143
157
|
};
|
|
144
158
|
export default RegionTags;
|