@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/PageSelector/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import classnames from "classnames";
|
|
|
4
4
|
import './page-selector.css';
|
|
5
5
|
import Locker from '../Locker';
|
|
6
6
|
import Errorer from '../Errorer';
|
|
7
|
+
import UpdatedBySemaphore, { normalizeMediaPresenterLeaseUntil } from './UpdatedBySemaphore';
|
|
7
8
|
|
|
8
9
|
function PageThumbnail(_ref) {
|
|
9
10
|
var _metadata$find, _metadata$find$call;
|
|
@@ -46,60 +47,93 @@ function PageThumbnail(_ref) {
|
|
|
46
47
|
var pageNumber = metadata === null || metadata === void 0 ? void 0 : (_metadata$find = metadata.find) === null || _metadata$find === void 0 ? void 0 : (_metadata$find$call = _metadata$find.call(metadata, function (md) {
|
|
47
48
|
return md.key === 'pageNumber';
|
|
48
49
|
})) === null || _metadata$find$call === void 0 ? void 0 : _metadata$find$call.value;
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
return (
|
|
51
|
+
/*#__PURE__*/
|
|
52
|
+
React.createElement("div", {
|
|
53
|
+
role: "button",
|
|
54
|
+
tabIndex: 0,
|
|
55
|
+
className: classnames('ps-page-thumbnail', {
|
|
56
|
+
'ps-page-thumbnail-is-active': isActive
|
|
57
|
+
}),
|
|
58
|
+
onClick: onClick
|
|
59
|
+
}, isLocked &&
|
|
60
|
+
/*#__PURE__*/
|
|
61
|
+
React.createElement(Locker, null), error &&
|
|
62
|
+
/*#__PURE__*/
|
|
63
|
+
React.createElement(Errorer, {
|
|
64
|
+
errorMessage: error.message
|
|
54
65
|
}),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
66
|
+
/*#__PURE__*/
|
|
67
|
+
React.createElement("div", {
|
|
68
|
+
className: "ps-page-thumbnail-image-wrapper"
|
|
69
|
+
}, isRecalcReady &&
|
|
70
|
+
/*#__PURE__*/
|
|
71
|
+
React.createElement("div", {
|
|
72
|
+
className: "ps-page-thumbnail-recalc-wrapper"
|
|
73
|
+
},
|
|
74
|
+
/*#__PURE__*/
|
|
75
|
+
React.createElement("button", {
|
|
76
|
+
className: "recalc-button",
|
|
77
|
+
onClick: handleRecalcClick
|
|
78
|
+
}, "Extract")),
|
|
79
|
+
/*#__PURE__*/
|
|
80
|
+
React.createElement("img", {
|
|
81
|
+
src: src,
|
|
82
|
+
alt: "",
|
|
83
|
+
className: "ps-page-thumbnail-image"
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/
|
|
86
|
+
React.createElement("div", {
|
|
87
|
+
className: "page-number-wrapper"
|
|
88
|
+
}, pageNumber !== undefined && !showMetadata &&
|
|
89
|
+
/*#__PURE__*/
|
|
90
|
+
React.createElement("span", {
|
|
91
|
+
className: "page-number"
|
|
92
|
+
}, pageNumber))),
|
|
93
|
+
/*#__PURE__*/
|
|
94
|
+
React.createElement("div", {
|
|
95
|
+
className: "ps-page-thumbnail-metadata-wrapper"
|
|
96
|
+
}, metadata.map(function (_ref2) {
|
|
97
|
+
var _metadataConfigs$find;
|
|
98
|
+
|
|
99
|
+
var key = _ref2.key,
|
|
100
|
+
value = _ref2.value;
|
|
101
|
+
return (
|
|
102
|
+
/*#__PURE__*/
|
|
103
|
+
React.createElement(React.Fragment, null,
|
|
104
|
+
/*#__PURE__*/
|
|
105
|
+
React.createElement("label", {
|
|
106
|
+
"for": key
|
|
107
|
+
}, key),
|
|
108
|
+
/*#__PURE__*/
|
|
109
|
+
React.createElement("input", {
|
|
110
|
+
type: "text",
|
|
111
|
+
value: value,
|
|
112
|
+
name: key,
|
|
113
|
+
onChange: handleChange,
|
|
114
|
+
onClick: function onClick(e) {
|
|
115
|
+
return e.stopPropagation();
|
|
116
|
+
},
|
|
117
|
+
id: key,
|
|
118
|
+
list: "".concat(key, "-list")
|
|
119
|
+
}),
|
|
120
|
+
/*#__PURE__*/
|
|
121
|
+
React.createElement("datalist", {
|
|
122
|
+
id: "".concat(key, "-list")
|
|
123
|
+
}, (_metadataConfigs$find = metadataConfigs.find(function (mcf) {
|
|
124
|
+
return mcf.key === key;
|
|
125
|
+
})) === null || _metadataConfigs$find === void 0 ? void 0 : _metadataConfigs$find.options.map(function (opt) {
|
|
126
|
+
return (
|
|
127
|
+
/*#__PURE__*/
|
|
128
|
+
React.createElement("option", {
|
|
129
|
+
key: opt,
|
|
130
|
+
value: opt
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
})))
|
|
134
|
+
);
|
|
135
|
+
})))
|
|
136
|
+
);
|
|
103
137
|
}
|
|
104
138
|
|
|
105
139
|
function isLocked(page) {
|
|
@@ -114,61 +148,111 @@ function isLocked(page) {
|
|
|
114
148
|
return false;
|
|
115
149
|
}
|
|
116
150
|
|
|
151
|
+
function showUpdatedBySemaphore(updatedBy, mediaPresenterLeaseUntil) {
|
|
152
|
+
if (updatedBy !== undefined && updatedBy !== null) return true;
|
|
153
|
+
if (normalizeMediaPresenterLeaseUntil(mediaPresenterLeaseUntil) != null) return true;
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
|
|
117
157
|
function PageSelector(_ref3) {
|
|
158
|
+
var _ref4, _ref5;
|
|
159
|
+
|
|
118
160
|
var pages = _ref3.pages,
|
|
119
161
|
onPageClick = _ref3.onPageClick,
|
|
120
162
|
onMetadataChange = _ref3.onMetadataChange,
|
|
121
163
|
metadataConfigs = _ref3.metadataConfigs,
|
|
122
|
-
onRecalcClick = _ref3.onRecalcClick
|
|
164
|
+
onRecalcClick = _ref3.onRecalcClick,
|
|
165
|
+
updatedBy = _ref3.updatedBy,
|
|
166
|
+
mediaPresenterLeaseUntil = _ref3.mediaPresenterLeaseUntil;
|
|
123
167
|
|
|
124
168
|
var _useState = useState(false),
|
|
125
169
|
_useState2 = _slicedToArray(_useState, 2),
|
|
126
170
|
showMetadata = _useState2[0],
|
|
127
171
|
setShowMetadata = _useState2[1];
|
|
128
172
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
})
|
|
171
|
-
|
|
173
|
+
var activePage = pages.find(function (p) {
|
|
174
|
+
return p.isActive;
|
|
175
|
+
});
|
|
176
|
+
var selectionKey = (_ref4 = (_ref5 = activePage === null || activePage === void 0 ? void 0 : activePage.id) !== null && _ref5 !== void 0 ? _ref5 : activePage === null || activePage === void 0 ? void 0 : activePage.src) !== null && _ref4 !== void 0 ? _ref4 : String(pages.length);
|
|
177
|
+
return (
|
|
178
|
+
/*#__PURE__*/
|
|
179
|
+
React.createElement("div", {
|
|
180
|
+
className: classnames('page-selector', {
|
|
181
|
+
'page-selector--opened': showMetadata
|
|
182
|
+
})
|
|
183
|
+
},
|
|
184
|
+
/*#__PURE__*/
|
|
185
|
+
React.createElement("div", {
|
|
186
|
+
className: "top-buttons"
|
|
187
|
+
},
|
|
188
|
+
/*#__PURE__*/
|
|
189
|
+
React.createElement("div", {
|
|
190
|
+
className: "page-selector-top-controls"
|
|
191
|
+
},
|
|
192
|
+
/*#__PURE__*/
|
|
193
|
+
React.createElement("div", {
|
|
194
|
+
className: "show-metadata-wrapper"
|
|
195
|
+
},
|
|
196
|
+
/*#__PURE__*/
|
|
197
|
+
React.createElement("label", {
|
|
198
|
+
className: "switch mr-2"
|
|
199
|
+
},
|
|
200
|
+
/*#__PURE__*/
|
|
201
|
+
React.createElement("input", {
|
|
202
|
+
id: "show-metadata",
|
|
203
|
+
type: "checkbox",
|
|
204
|
+
value: showMetadata,
|
|
205
|
+
onChange: function onChange() {
|
|
206
|
+
return setShowMetadata(function (prev) {
|
|
207
|
+
return !prev;
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}),
|
|
211
|
+
/*#__PURE__*/
|
|
212
|
+
React.createElement("span", {
|
|
213
|
+
className: "slider round"
|
|
214
|
+
})),
|
|
215
|
+
/*#__PURE__*/
|
|
216
|
+
React.createElement("label", {
|
|
217
|
+
className: "ps-top-bar-label"
|
|
218
|
+
}, "Metadata")), showUpdatedBySemaphore(updatedBy, mediaPresenterLeaseUntil) &&
|
|
219
|
+
/*#__PURE__*/
|
|
220
|
+
React.createElement("div", {
|
|
221
|
+
className: "ps-semaphore-below-metadata"
|
|
222
|
+
},
|
|
223
|
+
/*#__PURE__*/
|
|
224
|
+
React.createElement(UpdatedBySemaphore, {
|
|
225
|
+
updatedBy: updatedBy,
|
|
226
|
+
mediaPresenterLeaseUntil: mediaPresenterLeaseUntil,
|
|
227
|
+
selectionKey: selectionKey
|
|
228
|
+
})))),
|
|
229
|
+
/*#__PURE__*/
|
|
230
|
+
React.createElement("div", {
|
|
231
|
+
className: "pages"
|
|
232
|
+
}, pages.map(function (page, idx) {
|
|
233
|
+
return (
|
|
234
|
+
/*#__PURE__*/
|
|
235
|
+
React.createElement(PageThumbnail, {
|
|
236
|
+
key: "".concat(page.id),
|
|
237
|
+
isLocked: isLocked(page),
|
|
238
|
+
error: page.syncError,
|
|
239
|
+
src: page.src,
|
|
240
|
+
isActive: page.isActive,
|
|
241
|
+
onClick: function onClick() {
|
|
242
|
+
return onPageClick(idx);
|
|
243
|
+
},
|
|
244
|
+
metadata: page.metadata,
|
|
245
|
+
showMetadata: showMetadata,
|
|
246
|
+
imageIndex: idx,
|
|
247
|
+
imageId: page.id,
|
|
248
|
+
onMetadataChange: onMetadataChange,
|
|
249
|
+
metadataConfigs: metadataConfigs,
|
|
250
|
+
onRecalcClick: onRecalcClick,
|
|
251
|
+
isRecalcReady: page.isRecalcReady
|
|
252
|
+
})
|
|
253
|
+
);
|
|
254
|
+
})))
|
|
255
|
+
);
|
|
172
256
|
}
|
|
173
257
|
|
|
174
258
|
PageSelector.defaultProps = {
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
transition: width .5s;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.page-selector--opened {}
|
|
8
|
-
|
|
9
7
|
.pages {
|
|
10
8
|
list-style: none;
|
|
11
9
|
display: flex;
|
|
@@ -105,6 +103,124 @@
|
|
|
105
103
|
z-index: 100;
|
|
106
104
|
}
|
|
107
105
|
|
|
106
|
+
.page-selector-top-controls {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
align-items: stretch;
|
|
110
|
+
width: 100%;
|
|
111
|
+
gap: 0.5rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Same typography as “Metadata” label (plain label next to switch) */
|
|
115
|
+
.ps-top-bar-label {
|
|
116
|
+
font-family: inherit;
|
|
117
|
+
font-size: 1rem;
|
|
118
|
+
font-weight: 400;
|
|
119
|
+
line-height: 1.5;
|
|
120
|
+
color: inherit;
|
|
121
|
+
cursor: default;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.ps-semaphore-below-metadata {
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: flex-start;
|
|
127
|
+
align-items: center;
|
|
128
|
+
width: 100%;
|
|
129
|
+
padding-top: 0.15rem;
|
|
130
|
+
padding-left: 0;
|
|
131
|
+
box-sizing: border-box;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Same slot as .switch (60px) + .mr-2 (1rem) — lines up with Metadata toggle row */
|
|
135
|
+
.ps-semaphore-toggle-column {
|
|
136
|
+
width: 60px;
|
|
137
|
+
margin-right: 1rem;
|
|
138
|
+
display: flex;
|
|
139
|
+
justify-content: center;
|
|
140
|
+
align-items: center;
|
|
141
|
+
flex-shrink: 0;
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Plain text + discs to the right — no box */
|
|
146
|
+
.ps-updated-by-semaphore {
|
|
147
|
+
display: flex;
|
|
148
|
+
flex-direction: row;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: flex-start;
|
|
151
|
+
gap: 0.5rem;
|
|
152
|
+
padding: 0;
|
|
153
|
+
margin: 0;
|
|
154
|
+
border: none;
|
|
155
|
+
background: none;
|
|
156
|
+
box-shadow: none;
|
|
157
|
+
flex-shrink: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ps-updated-by-semaphore__label {
|
|
161
|
+
text-align: left;
|
|
162
|
+
margin: 0;
|
|
163
|
+
white-space: nowrap;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.ps-semaphore-lamps {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-direction: row;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
gap: 6px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Same diameter as Metadata toggle knob (.slider:before: 26×26) */
|
|
175
|
+
.ps-semaphore-lamp {
|
|
176
|
+
box-sizing: border-box;
|
|
177
|
+
display: inline-block;
|
|
178
|
+
vertical-align: middle;
|
|
179
|
+
width: 26px;
|
|
180
|
+
height: 26px;
|
|
181
|
+
border-radius: 50%;
|
|
182
|
+
border: 2px solid rgba(0, 0, 0, 0.1);
|
|
183
|
+
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
184
|
+
transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
|
|
185
|
+
flex-shrink: 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Inactive lamps read as “off” (neutral); lit lamp pops. */
|
|
189
|
+
.ps-semaphore-lamp:not(.ps-semaphore-lit) {
|
|
190
|
+
opacity: 0.88;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ps-semaphore-lamp.ps-semaphore-lit {
|
|
194
|
+
opacity: 1;
|
|
195
|
+
transform: scale(1.02);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Off state: neutral gray so only the lit lamp reads as red/green (traffic-light style). */
|
|
199
|
+
.ps-semaphore-red:not(.ps-semaphore-lit),
|
|
200
|
+
.ps-semaphore-green:not(.ps-semaphore-lit) {
|
|
201
|
+
background: linear-gradient(165deg, #ececec 0%, #d4d4d4 45%, #bdbdbd 100%);
|
|
202
|
+
border-color: rgba(0, 0, 0, 0.12);
|
|
203
|
+
box-shadow:
|
|
204
|
+
inset 0 2px 4px rgba(255, 255, 255, 0.55),
|
|
205
|
+
inset 0 -2px 5px rgba(0, 0, 0, 0.1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.ps-semaphore-red.ps-semaphore-lit {
|
|
209
|
+
background: linear-gradient(180deg, #ff5252 0%, #d50000 55%, #b71c1c 100%);
|
|
210
|
+
border-color: rgba(255, 200, 200, 0.85);
|
|
211
|
+
box-shadow:
|
|
212
|
+
0 0 10px rgba(213, 0, 0, 0.88),
|
|
213
|
+
inset 0 -2px 5px rgba(0, 0, 0, 0.18);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.ps-semaphore-green.ps-semaphore-lit {
|
|
217
|
+
background: linear-gradient(180deg, #b9f6ca 0%, #00e676 40%, #00c853 100%);
|
|
218
|
+
border-color: rgba(200, 255, 220, 0.9);
|
|
219
|
+
box-shadow:
|
|
220
|
+
0 0 10px rgba(0, 200, 83, 0.88),
|
|
221
|
+
inset 0 -2px 5px rgba(0, 0, 0, 0.14);
|
|
222
|
+
}
|
|
223
|
+
|
|
108
224
|
.top-buttons button {
|
|
109
225
|
margin-bottom: 1rem;
|
|
110
226
|
width: 100%;
|
package/PointDistances/index.js
CHANGED
|
@@ -34,40 +34,52 @@ export var PointDistances = function PointDistances(_ref2) {
|
|
|
34
34
|
regions = _ref2.regions,
|
|
35
35
|
pointDistancePrecision = _ref2.pointDistancePrecision,
|
|
36
36
|
realSize = _ref2.realSize;
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
return (
|
|
38
|
+
/*#__PURE__*/
|
|
39
|
+
React.createElement(ThemeProvider, {
|
|
40
|
+
theme: theme
|
|
41
|
+
},
|
|
42
|
+
/*#__PURE__*/
|
|
43
|
+
React.createElement(Svg, null, regions.filter(function (r1) {
|
|
44
|
+
return r1.type === "point";
|
|
45
|
+
}).flatMap(function (r1, i1) {
|
|
46
|
+
return regions.filter(function (r2, i2) {
|
|
47
|
+
return i2 > i1;
|
|
48
|
+
}).filter(function (r2) {
|
|
49
|
+
return r2.type === "point";
|
|
50
|
+
}).map(function (r2) {
|
|
51
|
+
var pr1 = projectRegionBox(r1);
|
|
52
|
+
var pr2 = projectRegionBox(r2);
|
|
53
|
+
var prm = {
|
|
54
|
+
x: (pr1.x + pr1.w / 2 + pr2.x + pr2.w / 2) / 2,
|
|
55
|
+
y: (pr1.y + pr1.h / 2 + pr2.y + pr2.h / 2) / 2
|
|
56
|
+
};
|
|
57
|
+
var displayDistance;
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
if (realSize) {
|
|
60
|
+
var w = realSize.w,
|
|
61
|
+
h = realSize.h,
|
|
62
|
+
unitName = realSize.unitName;
|
|
63
|
+
displayDistance = Math.sqrt(Math.pow(r1.x * w - r2.x * w, 2) + Math.pow(r1.y * h - r2.y * h, 2)).toFixed(pointDistancePrecision) + unitName;
|
|
64
|
+
} else {
|
|
65
|
+
displayDistance = (Math.sqrt(Math.pow(r1.x - r2.x, 2) + Math.pow(r1.y - r2.y, 2)) * 100).toFixed(pointDistancePrecision) + "%";
|
|
66
|
+
}
|
|
63
67
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
return (
|
|
69
|
+
/*#__PURE__*/
|
|
70
|
+
React.createElement(Fragment, null,
|
|
71
|
+
/*#__PURE__*/
|
|
72
|
+
React.createElement("path", {
|
|
73
|
+
d: "M".concat(pr1.x + pr1.w / 2, ",").concat(pr1.y + pr1.h / 2, " L").concat(pr2.x + pr2.w / 2, ",").concat(pr2.y + pr2.h / 2)
|
|
74
|
+
}),
|
|
75
|
+
/*#__PURE__*/
|
|
76
|
+
React.createElement("text", {
|
|
77
|
+
x: prm.x,
|
|
78
|
+
y: prm.y
|
|
79
|
+
}, displayDistance))
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
})))
|
|
83
|
+
);
|
|
72
84
|
};
|
|
73
85
|
export default PointDistances;
|
|
@@ -38,14 +38,21 @@ export var PreventScrollToParents = function PreventScrollToParents(_ref2) {
|
|
|
38
38
|
}
|
|
39
39
|
}, 100);
|
|
40
40
|
});
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
return (
|
|
42
|
+
/*#__PURE__*/
|
|
43
|
+
React.createElement(ThemeProvider, {
|
|
44
|
+
theme: theme
|
|
45
|
+
},
|
|
46
|
+
/*#__PURE__*/
|
|
47
|
+
React.createElement(Container, Object.assign({}, otherProps, {
|
|
48
|
+
onMouseMove: onMouseMove,
|
|
49
|
+
onMouseLeave: onMouseLeave
|
|
50
|
+
}),
|
|
51
|
+
/*#__PURE__*/
|
|
52
|
+
React.createElement(RemoveScroll, {
|
|
53
|
+
enabled: mouseOver,
|
|
54
|
+
removeScrollBar: false
|
|
55
|
+
}, children)))
|
|
56
|
+
);
|
|
50
57
|
};
|
|
51
58
|
export default PreventScrollToParents;
|