@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.
Files changed (60) hide show
  1. package/Annotator/examplePhotos.js +28 -28
  2. package/Annotator/examplePhotos_repr.js +28 -28
  3. package/Annotator/index.js +40 -31
  4. package/Annotator/index.story_bugdemo_15_1.js +895 -773
  5. package/Annotator/index.story_repr.js +1048 -933
  6. package/Annotator/reducers/convert-expanding-line-to-polygon.js +15 -16
  7. package/ClassSelectionMenu/index.js +55 -35
  8. package/Crosshairs/index.js +30 -23
  9. package/DebugSidebarBox/index.js +40 -9
  10. package/DemoSite/Editor.js +124 -79
  11. package/DemoSite/ErrorBoundaryDialog.js +19 -6
  12. package/DemoSite/index.js +26 -17
  13. package/Editor/index.js +70 -36
  14. package/Editor/index_bugdemo_15_1.js +68 -35
  15. package/Editor/readOnly.js +178 -127
  16. package/Errorer/index.js +8 -3
  17. package/FullImageSegmentationAnnotator/index.js +6 -3
  18. package/GroupSelectorSidebarBox/index.js +48 -32
  19. package/GroupsEditorSidebarBox/index.js +75 -40
  20. package/HelpSidebarBox/index.js +24 -13
  21. package/HighlightBox/index.js +37 -30
  22. package/HistorySidebarBox/index.js +51 -29
  23. package/ImageCanvas/index.js +165 -130
  24. package/ImageMask/index.js +9 -6
  25. package/ImageSelectorSidebarBox/index.js +44 -26
  26. package/KeyframeTimeline/index.js +65 -45
  27. package/KeyframesSelectorSidebarBox/index.js +76 -54
  28. package/LandingPage/index.js +76 -38
  29. package/Locker/index.js +8 -3
  30. package/MainLayout/RightSidebarItemsWrapper.js +7 -4
  31. package/MainLayout/icon-dictionary.js +99 -66
  32. package/MainLayout/index.js +258 -196
  33. package/MainLayout/index_bugdemo_15_1.js +253 -195
  34. package/MetadataEditorSidebarBox/index.js +152 -102
  35. package/MetadataEditorSidebarBox/index_14_01_25.js +152 -102
  36. package/MetadataEditorSidebarBox/index_repr.js +183 -128
  37. package/PageSelector/UpdatedBySemaphore.js +95 -0
  38. package/PageSelector/index.js +181 -97
  39. package/PageSelector/page-selector.css +118 -2
  40. package/PointDistances/index.js +45 -33
  41. package/PreventScrollToParents/index.js +16 -9
  42. package/RegionLabel/index.js +217 -165
  43. package/RegionSelectAndTransformBoxes/index.js +131 -105
  44. package/RegionSelectorSidebarBox/index.js +243 -165
  45. package/RegionShapes/index.js +213 -153
  46. package/RegionTags/index.js +83 -69
  47. package/SettingsDialog/index.js +50 -37
  48. package/SettingsProvider/index.js +8 -5
  49. package/Shortcuts/ShortcutField.js +21 -14
  50. package/Shortcuts/index.js +18 -12
  51. package/ShortcutsManager/index.js +7 -4
  52. package/Sidebar/index.js +46 -29
  53. package/SidebarBoxContainer/index.js +14 -7
  54. package/SmallToolButton/index.js +23 -16
  55. package/TagsSidebarBox/index.js +41 -28
  56. package/TaskDescriptionSidebarBox/index.js +24 -13
  57. package/Theme/index.js +8 -3
  58. package/VideoOrImageCanvasBackground/index.js +30 -17
  59. package/package.json +1 -1
  60. package/utils/spellcheck-nspell.js +2 -2
@@ -50,182 +50,234 @@ export var RegionLabel = function RegionLabel(_ref) {
50
50
  label: g.label || uuidToHash(g.id)
51
51
  };
52
52
  }) : [];
53
- return React.createElement(ThemeProvider, {
54
- theme: theme
55
- }, React.createElement(Paper, {
56
- onClick: function onClick() {
57
- return !editing ? onOpen(region) : null;
53
+ return (
54
+ /*#__PURE__*/
55
+ React.createElement(ThemeProvider, {
56
+ theme: theme
58
57
  },
59
- className: classnames(classes.regionInfo, {
60
- highlighted: region.highlighted
61
- })
62
- }, !editing ? React.createElement("div", null, region.cls && React.createElement("div", {
63
- className: "name"
64
- }, React.createElement("div", {
65
- className: "circle",
66
- style: {
67
- backgroundColor: region.color
68
- }
69
- }), region.cls), region.tags && React.createElement("div", {
70
- className: "tags"
71
- }, region.tags.map(function (t) {
72
- return React.createElement("div", {
73
- key: t,
74
- className: "tag"
75
- }, t);
76
- }))) : React.createElement("div", {
77
- style: {
78
- width: 200
79
- }
80
- }, React.createElement("div", {
81
- style: {
82
- display: "flex",
83
- flexDirection: "row"
84
- }
85
- }, React.createElement("div", {
86
- style: {
87
- display: "flex",
88
- backgroundColor: region.color || "#888",
89
- color: "#fff",
90
- padding: 4,
91
- paddingLeft: 8,
92
- paddingRight: 8,
93
- borderRadius: 4,
94
- fontWeight: "bold",
95
- textShadow: "0px 0px 5px rgba(0,0,0,0.4)"
96
- }
97
- }, region.type), React.createElement("div", {
98
- style: {
99
- flexGrow: 1
100
- }
101
- }), React.createElement(IconButton, {
102
- onClick: function onClick() {
103
- return onDelete(region);
58
+ /*#__PURE__*/
59
+ React.createElement(Paper, {
60
+ onClick: function onClick() {
61
+ return !editing ? onOpen(region) : null;
62
+ },
63
+ className: classnames(classes.regionInfo, {
64
+ highlighted: region.highlighted
65
+ })
66
+ }, !editing ?
67
+ /*#__PURE__*/
68
+ React.createElement("div", null, region.cls &&
69
+ /*#__PURE__*/
70
+ React.createElement("div", {
71
+ className: "name"
104
72
  },
105
- tabIndex: -1,
106
- style: {
107
- width: 22,
108
- height: 22
73
+ /*#__PURE__*/
74
+ React.createElement("div", {
75
+ className: "circle",
76
+ style: {
77
+ backgroundColor: region.color
78
+ }
79
+ }), region.cls), region.tags &&
80
+ /*#__PURE__*/
81
+ React.createElement("div", {
82
+ className: "tags"
83
+ }, region.tags.map(function (t) {
84
+ return (
85
+ /*#__PURE__*/
86
+ React.createElement("div", {
87
+ key: t,
88
+ className: "tag"
89
+ }, t)
90
+ );
91
+ }))) :
92
+ /*#__PURE__*/
93
+ React.createElement("div", {
94
+ style: {
95
+ width: 200
96
+ }
109
97
  },
110
- size: "small",
111
- variant: "outlined"
112
- }, React.createElement(DeleteOutlineIcon, {
113
- style: {
114
- marginTop: -8,
115
- width: 16,
116
- height: 16
117
- }
118
- })), React.createElement(IconButton, {
119
- onClick: function onClick() {
120
- return onDeleteGroup(region.groupId);
98
+ /*#__PURE__*/
99
+ React.createElement("div", {
100
+ style: {
101
+ display: "flex",
102
+ flexDirection: "row"
103
+ }
121
104
  },
122
- tabIndex: -1,
123
- style: {
124
- width: 22,
125
- height: 22
105
+ /*#__PURE__*/
106
+ React.createElement("div", {
107
+ style: {
108
+ display: "flex",
109
+ backgroundColor: region.color || "#888",
110
+ color: "#fff",
111
+ padding: 4,
112
+ paddingLeft: 8,
113
+ paddingRight: 8,
114
+ borderRadius: 4,
115
+ fontWeight: "bold",
116
+ textShadow: "0px 0px 5px rgba(0,0,0,0.4)"
117
+ }
118
+ }, region.type),
119
+ /*#__PURE__*/
120
+ React.createElement("div", {
121
+ style: {
122
+ flexGrow: 1
123
+ }
124
+ }),
125
+ /*#__PURE__*/
126
+ React.createElement(IconButton, {
127
+ onClick: function onClick() {
128
+ return onDelete(region);
129
+ },
130
+ tabIndex: -1,
131
+ style: {
132
+ width: 22,
133
+ height: 22
134
+ },
135
+ size: "small",
136
+ variant: "outlined"
126
137
  },
127
- size: "small",
128
- variant: "outlined"
129
- }, React.createElement(DeleteForeverIcon, {
130
- style: {
131
- marginTop: -8,
132
- width: 16,
133
- height: 16
134
- }
135
- }))), (allowedClasses || []).length > 0 && React.createElement("div", {
136
- style: {
137
- marginTop: 6
138
- }
139
- }, React.createElement(CreatableSelect, {
140
- placeholder: "Classification",
141
- onChange: function onChange(o, actionMeta) {
142
- if (actionMeta.action == "create-option") {
143
- onRegionClassAdded(o.value);
138
+ /*#__PURE__*/
139
+ React.createElement(DeleteOutlineIcon, {
140
+ style: {
141
+ marginTop: -8,
142
+ width: 16,
143
+ height: 16
144
144
  }
145
-
146
- return _onChange(_objectSpread({}, region, {
147
- cls: o.value
148
- }));
145
+ })),
146
+ /*#__PURE__*/
147
+ React.createElement(IconButton, {
148
+ onClick: function onClick() {
149
+ return onDeleteGroup(region.groupId);
150
+ },
151
+ tabIndex: -1,
152
+ style: {
153
+ width: 22,
154
+ height: 22
155
+ },
156
+ size: "small",
157
+ variant: "outlined"
149
158
  },
150
- value: region.cls ? {
151
- label: region.cls,
152
- value: region.cls
153
- } : null,
154
- options: asMutable(allowedClasses.map(function (c) {
155
- return {
156
- value: c,
157
- label: c
158
- };
159
- }))
160
- })), (allowedGroups || []).length > 0 && React.createElement(Select, {
161
- onChange: function onChange(newGroup) {
162
- return _onChange(_objectSpread({}, region, {
163
- groupId: newGroup.value
164
- }));
159
+ /*#__PURE__*/
160
+ React.createElement(DeleteForeverIcon, {
161
+ style: {
162
+ marginTop: -8,
163
+ width: 16,
164
+ height: 16
165
+ }
166
+ }))), (allowedClasses || []).length > 0 &&
167
+ /*#__PURE__*/
168
+ React.createElement("div", {
169
+ style: {
170
+ marginTop: 6
171
+ }
165
172
  },
166
- placeholder: "Group",
167
- value: allowedGroupsForSelect.find(function (g) {
168
- return g.value === region.groupId;
169
- }),
170
- options: _toConsumableArray(allowedGroupsForSelect)
171
- }), (allowedTags || []).length > 0 && React.createElement("div", {
172
- style: {
173
- marginTop: 4
174
- }
175
- }, React.createElement(Select, {
176
- onChange: function onChange(newTags) {
177
- return _onChange(_objectSpread({}, region, {
178
- tags: newTags.map(function (t) {
179
- return t.value;
180
- })
181
- }));
173
+ /*#__PURE__*/
174
+ React.createElement(CreatableSelect, {
175
+ placeholder: "Classification",
176
+ onChange: function onChange(o, actionMeta) {
177
+ if (actionMeta.action == "create-option") {
178
+ onRegionClassAdded(o.value);
179
+ }
180
+
181
+ return _onChange(_objectSpread({}, region, {
182
+ cls: o.value
183
+ }));
184
+ },
185
+ value: region.cls ? {
186
+ label: region.cls,
187
+ value: region.cls
188
+ } : null,
189
+ options: asMutable(allowedClasses.map(function (c) {
190
+ return {
191
+ value: c,
192
+ label: c
193
+ };
194
+ }))
195
+ })), (allowedGroups || []).length > 0 &&
196
+ /*#__PURE__*/
197
+ React.createElement(Select, {
198
+ onChange: function onChange(newGroup) {
199
+ return _onChange(_objectSpread({}, region, {
200
+ groupId: newGroup.value
201
+ }));
202
+ },
203
+ placeholder: "Group",
204
+ value: allowedGroupsForSelect.find(function (g) {
205
+ return g.value === region.groupId;
206
+ }),
207
+ options: _toConsumableArray(allowedGroupsForSelect)
208
+ }), (allowedTags || []).length > 0 &&
209
+ /*#__PURE__*/
210
+ React.createElement("div", {
211
+ style: {
212
+ marginTop: 4
213
+ }
182
214
  },
183
- placeholder: "Tags",
184
- value: (region.tags || []).map(function (c) {
185
- return {
186
- label: c,
187
- value: c
188
- };
189
- }),
190
- isMulti: true,
191
- options: asMutable(allowedTags.map(function (c) {
192
- return {
193
- value: c,
194
- label: c
195
- };
196
- }))
197
- })), allowComments && React.createElement(TextField, {
198
- InputProps: {
199
- className: classes.commentBox
215
+ /*#__PURE__*/
216
+ React.createElement(Select, {
217
+ onChange: function onChange(newTags) {
218
+ return _onChange(_objectSpread({}, region, {
219
+ tags: newTags.map(function (t) {
220
+ return t.value;
221
+ })
222
+ }));
223
+ },
224
+ placeholder: "Tags",
225
+ value: (region.tags || []).map(function (c) {
226
+ return {
227
+ label: c,
228
+ value: c
229
+ };
230
+ }),
231
+ isMulti: true,
232
+ options: asMutable(allowedTags.map(function (c) {
233
+ return {
234
+ value: c,
235
+ label: c
236
+ };
237
+ }))
238
+ })), allowComments &&
239
+ /*#__PURE__*/
240
+ React.createElement(TextField, {
241
+ InputProps: {
242
+ className: classes.commentBox
243
+ },
244
+ fullWidth: true,
245
+ multiline: true,
246
+ rows: 3,
247
+ ref: commentInputRef,
248
+ onClick: onCommentInputClick,
249
+ value: region.comment || "",
250
+ onChange: function onChange(event) {
251
+ return _onChange(_objectSpread({}, region, {
252
+ comment: event.target.value
253
+ }));
254
+ }
255
+ }), onClose &&
256
+ /*#__PURE__*/
257
+ React.createElement("div", {
258
+ style: {
259
+ marginTop: 4,
260
+ display: "flex"
261
+ }
200
262
  },
201
- fullWidth: true,
202
- multiline: true,
203
- rows: 3,
204
- ref: commentInputRef,
205
- onClick: onCommentInputClick,
206
- value: region.comment || "",
207
- onChange: function onChange(event) {
208
- return _onChange(_objectSpread({}, region, {
209
- comment: event.target.value
210
- }));
211
- }
212
- }), onClose && React.createElement("div", {
213
- style: {
214
- marginTop: 4,
215
- display: "flex"
216
- }
217
- }, React.createElement("div", {
218
- style: {
219
- flexGrow: 1
220
- }
221
- }), React.createElement(Button, {
222
- onClick: function onClick() {
223
- return onClose(region);
263
+ /*#__PURE__*/
264
+ React.createElement("div", {
265
+ style: {
266
+ flexGrow: 1
267
+ }
268
+ }),
269
+ /*#__PURE__*/
270
+ React.createElement(Button, {
271
+ onClick: function onClick() {
272
+ return onClose(region);
273
+ },
274
+ size: "small",
275
+ variant: "contained",
276
+ color: "primary"
224
277
  },
225
- size: "small",
226
- variant: "contained",
227
- color: "primary"
228
- }, React.createElement(CheckIcon, null))))));
278
+ /*#__PURE__*/
279
+ React.createElement(CheckIcon, null))))))
280
+ );
229
281
  };
230
282
  export default memo(RegionLabel, function (prevProps, nextProps) {
231
283
  return prevProps.editing === nextProps.editing && prevProps.region === nextProps.region;
@@ -46,110 +46,133 @@ export var RegionSelectAndTransformBox = memo(function (_ref2) {
46
46
  var _layoutParams$current = layoutParams.current,
47
47
  iw = _layoutParams$current.iw,
48
48
  ih = _layoutParams$current.ih;
49
- return React.createElement(ThemeProvider, {
50
- theme: theme
51
- }, React.createElement(Fragment, null, React.createElement(PreventScrollToParents, null, showHighlightBox && r.type !== "polygon" && React.createElement(HighlightBox, {
52
- region: r,
53
- mouseEvents: mouseEvents,
54
- dragWithPrimary: dragWithPrimary,
55
- createWithPrimary: createWithPrimary,
56
- zoomWithPrimary: zoomWithPrimary,
57
- onBeginMovePoint: onBeginMovePoint,
58
- onSelectRegion: onSelectRegion,
59
- pbox: pbox
60
- }), r.type === "box" && !dragWithPrimary && !zoomWithPrimary && !r.locked && r.highlighted && mat.a < 1.2 && [[0, 0], [0.5, 0], [1, 0], [1, 0.5], [1, 1], [0.5, 1], [0, 1], [0, 0.5], [0.5, 0.5]].map(function (_ref3, i) {
61
- var _ref4 = _slicedToArray(_ref3, 2),
62
- px = _ref4[0],
63
- py = _ref4[1];
49
+ return (
50
+ /*#__PURE__*/
51
+ React.createElement(ThemeProvider, {
52
+ theme: theme
53
+ },
54
+ /*#__PURE__*/
55
+ React.createElement(Fragment, null,
56
+ /*#__PURE__*/
57
+ React.createElement(PreventScrollToParents, null, showHighlightBox && r.type !== "polygon" &&
58
+ /*#__PURE__*/
59
+ React.createElement(HighlightBox, {
60
+ region: r,
61
+ mouseEvents: mouseEvents,
62
+ dragWithPrimary: dragWithPrimary,
63
+ createWithPrimary: createWithPrimary,
64
+ zoomWithPrimary: zoomWithPrimary,
65
+ onBeginMovePoint: onBeginMovePoint,
66
+ onSelectRegion: onSelectRegion,
67
+ pbox: pbox
68
+ }), r.type === "box" && !dragWithPrimary && !zoomWithPrimary && !r.locked && r.highlighted && mat.a < 1.2 && [[0, 0], [0.5, 0], [1, 0], [1, 0.5], [1, 1], [0.5, 1], [0, 1], [0, 0.5], [0.5, 0.5]].map(function (_ref3, i) {
69
+ var _ref4 = _slicedToArray(_ref3, 2),
70
+ px = _ref4[0],
71
+ py = _ref4[1];
64
72
 
65
- return React.createElement(TransformGrabber, Object.assign({
66
- key: i
67
- }, mouseEvents, {
68
- onMouseDown: function onMouseDown(e) {
69
- if (e.button === 0) return onBeginBoxTransform(r, [px * 2 - 1, py * 2 - 1]);
70
- mouseEvents.onMouseDown(e);
71
- },
72
- style: {
73
- left: pbox.x - 4 - 2 + pbox.w * px,
74
- top: pbox.y - 4 - 2 + pbox.h * py,
75
- cursor: boxCursorMap[py * 2][px * 2],
76
- borderRadius: px === 0.5 && py === 0.5 ? 4 : undefined
77
- }
78
- }));
79
- }), r.type === "polygon" && !dragWithPrimary && !zoomWithPrimary && !r.locked && r.highlighted && r.points.map(function (_ref5, i) {
80
- var _ref6 = _slicedToArray(_ref5, 2),
81
- px = _ref6[0],
82
- py = _ref6[1];
73
+ return (
74
+ /*#__PURE__*/
75
+ React.createElement(TransformGrabber, Object.assign({
76
+ key: i
77
+ }, mouseEvents, {
78
+ onMouseDown: function onMouseDown(e) {
79
+ if (e.button === 0) return onBeginBoxTransform(r, [px * 2 - 1, py * 2 - 1]);
80
+ mouseEvents.onMouseDown(e);
81
+ },
82
+ style: {
83
+ left: pbox.x - 4 - 2 + pbox.w * px,
84
+ top: pbox.y - 4 - 2 + pbox.h * py,
85
+ cursor: boxCursorMap[py * 2][px * 2],
86
+ borderRadius: px === 0.5 && py === 0.5 ? 4 : undefined
87
+ }
88
+ }))
89
+ );
90
+ }), r.type === "polygon" && !dragWithPrimary && !zoomWithPrimary && !r.locked && r.highlighted && r.points.map(function (_ref5, i) {
91
+ var _ref6 = _slicedToArray(_ref5, 2),
92
+ px = _ref6[0],
93
+ py = _ref6[1];
83
94
 
84
- var proj = mat.clone().inverse().applyToPoint(px * iw, py * ih);
85
- return React.createElement(TransformGrabber, Object.assign({
86
- key: i
87
- }, mouseEvents, {
88
- onMouseDown: function onMouseDown(e) {
89
- if (e.button === 0 && (!r.open || i === 0)) return onBeginMovePolygonPoint(r, i);
90
- mouseEvents.onMouseDown(e);
91
- },
92
- style: {
93
- cursor: !r.open ? "move" : i === 0 ? "pointer" : undefined,
94
- zIndex: 10,
95
- pointerEvents: r.open && i === r.points.length - 1 ? "none" : undefined,
96
- left: proj.x - 4,
97
- top: proj.y - 4
98
- }
99
- }));
100
- }), r.type === "polygon" && r.highlighted && !dragWithPrimary && !zoomWithPrimary && !r.locked && !r.open && r.points.length > 1 && r.points.map(function (p1, i) {
101
- return [p1, r.points[(i + 1) % r.points.length]];
102
- }).map(function (_ref7) {
103
- var _ref8 = _slicedToArray(_ref7, 2),
104
- p1 = _ref8[0],
105
- p2 = _ref8[1];
95
+ var proj = mat.clone().inverse().applyToPoint(px * iw, py * ih);
96
+ return (
97
+ /*#__PURE__*/
98
+ React.createElement(TransformGrabber, Object.assign({
99
+ key: i
100
+ }, mouseEvents, {
101
+ onMouseDown: function onMouseDown(e) {
102
+ if (e.button === 0 && (!r.open || i === 0)) return onBeginMovePolygonPoint(r, i);
103
+ mouseEvents.onMouseDown(e);
104
+ },
105
+ style: {
106
+ cursor: !r.open ? "move" : i === 0 ? "pointer" : undefined,
107
+ zIndex: 10,
108
+ pointerEvents: r.open && i === r.points.length - 1 ? "none" : undefined,
109
+ left: proj.x - 4,
110
+ top: proj.y - 4
111
+ }
112
+ }))
113
+ );
114
+ }), r.type === "polygon" && r.highlighted && !dragWithPrimary && !zoomWithPrimary && !r.locked && !r.open && r.points.length > 1 && r.points.map(function (p1, i) {
115
+ return [p1, r.points[(i + 1) % r.points.length]];
116
+ }).map(function (_ref7) {
117
+ var _ref8 = _slicedToArray(_ref7, 2),
118
+ p1 = _ref8[0],
119
+ p2 = _ref8[1];
106
120
 
107
- return [(p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2];
108
- }).map(function (pa, i) {
109
- var proj = mat.clone().inverse().applyToPoint(pa[0] * iw, pa[1] * ih);
110
- return React.createElement(TransformGrabber, Object.assign({
111
- key: i
112
- }, mouseEvents, {
113
- onMouseDown: function onMouseDown(e) {
114
- if (e.button === 0) return onAddPolygonPoint(r, pa, i + 1);
115
- mouseEvents.onMouseDown(e);
116
- },
117
- style: {
118
- cursor: "copy",
119
- zIndex: 10,
120
- left: proj.x - 4,
121
- top: proj.y - 4,
122
- border: "2px dotted #fff",
123
- opacity: 0.5
124
- }
125
- }));
126
- }), r.type === "keypoints" && !dragWithPrimary && !zoomWithPrimary && !r.locked && r.highlighted && Object.entries(r.points).map(function (_ref9, i) {
127
- var _ref10 = _slicedToArray(_ref9, 2),
128
- keypointId = _ref10[0],
129
- _ref10$ = _ref10[1],
130
- px = _ref10$.x,
131
- py = _ref10$.y;
121
+ return [(p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2];
122
+ }).map(function (pa, i) {
123
+ var proj = mat.clone().inverse().applyToPoint(pa[0] * iw, pa[1] * ih);
124
+ return (
125
+ /*#__PURE__*/
126
+ React.createElement(TransformGrabber, Object.assign({
127
+ key: i
128
+ }, mouseEvents, {
129
+ onMouseDown: function onMouseDown(e) {
130
+ if (e.button === 0) return onAddPolygonPoint(r, pa, i + 1);
131
+ mouseEvents.onMouseDown(e);
132
+ },
133
+ style: {
134
+ cursor: "copy",
135
+ zIndex: 10,
136
+ left: proj.x - 4,
137
+ top: proj.y - 4,
138
+ border: "2px dotted #fff",
139
+ opacity: 0.5
140
+ }
141
+ }))
142
+ );
143
+ }), r.type === "keypoints" && !dragWithPrimary && !zoomWithPrimary && !r.locked && r.highlighted && Object.entries(r.points).map(function (_ref9, i) {
144
+ var _ref10 = _slicedToArray(_ref9, 2),
145
+ keypointId = _ref10[0],
146
+ _ref10$ = _ref10[1],
147
+ px = _ref10$.x,
148
+ py = _ref10$.y;
132
149
 
133
- var proj = mat.clone().inverse().applyToPoint(px * iw, py * ih);
134
- return React.createElement(Tooltip, {
135
- title: keypointId,
136
- key: i
137
- }, React.createElement(TransformGrabber, Object.assign({
138
- key: i
139
- }, mouseEvents, {
140
- onMouseDown: function onMouseDown(e) {
141
- if (e.button === 0 && (!r.open || i === 0)) return onBeginMoveKeypoint(r, keypointId);
142
- mouseEvents.onMouseDown(e);
143
- },
144
- style: {
145
- cursor: !r.open ? "move" : i === 0 ? "pointer" : undefined,
146
- zIndex: 10,
147
- pointerEvents: r.open && i === r.points.length - 1 ? "none" : undefined,
148
- left: proj.x - 4,
149
- top: proj.y - 4
150
- }
151
- })));
152
- }))));
150
+ var proj = mat.clone().inverse().applyToPoint(px * iw, py * ih);
151
+ return (
152
+ /*#__PURE__*/
153
+ React.createElement(Tooltip, {
154
+ title: keypointId,
155
+ key: i
156
+ },
157
+ /*#__PURE__*/
158
+ React.createElement(TransformGrabber, Object.assign({
159
+ key: i
160
+ }, mouseEvents, {
161
+ onMouseDown: function onMouseDown(e) {
162
+ if (e.button === 0 && (!r.open || i === 0)) return onBeginMoveKeypoint(r, keypointId);
163
+ mouseEvents.onMouseDown(e);
164
+ },
165
+ style: {
166
+ cursor: !r.open ? "move" : i === 0 ? "pointer" : undefined,
167
+ zIndex: 10,
168
+ pointerEvents: r.open && i === r.points.length - 1 ? "none" : undefined,
169
+ left: proj.x - 4,
170
+ top: proj.y - 4
171
+ }
172
+ })))
173
+ );
174
+ }))))
175
+ );
153
176
  }, arePropsEqual);
154
177
  export var RegionSelectAndTransformBoxes = memo(function (props) {
155
178
  return props.regions.filter(function (r) {
@@ -157,11 +180,14 @@ export var RegionSelectAndTransformBoxes = memo(function (props) {
157
180
  }).filter(function (r) {
158
181
  return !r.locked;
159
182
  }).map(function (r, i) {
160
- return React.createElement(RegionSelectAndTransformBox, Object.assign({
161
- key: r.id
162
- }, props, {
163
- region: r
164
- }));
183
+ return (
184
+ /*#__PURE__*/
185
+ React.createElement(RegionSelectAndTransformBox, Object.assign({
186
+ key: r.id
187
+ }, props, {
188
+ region: r
189
+ }))
190
+ );
165
191
  });
166
192
  }, function (n, p) {
167
193
  return n.regions === p.regions && n.mat === p.mat;