@labelbee/lb-components 1.20.0 → 1.21.0-alpha.10
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/dist/assets/annotation/video/icon_timePoint.svg.js +1 -0
- package/dist/assets/annotation/video/icon_videoCut.svg.js +1 -0
- package/dist/assets/annotation/video/icon_videoCutting.svg.js +1 -0
- package/dist/components/LLMToolView/questionView/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.js +1 -1
- package/dist/components/videoAnnotate/index.js +1 -1
- package/dist/components/videoAnnotate/videoClipTool/VideoClipToolContext.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/constant.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -0
- package/dist/components/videoAnnotate/videoTextTool/index.js +1 -0
- package/dist/components/videoPlayer/VideoTagLayer.js +1 -1
- package/dist/components/videoPlayer/VideoTextLayer.js +2 -0
- package/dist/components/videoPlayer/components/controller/index.js +1 -1
- package/dist/components/videoPlayer/index.js +1 -1
- package/dist/components/videoPlayer/utils.js +1 -1
- package/dist/index.css +262 -4
- package/dist/index.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/types/App.d.ts +2 -2
- package/dist/types/components/audioAnnotate/index.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloud3DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSegment.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSegment2DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSegmentListener.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSideView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudTopView.d.ts +3 -3
- package/dist/types/components/pointCloudView/index.d.ts +3 -3
- package/dist/types/components/videoAnnotate/index.d.ts +19 -7
- package/dist/types/components/videoAnnotate/videoClipTool/VideoClipToolContext.d.ts +27 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/ToolTipForClip.d.ts +8 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/annotatedList/index.d.ts +7 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.d.ts +14 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.d.ts +18 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.d.ts +6 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.d.ts +3 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/videoTrack/index.d.ts +11 -0
- package/dist/types/components/videoAnnotate/videoClipTool/constant.d.ts +26 -0
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +136 -0
- package/dist/types/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptor.d.ts +14 -10
- package/dist/types/components/videoAnnotate/videoTextTool/index.d.ts +61 -0
- package/dist/types/components/videoPlayer/VideoTagLayer.d.ts +1 -0
- package/dist/types/components/videoPlayer/VideoTextLayer.d.ts +2 -0
- package/dist/types/components/videoPlayer/components/controller/index.d.ts +4 -2
- package/dist/types/components/videoPlayer/index.d.ts +12 -0
- package/dist/types/components/videoPlayer/utils.d.ts +6 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +3 -1
- package/dist/utils/audio.js +1 -1
- package/dist/views/MainView/LLMLayout/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/AnnotationText/index.js +1 -1
- package/dist/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/es/assets/annotation/video/icon_timePoint.svg.js +1 -0
- package/es/assets/annotation/video/icon_videoCut.svg.js +1 -0
- package/es/assets/annotation/video/icon_videoCutting.svg.js +1 -0
- package/es/components/LLMToolView/questionView/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.js +1 -1
- package/es/components/videoAnnotate/index.js +1 -1
- package/es/components/videoAnnotate/videoClipTool/VideoClipToolContext.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/constant.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -0
- package/es/components/videoAnnotate/videoTextTool/index.js +1 -0
- package/es/components/videoPlayer/VideoTagLayer.js +1 -1
- package/es/components/videoPlayer/VideoTextLayer.js +2 -0
- package/es/components/videoPlayer/components/controller/index.js +1 -1
- package/es/components/videoPlayer/index.js +1 -1
- package/es/components/videoPlayer/utils.js +1 -1
- package/es/index.css +262 -4
- package/es/index.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/utils/audio.js +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/AnnotationText/index.js +1 -1
- package/es/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/package.json +6 -4
- package/dist/components/videoPlayer/TagToolInstanceAdaptor.js +0 -1
- package/es/components/videoPlayer/TagToolInstanceAdaptor.js +0 -1
- /package/dist/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.js +0 -0
- /package/dist/types/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.d.ts +0 -0
- /package/es/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.js +0 -0
package/es/index.css
CHANGED
|
@@ -128,6 +128,245 @@
|
|
|
128
128
|
white-space: pre-wrap;
|
|
129
129
|
word-break: break-all;
|
|
130
130
|
}
|
|
131
|
+
.index-module_timeSliceInputContainer__579hr {
|
|
132
|
+
height: 120px;
|
|
133
|
+
padding: 16px;
|
|
134
|
+
}
|
|
135
|
+
.index-module_timeSliceInputContainer__579hr .index-module_title__9kdsk {
|
|
136
|
+
margin-bottom: 16px;
|
|
137
|
+
margin-bottom: 8px;
|
|
138
|
+
color: rgba(0, 0, 0, 0.85);
|
|
139
|
+
font-weight: 500;
|
|
140
|
+
font-size: 14px;
|
|
141
|
+
font-family: SourceHanSansCN-Medium;
|
|
142
|
+
}
|
|
143
|
+
.index-module_timeSliceInputContainer__579hr .index-module_inputWrapper__uXmv- {
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
align-items: center;
|
|
147
|
+
}
|
|
148
|
+
.index-module_timeSliceInputContainer__579hr .index-module_inputWrapper__uXmv- .index-module_getCurr__-dchP {
|
|
149
|
+
margin-top: 8px;
|
|
150
|
+
color: #666fff;
|
|
151
|
+
font-size: 12px;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
}
|
|
154
|
+
.index-module_timeSliceInputContainer__579hr .index-module_inputWrapper__uXmv- .index-module_getCurr__-dchP.index-module_disabled__j6aK6 {
|
|
155
|
+
color: #ccc;
|
|
156
|
+
cursor: not-allowed;
|
|
157
|
+
}
|
|
158
|
+
.index-module_timeSliceInputContainer__579hr .index-module_inputContainer__PqtI8 {
|
|
159
|
+
display: flex;
|
|
160
|
+
}
|
|
161
|
+
.index-module_timeSliceInputContainer__579hr .index-module_inputContainer__PqtI8 .index-module_inputWrapper__uXmv- {
|
|
162
|
+
width: 92px;
|
|
163
|
+
}
|
|
164
|
+
.index-module_timeSliceInputContainer__579hr .index-module_inputContainer__PqtI8 .index-module_spliter__wXZhC {
|
|
165
|
+
flex: 1;
|
|
166
|
+
}
|
|
167
|
+
.index-module_textOverflow__HcSP3 {
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
text-overflow: ellipsis;
|
|
171
|
+
}
|
|
172
|
+
.index-module_videoTrackContainer__0oBy3 {
|
|
173
|
+
position: absolute;
|
|
174
|
+
bottom: 0px;
|
|
175
|
+
width: 100%;
|
|
176
|
+
overflow-x: hidden;
|
|
177
|
+
overflow-y: auto;
|
|
178
|
+
background-color: #333333;
|
|
179
|
+
}
|
|
180
|
+
.index-module_videoTrackContainer__0oBy3 .index-module_timeTrack__f--CU {
|
|
181
|
+
height: 24px;
|
|
182
|
+
border-bottom: 1px solid #555555;
|
|
183
|
+
box-sizing: border-box;
|
|
184
|
+
}
|
|
185
|
+
.index-module_videoTrackContainer__0oBy3 .index-module_videoTrack__auEud {
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column-reverse;
|
|
188
|
+
height: 90px;
|
|
189
|
+
overflow-x: hidden;
|
|
190
|
+
overflow-y: auto;
|
|
191
|
+
}
|
|
192
|
+
.index-module_videoTrackContainer__0oBy3 .index-module_videoTrack__auEud .index-module_track__N8mLd {
|
|
193
|
+
position: relative;
|
|
194
|
+
flex: 0 0 45px;
|
|
195
|
+
border-bottom: 1px solid #555555;
|
|
196
|
+
box-sizing: border-box;
|
|
197
|
+
}
|
|
198
|
+
.index-module_videoTrackContainer__0oBy3 .index-module_timeline__GppcX {
|
|
199
|
+
position: absolute;
|
|
200
|
+
top: 50%;
|
|
201
|
+
transform: translateY(-50%);
|
|
202
|
+
display: inline-block;
|
|
203
|
+
height: 100%;
|
|
204
|
+
top: 0;
|
|
205
|
+
left: 0;
|
|
206
|
+
width: 2px;
|
|
207
|
+
z-index: 10;
|
|
208
|
+
height: 100%;
|
|
209
|
+
}
|
|
210
|
+
.index-module_videoTrackContainer__0oBy3 .index-module_displayTime__h0Lg7 {
|
|
211
|
+
position: absolute;
|
|
212
|
+
top: 0;
|
|
213
|
+
left: -1;
|
|
214
|
+
z-index: 11;
|
|
215
|
+
width: 68px;
|
|
216
|
+
padding: 5px;
|
|
217
|
+
color: black;
|
|
218
|
+
font-size: 14px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.index-module_textOverflow__jf6jA {
|
|
222
|
+
white-space: nowrap;
|
|
223
|
+
overflow: hidden;
|
|
224
|
+
text-overflow: ellipsis;
|
|
225
|
+
}
|
|
226
|
+
.index-module_clipToolbar__amC2X {
|
|
227
|
+
display: flex;
|
|
228
|
+
vertical-align: middle;
|
|
229
|
+
}
|
|
230
|
+
.index-module_clipToolbar__amC2X .index-module_buttonWrapper__o1C44 {
|
|
231
|
+
display: flex;
|
|
232
|
+
margin-left: 16px;
|
|
233
|
+
}
|
|
234
|
+
.index-module_clipToolbar__amC2X .index-module_cutButton__M6mOs,
|
|
235
|
+
.index-module_clipToolbar__amC2X .index-module_localButton__6D1-H {
|
|
236
|
+
display: inline-block;
|
|
237
|
+
align-self: center;
|
|
238
|
+
width: 20px;
|
|
239
|
+
height: 20px;
|
|
240
|
+
margin-right: 5px;
|
|
241
|
+
color: #bbbbbb;
|
|
242
|
+
cursor: pointer;
|
|
243
|
+
}
|
|
244
|
+
.index-module_clipToolbar__amC2X .index-module_cutButton__M6mOs {
|
|
245
|
+
margin-left: 20px;
|
|
246
|
+
}
|
|
247
|
+
.index-module_clipToolbar__amC2X .index-module_localButton__6D1-H {
|
|
248
|
+
margin-left: 10px;
|
|
249
|
+
}
|
|
250
|
+
.index-module_timeSliceListContent__gvFHy {
|
|
251
|
+
height: 224px;
|
|
252
|
+
overflow-y: auto;
|
|
253
|
+
font-size: 12px;
|
|
254
|
+
background-color: #fafafa;
|
|
255
|
+
}
|
|
256
|
+
.index-module_timeSliceListContent__gvFHy.index-module_empty__wcFM6 {
|
|
257
|
+
display: flex;
|
|
258
|
+
justify-content: center;
|
|
259
|
+
}
|
|
260
|
+
.index-module_timeSliceListContent__gvFHy.index-module_empty__wcFM6 .index-module_noContent__zjGb0 {
|
|
261
|
+
align-self: center;
|
|
262
|
+
color: #999999;
|
|
263
|
+
}
|
|
264
|
+
.index-module_timeSliceListContent__gvFHy.index-module_empty__wcFM6 .index-module_noContent__zjGb0 > div {
|
|
265
|
+
margin-bottom: 10px;
|
|
266
|
+
text-align: center;
|
|
267
|
+
}
|
|
268
|
+
.index-module_timeSliceListContent__gvFHy.index-module_empty__wcFM6 .index-module_noContent__zjGb0 .index-module_hotkey__dDkgv {
|
|
269
|
+
display: inline-block;
|
|
270
|
+
width: 20px;
|
|
271
|
+
height: 20px;
|
|
272
|
+
margin-right: 5px;
|
|
273
|
+
line-height: 20px;
|
|
274
|
+
text-align: center;
|
|
275
|
+
border: 1px #ccc solid;
|
|
276
|
+
}
|
|
277
|
+
.index-module_timeSliceListContent__gvFHy .index-module_timeSliceItem__Xa-cQ {
|
|
278
|
+
display: flex;
|
|
279
|
+
padding: 12px;
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
}
|
|
282
|
+
.index-module_timeSliceListContent__gvFHy .index-module_timeSliceItem__Xa-cQ.index-module_timeSliceItemActivated__Zlb3b {
|
|
283
|
+
color: #666fff;
|
|
284
|
+
background-color: #ebecfb;
|
|
285
|
+
}
|
|
286
|
+
.index-module_timeSliceListContent__gvFHy .index-module_timeSliceItem__Xa-cQ .index-module_timeSliceAttribute__Q5E-f {
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
white-space: nowrap;
|
|
289
|
+
text-overflow: ellipsis;
|
|
290
|
+
}
|
|
291
|
+
.index-module_timeSliceListContent__gvFHy .index-module_timeSliceItem__Xa-cQ .index-module_timeSliceItemContent__Aqa8l {
|
|
292
|
+
flex: 1;
|
|
293
|
+
white-space: nowrap;
|
|
294
|
+
overflow: hidden;
|
|
295
|
+
text-overflow: ellipsis;
|
|
296
|
+
}
|
|
297
|
+
.index-module_timeSliceListContent__gvFHy .index-module_timeSliceItem__Xa-cQ .index-module_timeSliceItemDeleteIcon__nlQ6B {
|
|
298
|
+
align-self: center;
|
|
299
|
+
padding: 5px;
|
|
300
|
+
opacity: 0;
|
|
301
|
+
transition: opacity 0.3s ease-in-out;
|
|
302
|
+
}
|
|
303
|
+
.index-module_timeSliceListContent__gvFHy .index-module_timeSliceItem__Xa-cQ:hover .index-module_timeSliceItemDeleteIcon__nlQ6B {
|
|
304
|
+
opacity: 1;
|
|
305
|
+
}
|
|
306
|
+
.index-module_clipContainer__L8DlL {
|
|
307
|
+
width: 100%;
|
|
308
|
+
height: 100%;
|
|
309
|
+
position: relative;
|
|
310
|
+
display: flex;
|
|
311
|
+
flex-direction: column;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.index-module_containerWrapper__49TNa {
|
|
315
|
+
position: relative;
|
|
316
|
+
flex: 1;
|
|
317
|
+
overflow: hidden;
|
|
318
|
+
display: flex;
|
|
319
|
+
flex-direction: column;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.video-tool-spinner {
|
|
323
|
+
height: calc(100vh - 60px);
|
|
324
|
+
}
|
|
325
|
+
.video-tool-spinner .ant-spin-container {
|
|
326
|
+
height: 100%;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.index-module_clipping__M-9B2 {
|
|
330
|
+
position: absolute;
|
|
331
|
+
top: 80px;
|
|
332
|
+
left: 56px;
|
|
333
|
+
width: 72px;
|
|
334
|
+
height: 24px;
|
|
335
|
+
}
|
|
336
|
+
.index-module_videoTimeSlices__v-2k1 {
|
|
337
|
+
position: absolute;
|
|
338
|
+
top: 0;
|
|
339
|
+
right: 0;
|
|
340
|
+
max-width: 416px;
|
|
341
|
+
max-height: 80%;
|
|
342
|
+
padding-right: 4px;
|
|
343
|
+
overflow: auto;
|
|
344
|
+
z-index: 22;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.index-module_timeSliceWrapper__kebC3 {
|
|
348
|
+
min-height: 80px;
|
|
349
|
+
margin-bottom: 8px;
|
|
350
|
+
transition: opacity 0.4s ease-in-out;
|
|
351
|
+
opacity: 0.9;
|
|
352
|
+
}
|
|
353
|
+
.index-module_timeSliceWrapper__kebC3 .index-module_timeSliceItemText__FJFwH,
|
|
354
|
+
.index-module_timeSliceWrapper__kebC3 .index-module_timeSliceItemAttribute__--3E1 {
|
|
355
|
+
min-height: 40px;
|
|
356
|
+
font-size: 16px;
|
|
357
|
+
color: white;
|
|
358
|
+
word-break: break-all;
|
|
359
|
+
}
|
|
360
|
+
.index-module_timeSliceWrapper__kebC3 .index-module_timeSliceItemText__FJFwH {
|
|
361
|
+
background-color: #CCC;
|
|
362
|
+
padding: 8px 24px;
|
|
363
|
+
}
|
|
364
|
+
.index-module_timeSliceWrapper__kebC3 .index-module_timeSliceItemAttribute__--3E1 span {
|
|
365
|
+
display: inline-block;
|
|
366
|
+
height: 40px;
|
|
367
|
+
line-height: 40px;
|
|
368
|
+
padding: 0 24px;
|
|
369
|
+
}
|
|
131
370
|
.index-module_speedControllerWrap__aFz7r {
|
|
132
371
|
display: flex;
|
|
133
372
|
color: white;
|
|
@@ -1724,7 +1963,7 @@
|
|
|
1724
1963
|
|
|
1725
1964
|
.textInputContainer {
|
|
1726
1965
|
padding: 20px;
|
|
1727
|
-
height:
|
|
1966
|
+
height: auto;
|
|
1728
1967
|
overflow-y: scroll;
|
|
1729
1968
|
}
|
|
1730
1969
|
|
|
@@ -1754,6 +1993,13 @@
|
|
|
1754
1993
|
overflow-y: scroll;
|
|
1755
1994
|
}
|
|
1756
1995
|
|
|
1996
|
+
.textToolSwitchItem {
|
|
1997
|
+
display: flex;
|
|
1998
|
+
justify-content: space-between;
|
|
1999
|
+
margin-top: 20px;
|
|
2000
|
+
font-size: 12px;
|
|
2001
|
+
}
|
|
2002
|
+
|
|
1757
2003
|
.textareaContainer {
|
|
1758
2004
|
position: relative;
|
|
1759
2005
|
padding: 0;
|
|
@@ -1978,11 +2224,20 @@
|
|
|
1978
2224
|
flex-direction: column;
|
|
1979
2225
|
background-color: black;
|
|
1980
2226
|
overflow: hidden;
|
|
2227
|
+
flex: 1 1;
|
|
1981
2228
|
}
|
|
1982
2229
|
.bee-video-wrapper .bee-video-container {
|
|
1983
|
-
|
|
2230
|
+
height: calc(100% - 80px);
|
|
1984
2231
|
overflow: hidden;
|
|
1985
2232
|
position: relative;
|
|
2233
|
+
display: flex;
|
|
2234
|
+
flex-direction: column;
|
|
2235
|
+
}
|
|
2236
|
+
.bee-video-wrapper .bee-video-container .bee-video {
|
|
2237
|
+
flex: 1 1;
|
|
2238
|
+
}
|
|
2239
|
+
.bee-video-wrapper .bee-video-container .bee-video-track {
|
|
2240
|
+
height: calc(100% - 90px - 24px);
|
|
1986
2241
|
}
|
|
1987
2242
|
|
|
1988
2243
|
.bee-video-progress {
|
|
@@ -2030,7 +2285,10 @@
|
|
|
2030
2285
|
}
|
|
2031
2286
|
|
|
2032
2287
|
.bee-video-controller__wrapper {
|
|
2033
|
-
position:
|
|
2288
|
+
position: absolute;
|
|
2289
|
+
bottom: 0px;
|
|
2290
|
+
left: 0px;
|
|
2291
|
+
right: 0px;
|
|
2034
2292
|
}
|
|
2035
2293
|
|
|
2036
2294
|
.bee-video-controller {
|
|
@@ -2568,7 +2826,7 @@
|
|
|
2568
2826
|
margin-bottom: 24px;
|
|
2569
2827
|
width: 100%;
|
|
2570
2828
|
}
|
|
2571
|
-
.bee-
|
|
2829
|
+
.bee-LLMView .bee-LLMView-tag {
|
|
2572
2830
|
color: #666FFF;
|
|
2573
2831
|
background: #eeefff;
|
|
2574
2832
|
height: 20px;
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";import{i18n as c}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import n,{useState as d,useImperativeHandle as m}from"react";import{I18nextProvider as f}from"react-i18next";import{Provider as u}from"react-redux";import w from"./App.js";import x from"./configureStore.js";import{PageBackward as
|
|
1
|
+
export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";import{i18n as c}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import n,{useState as d,useImperativeHandle as m}from"react";import{I18nextProvider as f}from"react-i18next";import{Provider as u}from"react-redux";import w from"./App.js";import x from"./configureStore.js";import{PageBackward as g,PageForward as P,PageJump as v}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as _}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as T}from"./store/ctx.js";export{default as PredictTracking}from"./components/predictTracking/predictTrackingIcon/index.js";export{default as LLMToolView}from"./components/LLMToolView/index.js";export{default as SwitchCuboidBoxIn2DView}from"./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var j=Object.defineProperty,V=Object.defineProperties,b=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,s=(o,e,t)=>e in o?j(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,A=(o,e)=>{for(var t in e||(e={}))I.call(e,t)&&s(o,t,e[t]);if(p)for(var t of p(e))O.call(e,t)&&s(o,t,e[t]);return o},E=(o,e)=>V(o,b(e));const r=x(),y=(o,e)=>{const[t,l]=d();return m(e,()=>({toolInstance:t,annotationEngine:r.getState().annotation.annotationEngine,pageBackwardActions:()=>r.dispatch(g()),pageForwardActions:()=>r.dispatch(P()),pageJump:a=>{const i=~~a-1;r.dispatch(v(i))},hello:()=>alert("hello labelBee!!!")}),[t]),n.createElement(u,{store:r,context:T},n.createElement(f,{i18n:c},n.createElement(_,null,n.createElement(w,E(A({},o),{setToolInstance:a=>{var i;l(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}})))))};var C=n.forwardRef(y);export{C as default,r as store};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFormatSize as Et}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import St from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as i}from"../Actions.js";import{jsonParser as U}from"../../utils/index.js";import W from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as At}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as lt,composeResult as Y}from"../../utils/data.js";import N from"../../utils/StepUtils.js";import J from"../../utils/ToolUtils.js";import{MathUtils as it,CommonToolUtils as Dt,AnnotationEngine as vt,ImgUtils as yt}from"@labelbee/lb-annotation";import{PointCloudUtils as rt,i18n as F}from"@labelbee/lb-utils";import{Modal as ut}from"antd";import{message as at}from"antd/es";import ct from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as dt}from"../../data/enums/ToolType.js";var Rt=Object.defineProperty,Pt=Object.defineProperties,Ct=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,gt=(t,e,r)=>e in t?Rt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))ht.call(e,r)&>(t,r,e[r]);if(pt)for(var r of pt(e))Ot.call(e,r)&>(t,r,e[r]);return t},l=(t,e)=>Pt(t,Ct(e)),_t=(t,e,r)=>new Promise((E,d)=>{var f=m=>{try{A(r.next(m))}catch(y){d(y)}},S=m=>{try{A(r.throw(m))}catch(y){d(y)}},A=m=>m.done?E(m.value):Promise.resolve(m.value).then(f,S);A((r=r.apply(t,e)).next())});const B=(t,e)=>t.find(r=>r.step===e),It={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},bt=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},mt=(t,e)=>t.reduce((r,E)=>{if(E){const d=E.result;if(U(d)[`step_${e}`])return r+1}return r},0)/t.length,Ut=(t,e)=>{const{step:r,stepList:E}=t,d=N.getCurrentStepInfo(r,E),f=At.jsonParser(d.config);if(J.isVideoTool(d==null?void 0:d.tool)||J.isAudioTool(d==null?void 0:d.tool)||J.isPointCloudTool(d==null?void 0:d.tool)||dt.LLM===(d==null?void 0:d.tool))return;const S=document.getElementById("toolContainer");if(!S)throw"Not exist dom named id-toolContainer";const A=Et({width:window.innerWidth,height:window.innerHeight}),m=new vt({container:S,toolName:d.tool,size:A,imgNode:e,config:f,style:JSON.parse(St)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},Nt=(t,e)=>(r,E)=>_t(void 0,null,function*(){var d;const{stepList:f,step:S}=E().annotation,A=N.currentToolIsVideo(S,f),m=N.currentToolIsPointCloud(S,f),y=((d=N.getCurrentStepInfo(S,f))==null?void 0:d.tool)===dt.LLM,h=N.currentToolIsAudio(S,f);if($(r,!0),yield r(Bt(t)),A||m||y||h){r(wt(t));return}r(xt(t,e))}),Bt=t=>(e,r)=>_t(void 0,null,function*(){const{getFileData:E,imgList:d}=r().annotation;if(E){const f=yield E(d[t],t);e({type:i.SET_FILE_DATA,payload:{fileData:f,index:t}})}}),wt=t=>e=>{$(e,!1),e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},xt=(t,e)=>(r,E)=>{var d;const{toolInstance:f,imgList:S}=E().annotation,A=(d=S==null?void 0:S[t])==null?void 0:d.url;yt.load(A).then(m=>{$(r,!1),r({type:i.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),f==null||f.setErrorImg(),r({type:i.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Ft=({toolInstance:t,imgList:e,imgIndex:r,stepList:E,step:d=1})=>{var f,S,A,m;const y=((f=e[r])==null?void 0:f.result)||"",[h,j,G]=(S=t==null?void 0:t.exportData())!=null?S:[],V=(m=(A=t==null?void 0:t.exportCustomData)==null?void 0:A.call(t))!=null?m:{},M=lt(y,j),k=Y(M,{step:d,stepList:E},{rect:h},V);return e.map((w,H)=>H===r?n(l(n({},w),{result:k}),G):n({},w))},jt=(t=n({},It),e)=>{var r,E,d,f,S,A,m,y,h,j,G,V,M,k,w,H,X,q,Z,Q,tt,et,ot;switch(e.type){case i.INIT_ALL_STATE:return n(n({},t),It);case i.UPDATE_TOOL_INSTANCE:return l(n({},t),{toolInstance:e.payload.toolInstance});case i.UPDATE_IMG_LIST:return l(n({},t),{imgList:e.payload.imgList});case i.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=mt(o,s);return l(n({},t),{stepProgress:u})}case i.SUBMIT_FILE_DATA:{const{imgList:o,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:T}=t;if(!p||!o[s])return t;const _=((r=o[s])==null?void 0:r.result)||"",[,g,I]=(E=p==null?void 0:p.exportData())!=null?E:[],L=(f=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?f:{},D=lt(_,g),R=Y(D,{step:u,stepList:a},{rect:T},L),v=t.imgList.map((C,P)=>{if(P===s){const x=W.dataCorrection(R,_,u,a);return n(l(n({},C),{result:x}),I)}return C});if(((S=e.payload)==null?void 0:S.submitType)===K.SyncImgList)return l(n({},t),{imgList:v});c&&c([v[s]],(A=e.payload)==null?void 0:A.submitType,s,v);const O=mt(v,u);return l(n({},t),{stepProgress:O,imgList:v})}case i.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case i.SUBMIT_RESULT:{const{imgList:o,basicIndex:s,resultList:u,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let T=c;if((p==null?void 0:p.length)>0){const _=(y=p[s])==null?void 0:y.id,g=c.map(I=>l(n({},I),{sourceID:_}));T=ct.cloneDeep(u).filter(I=>I.sourceID!==_),T.push(...g)}return l(n({},t),{resultList:T,imgList:o})}case i.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:T,basicResultList:_}=t;if(!o||!c)return t;const g=e.payload.basicIndex,I=(h=_[g])==null?void 0:h.id,L=U((j=u[a])==null?void 0:j.result),D=(T||[]).filter(x=>x.sourceID===I),R=B(p,s),{dataSourceStep:v,tool:O}=R,C=B(p,v);let P=[];return v&&O&&(P=(G=L[`step_${v}`])==null?void 0:G.result,(P==null?void 0:P.length)>0?(c==null||c.setBasicInfo(C.tool,P[g]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),at.info(F.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),l(n({},t),{basicIndex:g})}case i.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return l(n({},t),{triggerEventAfterIndexChanged:!!o})}case i.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return l(n({},t),{imgIndex:e.payload.nextIndex});const c=N.getCurrentStepInfo(s,p),{nextIndex:T,imgNode:_,nextBasicIndex:g,imgError:I}=e.payload,L=g!=null?g:0,D=U((V=o[T])==null?void 0:V.result),R=D[`step_${c.step}`],v=!R,O={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};_&&I!==!0?a==null||a.setImgNode(_,O):u==null||u.setValid(O.valid);const C=B(p,c.step),{dataSourceStep:P,tool:x}=C,nt=B(p,P),st=P&&x,b=(H=(w=D[`step_${P}`])==null?void 0:w.result)!=null?H:[],z=W.getInitialResultList(R==null?void 0:R.result,u,C,b,v);if(a==null||a.launchOperation(),st&&((b==null?void 0:b.length)>0?a==null||a.setBasicInfo(nt.tool,b[L]):(a==null||a.setBasicInfo(nt.tool),a==null||a.forbidOperation(),at.info(F.t("NoDependency")))),c.tool!=="check"){const ft=(q=(X=b[L])==null?void 0:X.id)!=null?q:"",Tt=st?z.filter(Lt=>Dt.isSameSourceID(Lt.sourceID,ft)):z;u==null||u.history.initRecord(z,!0),u==null||u.setResult(Tt)}return l(n({},t),{imgIndex:T,basicIndex:L,basicResultList:b,resultList:z})}case i.UPDATE_ANNOTATION_CONFIG:return l(n({},t),{config:(Z=e.payload.config)!=null?Z:"{}"});case i.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return l(n({},t),{stepList:o})}case i.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return l(n({},t),{stepList:o,step:s})}case i.INIT_TOOL:{const{imgNode:o}=t,s=Ut(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return l(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case i.SET_TOOL:{const o=(Q=e.payload)==null?void 0:Q.instance;return o?l(n({},t),{toolInstance:o}):n({},t)}case i.UPDATE_ON_SUBMIT:return l(n({},t),{onSubmit:e.payload.onSubmit});case i.UPDATE_ON_SAVE:return l(n({},t),{onSave:e.payload.onSave});case i.UPDATE_ON_PAGE_CHANGE:return l(n({},t),{onPageChange:e.payload.onPageChange});case i.SET_PREDICT_RESULT:return l(n({},t),{predictionResult:e.payload.result});case i.SET_PREDICT_RESULT_VISIBLE:return l(n({},t),{predictionResultVisible:e.payload.visible});case i.UPDATE_ON_STEP_CHANGE:return l(n({},t),{onStepChange:e.payload.onStepChange});case i.UPDATE_GET_FILE_DATA:return l(n({},t),{getFileData:e.payload.getFileData});case i.UPDATE_PAGE_SIZE:return l(n({},t),{pageSize:e.payload.pageSize});case i.UPDATE_LOAD_FILE_LIST:return l(n({},t),{loadFileList:e.payload.loadFileList});case i.UPDATE_BEFORE_ROTATE:return l(n({},t),{beforeRotate:e.payload.beforeRotate});case i.UPDATE_PRE_DATA_PROCESS:return l(n({},t),{preDataProcess:e.payload.preDataProcess});case i.SKIP_BEFORE_PAGE_TURNING:return l(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case i.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),l(n({},t),{imgList:a})}case i.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||o==null||o.updateRotate(),t}case i.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(tt=o==null?void 0:o.valid)!=null?tt:!0;return ut.destroyAll(),ut.confirm({content:F.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:F.t("Confirm"),cancelText:F.t("Cancel")}),t}case i.COPY_BACKWARD_RESULT:{const{toolInstance:o,imgIndex:s,imgList:u,step:a}=t;if(!o)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const p=u[s-1].result;if(!p)return t;const c=W.copyResultChange(p,a,(et=u[s].result)!=null?et:"");u[s]=l(n({},u[s]),{result:c});const _=U(c)[`step_${a}`],g=(_==null?void 0:_.result)||[];return o==null||o.setResult(g),o==null||o.history.pushHistory(g),(ot=o==null?void 0:o.asyncData)==null||ot.call(o,u[s]),l(n({},t),{imgList:[...u]})}case i.SET_STEP:{const{stepList:o,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=B(o,u);return s==null||s.setToolName(a.tool,a.config),l(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case i.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return l(n({},t),{loadPCDFileLoading:!!o})}case i.SET_LOADING:{const{loading:o}=e.payload;return l(n({},t),{loading:!!o})}case i.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return l(n({},t),{pointCloudLoading:!!o})}case i.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return l(n({},t),{checkMode:!!o})}case i.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return l(n({},t),{highlightAttribute:o})}case i.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,T=[],_=a.map((g,I)=>{if(it.isInRange(I,u)){const L=l(n({},g),{result:rt.batchUpdateTrackID({id:o,newID:s,result:g.result})});return T.push({imgIndex:I,newInfo:L}),L}return g});return c&&c([_[p]],K.BatchUpdateTrackID,p,_,{updateImgList:T}),l(n({},t),{imgList:_})}case i.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,T=[],_=a.map((g,I)=>{if(it.isInRange(I,u)){const L=l(n({},g),{result:rt.batchUpdateResultByTrackID({id:o,newData:s,result:g.result})});return T.push({imgIndex:I,newInfo:L}),L}return g});return c&&c([_[p]],K.BatchUpdateTrackID,p,_,{updateImgList:T}),l(n({},t),{imgList:_})}case i.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:o,imgList:s,stepList:u,step:a,predictionResult:p}=t,c={};p.forEach(I=>{const{index:L}=I;c[L]=ct.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const T=`step_${a}`,_=[],g=s.map((I,L)=>{if(c[L]){const D=I.result==="{}"?U(Y("",{step:a,stepList:u},{rect:[]},{})):U(I.result);D[T].result.push(c[L]);const R=l(n({},I),{result:JSON.stringify(D)});return _.push({imgIndex:L,newInfo:R}),R}return I});return o==null||o(g,K.BatchUpdateImgList,-1,g,{updateImgList:_}),l(n({},t),{imgList:g})}default:return t}};export{Nt as LoadFileAndFileData,jt as annotationReducer,Ft as composeResultByToolInstance,B as getStepConfig,bt as getTotalPage};
|
|
1
|
+
import{getFormatSize as At}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Dt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as i}from"../Actions.js";import{jsonParser as U}from"../../utils/index.js";import W from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as vt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as rt,composeResult as Y}from"../../utils/data.js";import N from"../../utils/StepUtils.js";import J from"../../utils/ToolUtils.js";import{MathUtils as ut,CommonToolUtils as yt,AnnotationEngine as Rt,ImgUtils as Pt}from"@labelbee/lb-annotation";import{PointCloudUtils as at,i18n as F}from"@labelbee/lb-utils";import{Modal as ct}from"antd";import{message as dt}from"antd/es";import pt from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as _t}from"../../data/enums/ToolType.js";var Ct=Object.defineProperty,ht=Object.defineProperties,Ot=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,It=(t,e,r)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))bt.call(e,r)&&It(t,r,e[r]);if(gt)for(var r of gt(e))Ut.call(e,r)&&It(t,r,e[r]);return t},l=(t,e)=>ht(t,Ot(e)),mt=(t,e,r)=>new Promise((E,d)=>{var f=m=>{try{A(r.next(m))}catch(y){d(y)}},S=m=>{try{A(r.throw(m))}catch(y){d(y)}},A=m=>m.done?E(m.value):Promise.resolve(m.value).then(f,S);A((r=r.apply(t,e)).next())});const B=(t,e)=>t.find(r=>r.step===e),ft={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},Nt=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},Tt=(t,e)=>t.reduce((r,E)=>{if(E){const d=E.result;if(U(d)[`step_${e}`])return r+1}return r},0)/t.length,Bt=(t,e)=>{const{step:r,stepList:E}=t,d=N.getCurrentStepInfo(r,E),f=vt.jsonParser(d.config);if(J.isVideoTool(d==null?void 0:d.tool)||J.isAudioTool(d==null?void 0:d.tool)||J.isPointCloudTool(d==null?void 0:d.tool)||_t.LLM===(d==null?void 0:d.tool))return;const S=document.getElementById("toolContainer");if(!S)throw"Not exist dom named id-toolContainer";const A=At({width:window.innerWidth,height:window.innerHeight}),m=new Rt({container:S,toolName:d.tool,size:A,imgNode:e,config:f,style:JSON.parse(Dt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},wt=(t,e)=>(r,E)=>mt(void 0,null,function*(){var d;const{stepList:f,step:S}=E().annotation,A=N.currentToolIsVideo(S,f),m=N.currentToolIsPointCloud(S,f),y=((d=N.getCurrentStepInfo(S,f))==null?void 0:d.tool)===_t.LLM,h=N.currentToolIsAudio(S,f);if($(r,!0),yield r(xt(t)),A||m||y||h){r(Ft(t));return}r(jt(t,e))}),xt=t=>(e,r)=>mt(void 0,null,function*(){const{getFileData:E,imgList:d}=r().annotation;if(E){const f=yield E(d[t],t);e({type:i.SET_FILE_DATA,payload:{fileData:f,index:t}})}}),Ft=t=>e=>{$(e,!1),e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},jt=(t,e)=>(r,E)=>{var d;const{toolInstance:f,imgList:S}=E().annotation,A=(d=S==null?void 0:S[t])==null?void 0:d.url;Pt.load(A).then(m=>{$(r,!1),r({type:i.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),f==null||f.setErrorImg(),r({type:i.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Gt=({toolInstance:t,imgList:e,imgIndex:r,stepList:E,step:d=1})=>{var f,S,A,m;const y=((f=e[r])==null?void 0:f.result)||"",[h,j,G]=(S=t==null?void 0:t.exportData())!=null?S:[],V=(m=(A=t==null?void 0:t.exportCustomData)==null?void 0:A.call(t))!=null?m:{},M=rt(y,j),k=Y(M,{step:d,stepList:E},{rect:h},V);return e.map((w,H)=>H===r?n(l(n({},w),{result:k}),G):n({},w))},Vt=(t=n({},ft),e)=>{var r,E,d,f,S,A,m,y,h,j,G,V,M,k,w,H,X,q,Z,Q,tt,et,ot,nt,st;switch(e.type){case i.INIT_ALL_STATE:return n(n({},t),ft);case i.UPDATE_TOOL_INSTANCE:return l(n({},t),{toolInstance:e.payload.toolInstance});case i.UPDATE_IMG_LIST:return l(n({},t),{imgList:e.payload.imgList});case i.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=Tt(o,s);return l(n({},t),{stepProgress:u})}case i.SUBMIT_FILE_DATA:{const{imgList:o,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:T}=t;if(!p||!o[s])return t;const g=((r=o[s])==null?void 0:r.result)||"",[,_,I]=(E=p==null?void 0:p.exportData())!=null?E:[],L=(f=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?f:{},D=rt(g,_),R=Y(D,{step:u,stepList:a},{rect:T},L),v=t.imgList.map((C,P)=>{if(P===s){const x=W.dataCorrection(R,g,u,a);return n(l(n({},C),{result:x}),I)}return C});if(((S=e.payload)==null?void 0:S.submitType)===K.SyncImgList)return l(n({},t),{imgList:v});c&&c([v[s]],(A=e.payload)==null?void 0:A.submitType,s,v);const O=Tt(v,u);return l(n({},t),{stepProgress:O,imgList:v})}case i.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case i.SUBMIT_RESULT:{const{imgList:o,basicIndex:s,resultList:u,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let T=c;if((p==null?void 0:p.length)>0){const g=(y=p[s])==null?void 0:y.id,_=c.map(I=>l(n({},I),{sourceID:g}));T=pt.cloneDeep(u).filter(I=>I.sourceID!==g),T.push(..._)}return l(n({},t),{resultList:T,imgList:o})}case i.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:T,basicResultList:g}=t;if(!o||!c)return t;const _=e.payload.basicIndex,I=(h=g[_])==null?void 0:h.id,L=U((j=u[a])==null?void 0:j.result),D=(T||[]).filter(x=>x.sourceID===I),R=B(p,s),{dataSourceStep:v,tool:O}=R,C=B(p,v);let P=[];return v&&O&&(P=(G=L[`step_${v}`])==null?void 0:G.result,(P==null?void 0:P.length)>0?(c==null||c.setBasicInfo(C.tool,P[_]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),dt.info(F.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),l(n({},t),{basicIndex:_})}case i.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return l(n({},t),{triggerEventAfterIndexChanged:!!o})}case i.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return l(n({},t),{imgIndex:e.payload.nextIndex});const c=N.getCurrentStepInfo(s,p),{nextIndex:T,imgNode:g,nextBasicIndex:_,imgError:I}=e.payload,L=_!=null?_:0,D=U((V=o[T])==null?void 0:V.result),R=D[`step_${c.step}`],v=!R,O={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};g&&I!==!0?a==null||a.setImgNode(g,O):u==null||u.setValid(O.valid);const C=B(p,c.step),{dataSourceStep:P,tool:x}=C,lt=B(p,P),it=P&&x,b=(H=(w=D[`step_${P}`])==null?void 0:w.result)!=null?H:[],z=W.getInitialResultList(R==null?void 0:R.result,u,C,b,v);if(a==null||a.launchOperation(),it&&((b==null?void 0:b.length)>0?a==null||a.setBasicInfo(lt.tool,b[L]):(a==null||a.setBasicInfo(lt.tool),a==null||a.forbidOperation(),dt.info(F.t("NoDependency")))),c.tool!=="check"){const Lt=(q=(X=b[L])==null?void 0:X.id)!=null?q:"",Et=it?z.filter(St=>yt.isSameSourceID(St.sourceID,Lt)):z;(Z=u==null?void 0:u.history)==null||Z.initRecord(z,!0),u==null||u.setResult(Et)}return l(n({},t),{imgIndex:T,basicIndex:L,basicResultList:b,resultList:z})}case i.UPDATE_ANNOTATION_CONFIG:return l(n({},t),{config:(Q=e.payload.config)!=null?Q:"{}"});case i.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return l(n({},t),{stepList:o})}case i.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return l(n({},t),{stepList:o,step:s})}case i.INIT_TOOL:{const{imgNode:o}=t,s=Bt(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return l(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case i.SET_TOOL:{const o=(tt=e.payload)==null?void 0:tt.instance;return o?l(n({},t),{toolInstance:o}):n({},t)}case i.UPDATE_ON_SUBMIT:return l(n({},t),{onSubmit:e.payload.onSubmit});case i.UPDATE_ON_SAVE:return l(n({},t),{onSave:e.payload.onSave});case i.UPDATE_ON_PAGE_CHANGE:return l(n({},t),{onPageChange:e.payload.onPageChange});case i.SET_PREDICT_RESULT:return l(n({},t),{predictionResult:e.payload.result});case i.SET_PREDICT_RESULT_VISIBLE:return l(n({},t),{predictionResultVisible:e.payload.visible});case i.UPDATE_ON_STEP_CHANGE:return l(n({},t),{onStepChange:e.payload.onStepChange});case i.UPDATE_GET_FILE_DATA:return l(n({},t),{getFileData:e.payload.getFileData});case i.UPDATE_PAGE_SIZE:return l(n({},t),{pageSize:e.payload.pageSize});case i.UPDATE_LOAD_FILE_LIST:return l(n({},t),{loadFileList:e.payload.loadFileList});case i.UPDATE_BEFORE_ROTATE:return l(n({},t),{beforeRotate:e.payload.beforeRotate});case i.UPDATE_PRE_DATA_PROCESS:return l(n({},t),{preDataProcess:e.payload.preDataProcess});case i.SKIP_BEFORE_PAGE_TURNING:return l(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case i.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),l(n({},t),{imgList:a})}case i.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||(et=o==null?void 0:o.updateRotate)==null||et.call(o),t}case i.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(ot=o==null?void 0:o.valid)!=null?ot:!0;return ct.destroyAll(),ct.confirm({content:F.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:F.t("Confirm"),cancelText:F.t("Cancel")}),t}case i.COPY_BACKWARD_RESULT:{const{toolInstance:o,imgIndex:s,imgList:u,step:a}=t;if(!o)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const p=u[s-1].result;if(!p)return t;const c=W.copyResultChange(p,a,(nt=u[s].result)!=null?nt:"");u[s]=l(n({},u[s]),{result:c});const g=U(c)[`step_${a}`],_=(g==null?void 0:g.result)||[];return o==null||o.setResult(_),o==null||o.history.pushHistory(_),(st=o==null?void 0:o.asyncData)==null||st.call(o,u[s]),l(n({},t),{imgList:[...u]})}case i.SET_STEP:{const{stepList:o,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=B(o,u);return s==null||s.setToolName(a.tool,a.config),l(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case i.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return l(n({},t),{loadPCDFileLoading:!!o})}case i.SET_LOADING:{const{loading:o}=e.payload;return l(n({},t),{loading:!!o})}case i.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return l(n({},t),{pointCloudLoading:!!o})}case i.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return l(n({},t),{checkMode:!!o})}case i.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return l(n({},t),{highlightAttribute:o})}case i.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,T=[],g=a.map((_,I)=>{if(ut.isInRange(I,u)){const L=l(n({},_),{result:at.batchUpdateTrackID({id:o,newID:s,result:_.result})});return T.push({imgIndex:I,newInfo:L}),L}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:T}),l(n({},t),{imgList:g})}case i.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,T=[],g=a.map((_,I)=>{if(ut.isInRange(I,u)){const L=l(n({},_),{result:at.batchUpdateResultByTrackID({id:o,newData:s,result:_.result})});return T.push({imgIndex:I,newInfo:L}),L}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:T}),l(n({},t),{imgList:g})}case i.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:o,imgList:s,stepList:u,step:a,predictionResult:p}=t,c={};p.forEach(I=>{const{index:L}=I;c[L]=pt.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const T=`step_${a}`,g=[],_=s.map((I,L)=>{if(c[L]){const D=I.result==="{}"?U(Y("",{step:a,stepList:u},{rect:[]},{})):U(I.result);D[T].result.push(c[L]);const R=l(n({},I),{result:JSON.stringify(D)});return g.push({imgIndex:L,newInfo:R}),R}return I});return o==null||o(_,K.BatchUpdateImgList,-1,_,{updateImgList:g}),l(n({},t),{imgList:_})}default:return t}};export{wt as LoadFileAndFileData,Vt as annotationReducer,Gt as composeResultByToolInstance,B as getStepConfig,Nt as getTotalPage};
|
package/es/utils/audio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"antd";import{cStyle as b}from"@labelbee/lb-annotation";import"lodash";import
|
|
1
|
+
import"antd";import{cStyle as b}from"@labelbee/lb-annotation";import"lodash";import s from"decimal.js";import c from"moment";const{COLORS_ARRAY:a,ICON_ARRAY:F,INVALID_ICON:k,NULL_COLOR:d,NULL_ICON:D,WHITE_FONT_COLOR_ARRAY:h}=b,p={label:"\u6587\u672C",key:"text",required:!1,default:"",maxLength:1e3},C=(t,e)=>{var r,n;try{const o=i(t,e);return(n=(r=e[o])==null?void 0:r.key)!=null?n:t}catch(o){return t}},i=(t,e)=>{try{return e.findIndex(n=>n.value===t)}catch(r){return-1}},m=(t,e)=>{try{const r=i(t,e);return r===-1?d:a[r%a.length]}catch(r){return d}},I=(t,e)=>{try{const r=m(t,e);return h.includes(r)?"#fff":"#333"}catch(r){return"#333"}},g=(t,e)=>{var r;try{const n=((r=t.match(/\((.*)\)/))==null?void 0:r[1].split(","))||[];return n.splice(3,1,e.toString()),`rgba(${n.join(",")})`}catch(n){return t}},v=(t,e)=>new s(Number(t)||0).minus(Number(e)||0).toNumber(),A=(t,e)=>new s(t).add(e).toNumber(),_=t=>{let e=null;return n=>e?n.target===(e==null?void 0:e.target):(e=n,setTimeout(()=>{e=null},t),!1)},N=_(300),O=t=>{const e=Math.floor(t*1e3),r=c.duration(e);return`${Math.floor(r.asMinutes())}:${c.utc(e).format("ss")}`},x=(t,e="ss.S")=>{const r=Math.floor(t*1e3),n=c.duration(r);return`${y(Math.floor(n.asMinutes()))}:${c.utc(r).format(e)}`},y=t=>t<10?`0${t}`:t,E=(t,e)=>{let r=null,n=null;const o=t.length;if(o===0)return{min:r,max:n};let u=0;return e<t[u]?n=t[u]:(t.forEach((l,f)=>{e>l&&(r=l,u=f)}),r&&u<o-1&&(n=t[u+1])),{min:r,max:n}},R=()=>{const t=document.createEvent("Event");t.initEvent("resize",!0,!0),window.dispatchEvent(t)};function L(t){try{const e=JSON.parse(t);return typeof e.valid=="boolean"?e.valid:!0}catch(e){return!0}}export{p as DEFAULT_TEXT_CONFIG_ITEM,R as dispatchResizeEvent,O as formatTime,m as getAttributeColor,I as getAttributeFontColor,i as getAttributeIndex,C as getAttributeShowText,E as getCanMoveRange,N as isDoubleClick,L as isImageValue,A as precisionAdd,v as precisionMinus,x as timeFormat,g as updateColorOpacity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as
|
|
1
|
+
import{ViewportProvider as S}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as b}from"antd";import{Layout as v}from"antd/es";import t,{useState as A}from"react";import O from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import V from"./sidebar/index.js";import h from"./toolFooter/index.js";import k from"./toolHeader/index.js";import{getStepConfig as _}from"../../store/annotation/reducer.js";import F from"../../components/videoAnnotate/index.js";import{connect as I}from"react-redux";import y from"../../utils/ToolUtils.js";import $ from"../../components/pointCloudView/index.js";import{getClassName as H}from"../../utils/dom.js";import{classnames as R}from"../../utils/index.js";import W from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as B}from"../../store/ctx.js";import{EToolName as E}from"../../data/enums/ToolType.js";import D from"./LLMLayout/index.js";import U from"../../components/audioAnnotate/index.js";import{LoadingOutlined as p}from"@ant-design/icons";import{useTranslation as z}from"react-i18next";import{EPointCloudName as q}from"@labelbee/lb-annotation";var G=Object.defineProperty,T=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,x=(e,o,n)=>o in e?G(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,a=(e,o)=>{for(var n in o||(o={}))J.call(o,n)&&x(e,n,o[n]);if(T)for(var n of T(o))K.call(o,n)&&x(e,n,o[n]);return e};const{Sider:Q,Content:X}=v,s=`${C}-layout`,Y=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(O,a({},e)),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},Z=e=>{var o;return t.createElement(t.Fragment,null,t.createElement($,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},ee=e=>{var o;const{stepList:n,step:i}=e,r=(o=_(n,i))==null?void 0:o.tool,d=y.isPointCloudTool(r),l=y.isVideoTool(r);return d?t.createElement(Z,a({},e)):l?t.createElement(F,{drawLayerSlot:e.drawLayerSlot,footer:e.footer}):t.createElement(Y,a({},e))},L=e=>{var o,n,i;const{t:r}=z(),{stepList:d,step:l}=e,m=(o=_(d,l))==null?void 0:o.tool,c=![E.LLM].includes(m),u=![E.LLM].includes(m),f=[q.PointCloud].includes(m);return t.createElement(S,null,t.createElement(b,{spinning:e.loading,indicator:t.createElement(p,null),tip:t.createElement("span",{style:{marginTop:200}},r("LoadingTips")),delay:500},t.createElement(v,{className:R([s,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${s}__header`,style:(i=e.style)==null?void 0:i.header},t.createElement(k,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:c,hasHeaderOption:u,hasPredictTrackingIcon:f})),e.children)))},te=e=>{var o,n,i,r,d,l,m;const[c,u]=A(void 0),f=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:w,step:j}=e,g=(i=_(w,j))==null?void 0:i.tool,P=E.LLM===g,N=y.isAudioTool(g);return P?t.createElement(L,a({},e),t.createElement(D,a({},e))):N?t.createElement(L,a({},e),t.createElement(U,a({},e))):t.createElement(L,a({},e),t.createElement(v,{className:H("layout","container")},e==null?void 0:e.leftSider,t.createElement(X,{className:`${s}__content`},t.createElement(ee,a({},e)),t.createElement(W,null)),t.createElement(Q,{className:`${s}__side`,width:(r=c!=null?c:f)!=null?r:240,style:(d=e.style)==null?void 0:d.sider},t.createElement(V,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:u,propsSiderWidth:(m=(l=e.style)==null?void 0:l.sider)==null?void 0:m.width}))))},oe=({annotation:e})=>{var o,n,i;const{imgList:r,loading:d}=e,l=(o=r[e.imgIndex])!=null?o:{};return{path:(i=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?i:"",loading:d}};var ne=I(oe,null,null,{context:B})(te);export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o,{useState as a,useEffect as
|
|
1
|
+
import o,{useState as a,useEffect as u}from"react";import{message as m}from"antd/es";import x from"../TextAreaFormat/index.js";import{TextUtils as l}from"../../../../utils/TextUtils.js";import{connect as c}from"react-redux";import{LabelBeeContext as s}from"../../../../store/ctx.js";const f=({toolInstance:e})=>{var i;const[,n]=a(0);if(u(()=>{e&&(e.singleOn("selectedChange",()=>{n(r=>r+1)}),e.singleOn("updateTextAttribute",()=>{n(r=>r+1)}),e.singleOn("messageError",r=>{m.error(r)}))},[e]),!e)return null;const{config:t}=e;return((i=e==null?void 0:e.config)==null?void 0:i.textConfigurable)&&e.selectedID&&o.createElement(x,{onChange:e.textChange,textValue:e.selectedText,checkString:l.checkString(t==null?void 0:t.textCheckType,t==null?void 0:t.customFormat),textCheckType:t.textCheckType})};function d(e){return{toolInstance:e.annotation.toolInstance}}var g=c(d,null,null,{context:s})(f);export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m,{useState as d,useRef as p,useEffect as v}from"react";import{connect as S}from"react-redux";import A from"../../../../components/attributeList/index.js";import g from"../../../../utils/StepUtils.js";import{jsonParser as I}from"../../../../utils/index.js";import{useTranslation as x}from"react-i18next";import{EToolName as L}from"../../../../data/enums/ToolType.js";import{LabelBeeContext as h}from"../../../../store/ctx.js";const T=t=>{var o;const[c,i]=d(0),l=p(null),{toolInstance:e}=t,{t:f}=x();if(v(()=>(e&&e.singleOn("changeAttributeSidebar",a=>{var s;i(n=>n+1),!!l.current&&((s=l.current.children[a])==null||s.scrollIntoView({block:"center"}))}),()=>{e==null||e.unbindAll("changeAttributeSidebar")}),[e,l]),!t.stepInfo)return null;const r=I(t.stepInfo.config),u=t.stepInfo.tool===L.ScribbleTool;if(r.attributeConfigurable!==!0&&!u)return null;if((r.attributeConfigurable===!0||u)&&(r==null?void 0:r.attributeList)){const a=r.attributeList.map(n=>({label:n.key,value:n.value,color:n==null?void 0:n.color}));u||a.unshift({label:f("NoAttribute"),value:""});const s=n=>{e.setDefaultAttribute(n),i(b=>b+1)};return m.createElement(A,{list:a,attributeChanged:s,selectedAttribute:(o=e==null?void 0:e.defaultAttribute)!=null?o:"",ref:l,forbidDefault:u})}return null},j=t=>{var o,c;const i=g.getCurrentStepInfo((o=t.annotation)==null?void 0:o.step,(c=t.annotation)==null?void 0:c.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:i}};var C=S(j,null,null,{context:h})(T);export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import K from"../../../../components/attributeList/index.js";import M from"../../../../components/checkboxList/index.js";import{CaretRightOutlined as P}from"@ant-design/icons";import{Collapse as T,Tooltip as H,Badge as x}from"antd/es";import{cloneDeep as F}from"lodash";import n,{useState as
|
|
1
|
+
import K from"../../../../components/attributeList/index.js";import M from"../../../../components/checkboxList/index.js";import{CaretRightOutlined as P}from"@ant-design/icons";import{Collapse as T,Tooltip as H,Badge as x}from"antd/es";import{cloneDeep as F}from"lodash";import n,{useState as v,useRef as U,useEffect as p,useCallback as q}from"react";import z from"../../../../assets/annotation/common/icon_clearSmall.svg.js";import G from"../../../../assets/annotation/common/icon_clearSmall_a.svg.js";import{TagUtils as J}from"@labelbee/lb-annotation";import{connect as Q}from"react-redux";import{useTranslation as V}from"react-i18next";import{LabelBeeContext as W}from"../../../../store/ctx.js";const{Panel:X}=T,$=({isActive:a})=>n.createElement(P,{rotate:a?90:0}),Y=({toolInstance:a,imgIndex:N})=>{const[s,g]=v([]),i=U(null),[,j]=v(0),[w,f]=v(-1),{t:b}=V();p(()=>{var r,t;a&&(g((t=(r=a.config)==null?void 0:r.inputList)==null?void 0:t.map(e=>e.value)),a.singleOn("render",()=>{j(e=>e+1)}))},[a]),p(()=>{if(a&&(a.singleOn("expend",O),a.labelSelectedList.length===1)){let r=0;for(let t=0;t<a.labelSelectedList[0];t++)r+=46,o[t]&&s[t]!==""&&o[t].subSelected.forEach(e=>{r+=40});i.current&&(i.current.children[0].scrollTop=r)}}),p(()=>{i.current&&(i.current.children[0].scrollTop=0)},[N]);const O=()=>{var r;const t=a.labelSelectedList[0],e=(r=o.filter((l,m)=>m===t)[0])==null?void 0:r.value;h(t,e,!0)},h=q((r,t,e)=>{const l=F(s);l[r]===""||e===!0?l[r]=t:l[r]="",g(l)},[s]);if(!a)return null;const{labelSelectedList:u,config:{inputList:o},currentTagResult:c,setLabel:E}=a,A=r=>u.length>0&&u[0]===r?n.createElement("span",{className:"keyDownIconActive"},r+1):n.createElement("span",{className:"keyDownIcon"},r+1),y=(r,t=-1)=>r?r.map((e,l)=>{var m,L,_,k,C;if(e.subSelected){const R=J.judgeResultIsInInputList(e.value,(m=c==null?void 0:c.result)==null?void 0:m[e.value],o);return n.createElement(T,{bordered:!1,expandIcon:$,key:`collapse_${l}_${t+1}`,onChange:()=>h(l,e.value),activeKey:[s[l]]},n.createElement(X,{header:n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flex:1}},n.createElement("span",null,e.key,n.createElement(H,{placement:"bottom",title:b("ClearThisOption")},n.createElement("img",{style:{marginLeft:5,cursor:"pointer"},onClick:D=>{D.stopPropagation(),a.clearResult(!0,e.value)},src:w===l||R?G:z,onMouseEnter:()=>{f(l)},onMouseLeave:()=>{f(-1)}})),R&&s[l]===""&&n.createElement(x,{color:"#87d068"})),(o==null?void 0:o.length)>1&&A(l)),key:e.value},n.createElement("div",{className:"level",style:{backgroundColor:u.length>0&&u[0]===l?"rgba(158, 158, 158, 0.18)":""}},y(e.subSelected,l))))}const d=(o==null?void 0:o[t])?o==null?void 0:o[t].value:0,S=((k=(_=(L=c==null?void 0:c.result)==null?void 0:L[d])==null?void 0:_.split(";"))==null?void 0:k.indexOf(e.value))>-1?e.value:"";return((C=o==null?void 0:o[t])==null?void 0:C.isMulti)===!0?n.createElement("div",{className:"singleBar",key:`${d}_${t}_${l}`},n.createElement(M,{attributeChanged:()=>E(t,l),selectedAttribute:[S],list:[{value:e.value,label:e.key}],num:l+1})):n.createElement("div",{className:"singleBar",key:`${d}_${t}_${l}`},n.createElement(K,{forbidColor:!0,attributeChanged:()=>E(t,l),selectedAttribute:S,list:[{value:e.value,label:e.key}],num:l+1}))}):null,B=window.innerHeight-61-80;return n.createElement("div",{className:"tagOperationMenu",ref:i},(o==null?void 0:o.length)===0?n.createElement("div",{style:{padding:20,textAlign:"center"}},b("NoConfiguration")):n.createElement("div",{className:"main",style:{height:B}},y(o)))};function Z(a){return{toolInstance:a.annotation.toolInstance,imgIndex:a.annotation.imgIndex}}var I=Q(Z,null,null,{context:W})(Y);export{I as default,$ as expandIconFuc};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o,{useState as u,useEffect as h,useRef as I}from"react";import{connect as M}from"react-redux";import{cloneDeep as z}from"lodash";import{classnames as S}from"../../../../utils/index.js";import{Switch as W,Input as J}from"antd/es";import{cKeyCode as G,cTool as H}from"@labelbee/lb-annotation";import{PageForward as Q}from"../../../../store/annotation/actionCreators.js";import{ConfigUtils as X}from"../../../../utils/ConfigUtils.js";import{useTranslation as A}from"react-i18next";import{LabelBeeContext as Y}from"../../../../store/ctx.js";var Z=Object.defineProperty,K=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,$=(e,t,r)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ne=(e,t)=>{for(var r in t||(t={}))ee.call(t,r)&&$(e,r,t[r]);if(K)for(var r of K(t))te.call(t,r)&&$(e,r,t[r]);return e};const j=G.default,{EVideoToolName:oe}=H,V=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},D=e=>{const{textareaProps:t,footer:r}=e;return o.createElement(o.Fragment,null,o.createElement(J.TextArea,ne({key:`${t.id}-${t.defaultValue}`,bordered:!1,rows:6,onKeyDown:V,onKeyUp:V},t)),o.createElement("div",{className:S({textAreaLength:!0})},r))},q=e=>{var t;const r=I(null),[E,m]=u(!1),[N,P]=u(!1),{t:w}=A(),{disabled:s,config:i,result:f,updateText:p,index:d,switchToNextTextarea:y,hasMultiple:L,onNext:b}=e,{maxLength:g}=i,c=f?f[i.key]:"",[C,_]=u((t=c==null?void 0:c.length)!=null?t:0);h(()=>{var n;_((n=c==null?void 0:c.length)!=null?n:0)},[c]);const v=(n,T)=>{p&&(p(n,i.key,T),i.required&&P(!n))},x=L&&y,k={id:`textInput-${d}`,ref:r,disabled:s,defaultValue:c,maxLength:g,autoSize:{minRows:2,maxRows:6},onChange:n=>{const T=n.target.value;_(n.target.value.length),v(T,!1)},onFocus:()=>{m(!0)},onBlur:n=>{m(!1),v(n.target.value,!0),i.required&&P(!n.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:n=>{n.ctrlKey&&n.keyCode===j.Enter&&(b&&b(),n.preventDefault()),n.keyCode===j.Tab&&x&&(n.preventDefault(),n.nativeEvent.stopImmediatePropagation(),y(d)),n.nativeEvent.stopPropagation()}},F=o.createElement("div",{className:"textAreaFooter"},o.createElement("div",{className:"hotkeyTip"},x&&o.createElement("span",null,`[${w("Switch")}]Tab`),o.createElement("span",null,`[${w("TurnPage")}]Ctrl+Enter`)),o.createElement("div",{className:"wordCount"},o.createElement("span",{className:C>=g?"warning":""},C),"/",o.createElement("span",null,g)));return h(()=>{s&&m(!1)},[s]),o.createElement("div",{className:"textField"},o.createElement("div",{className:"label"},o.createElement("span",{className:S({required:i.required})},i.label),o.createElement("i",{className:S({clearText:!0,disabled:s}),onClick:()=>{s||v("",!0)}})),o.createElement("div",{className:S({disabled:s,"textarea-outline":!0,"ant-input-focused":E,textareaContainer:!0,focus:E,invalid:N})},o.createElement(D,{footer:F,textareaProps:k})))},ae=({toolInstance:e,imgIndex:t,dispatch:r,triggerEventAfterIndexChanged:E,step:m,stepList:N,basicResultList:P,disabled:w})=>{var s,i,f,p;const[d,y]=u([]),[L,b]=u(0),[g,c]=u(!0),[,C]=u(0),{t:_}=A(),v=a=>{const l=(a+1)%d.length;x(l)},x=a=>{setTimeout(()=>{const l=document.getElementById(`textInput-${a}`);l&&(b(a),l.focus(),l.select(),l.scrollIntoView({behavior:"smooth",block:"center"}))})};h(()=>{e&&e.singleOn("valueUpdated",()=>{C(a=>a+1)})},[e]),h(()=>{var a;e&&y(z((a=e==null?void 0:e.config)==null?void 0:a.configList))},[JSON.stringify((s=e==null?void 0:e.config)==null?void 0:s.configList)]);const k=(p=(f=(i=e==null?void 0:e.textList)==null?void 0:i[0])==null?void 0:f.value)!=null?p:{},F=(a,l,U=!1)=>{var O,R;(R=e==null?void 0:e.updateTextValue)==null||R.call(e,l,a,U,(O=e==null?void 0:e.textList)==null?void 0:O[0])};h(()=>{t>-1&&E&&x(0)},[t]);const n=()=>{r(Q(!0))},T=a=>{c(a),e==null||e.toggleShowText(a)},B=X.getStepConfig(N,m).tool===oe.VideoTextTool;return e&&o.createElement("div",{className:"textToolOperationMenu"},d.map((a,l)=>o.createElement(q,{config:a,key:a.key,index:l,result:k,updateText:F,switchToNextTextarea:v,hasMultiple:d.length>1,focus:L===l,onNext:n,disabled:w})),B&&o.createElement("div",{className:"textToolSwitchItem"},_("toggleShowText"),o.createElement(W,{style:{alignSelf:"center"},checked:g,onChange:a=>{T(a)}})))};function re(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex,step:e.annotation.step,basicResultList:e.annotation.basicResultList,stepList:e.annotation.stepList,triggerEventAfterIndexChanged:e.annotation.triggerEventAfterIndexChanged}}var le=M(re,null,null,{context:Y})(ae);export{q as SingleTextInput,D as TextareaWithFooter,le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{prefix as
|
|
1
|
+
import{prefix as F}from"../../../constant/index.js";import{EToolName as r}from"../../../data/enums/ToolType.js";import K from"../../../utils/StepUtils.js";import{Collapse as d}from"antd/es";import e,{useState as R}from"react";import{useTranslation as z}from"react-i18next";import D from"./AnnotationText/index.js";import G from"./ClearIcon/index.js";import U,{PointCloudOperation as N}from"./GeneralOperation/index.js";import q from"./ImgAttributeInfo/index.js";import H from"./SwitchAttributeList/index.js";import u,{expandIconFuc as j}from"./TagSidebar/index.js";import p from"./TextToolSidebar/index.js";import _ from"./PointCloudToolSidebar/index.js";import J from"./ToolStyle/index.js";import{cTool as Q}from"@labelbee/lb-annotation";import W from"./ScribbleSidebar/index.js";import{ToolIcons as X}from"./ToolIcons.js";import{useSelector as Y}from"../../../store/ctx.js";import{Tabs as $}from"antd";import{classnames as Z}from"../../../utils/index.js";import I from"../../../assets/annotation/common/icon_menu_fold.svg.js";import ee from"../../../components/LLMToolView/sidebar/index.js";import te from"../../../components/videoAnnotate/videoClipTool/components/annotatedList/index.js";const{EVideoToolName:f,EPointCloudName:ne}=Q,{Panel:L}=d,t=`${F}-sidebar`,oe=({sider:i,enableColorPicker:A,setSiderWidth:E,propsSiderWidth:re,checkMode:P})=>{const b=Y(o=>K.getCurrentStepInfo(o.annotation.step,o.annotation.stepList)),[s,w]=R(!0),n=b==null?void 0:b.tool,{t:x}=z();if(!n)return null;const V=o=>{const c=e.createElement(J,null);return e.createElement(L,{header:x("Style"),className:"panel",key:o},c)},T=e.createElement(X,{toolName:n,onChange:()=>{}}),a=e.createElement(H,null),S=e.createElement(D,null),g=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:j},V("1")),h=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:j},e.createElement(L,{header:e.createElement("div",null,x("Adjust"),e.createElement(G,null)),className:"panel",key:"imgAttribute"},e.createElement(q,null))),l=e.createElement(U,null),k=e.createElement(u,null),B=o=>e.createElement(p,{disabled:o}),v=e.createElement(W,{onChange:(o,c)=>{}}),C=e.createElement(te,null),y=e.createElement(ee,{checkMode:P}),m=e.createElement("div",{className:`${t}__horizontal`}),M=e.createElement(_,{enableColorPicker:A}),O=e.createElement(N,null);if(i)return typeof i=="function"?e.createElement("div",{className:`${t}`},i({toolIcon:T,attributeList:a,annotationText:S,toolStyle:g,imageAttributeInfo:h,operation:l,tagToolSideBar:k,textToolSideBar:B,horizontal:m,pointCloudToolSidebar:M,pointCloudOperation:O,scribbleSidebar:v,LLMSidebar:y,videoClipSidebar:C})):i;if([r.Rect,r.Point,r.Line,r.Rect,r.Polygon,r.Cuboid].includes(n))return e.createElement("div",{className:`${t}`},T,m,a,S,m,e.createElement("div",{className:`${t}__content`},g,h),l);if(n===r.Tag)return e.createElement("div",{className:`${t}`},e.createElement(u,null));if(n===f.VideoClipTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},C,a),l);if(n===f.VideoTagTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(u,null)),l);if(n===f.VideoTextTool)return e.createElement("div",{className:`${t}`},e.createElement(p,null));if(n===r.Text)return e.createElement("div",{className:`${t}`},"s",e.createElement(p,null));if(n===ne.PointCloud){const o=()=>{w(!s),E&&E(s?48:void 0)},c=e.createElement("div",{style:{width:"48px",height:"100%",display:"flex",justifyContent:"center",background:"#ffffff"}},e.createElement("span",{onClick:()=>o()},e.createElement("img",{style:{width:"16px",height:"16px",marginTop:"18px",cursor:"pointer",transform:"rotate(180deg)"},src:I})));return s?e.createElement($,{type:"card",activeKey:"1",className:Z({[`${t}`]:!0,[`${t}__pointCloud`]:!0}),tabBarExtraContent:{left:e.createElement("span",{onClick:()=>o(),style:{padding:"0px 4px"}},e.createElement("img",{style:{width:"16px",height:"16px",marginLeft:"4px",cursor:"pointer"},src:I}))}},e.createElement($.TabPane,{tab:"\u5DE5\u5177\u9762\u677F",key:"1",style:{height:"100%",display:"flex",flexDirection:"column"}},e.createElement("div",{className:`${t}__content`},e.createElement(_,null)),e.createElement(N,null))):c}return n===r.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},v,a),l):n===r.LLM?y:null};export{oe as default,t as sidebarCls};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0-alpha.10",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,27 +43,29 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.
|
|
47
|
-
"@labelbee/lb-utils": "1.
|
|
46
|
+
"@labelbee/lb-annotation": "1.25.0-alpha.2",
|
|
47
|
+
"@labelbee/lb-utils": "1.17.0-alpha.1",
|
|
48
48
|
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
|
+
"@types/react-transition-group": "^4.4.9",
|
|
50
51
|
"ahooks": "^3.4.0",
|
|
51
52
|
"classnames": "^2.3.0",
|
|
52
53
|
"decimal.js": "^10.4.3",
|
|
53
54
|
"github-markdown-css": "^5.2.0",
|
|
54
55
|
"lodash": "^4.17.21",
|
|
55
56
|
"postcss-url": "^10.1.3",
|
|
57
|
+
"re-resizable": "^6.9.9",
|
|
56
58
|
"react-colorful": "^5.6.1",
|
|
57
59
|
"react-i18next": "^11.12.0",
|
|
58
60
|
"react-markdown": "^8.0.7",
|
|
59
61
|
"react-redux": "^7.2.3",
|
|
60
62
|
"react-syntax-highlighter": "^15.5.0",
|
|
63
|
+
"react-transition-group": "^4.4.5",
|
|
61
64
|
"redux": "^4.0.5",
|
|
62
65
|
"redux-actions": "^2.6.5",
|
|
63
66
|
"redux-thunk": "^2.3.0",
|
|
64
67
|
"rehype-katex": "^6.0.3",
|
|
65
68
|
"diff-match-patch": "^1.0.5",
|
|
66
|
-
"re-resizable": "^6.9.9",
|
|
67
69
|
"remark-math": "^5.1.1",
|
|
68
70
|
"remark-gfm": "^3.0.1",
|
|
69
71
|
"resize-observer-polyfill": "^1.5.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),StepUtils=require("../../utils/StepUtils.js"),index=require("../../utils/index.js"),index$1=require("./index.js"),VideoTagLayer=require("./VideoTagLayer.js"),_=require("lodash"),utils=require("./utils.js");function _interopDefaultLegacy(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_);class TagToolInstanceAdaptor extends React__default.default.Component{constructor(i){super(i);this.fns={},this.labelSelectedList=[],this.clearResult=(t=!0,e)=>{const s=e?this.state.tagResult.map(l=>((l==null?void 0:l.result[e])&&delete l.result[e],l)):[];this.setState({tagResult:s},()=>this.emitEvent("render"))},this.exportData=()=>{var t,e,s,l,o,n,r;const a=(e=(t=this.videoRef)==null?void 0:t.duration)!=null?e:0,d=(s=this.videoRef)==null?void 0:s.getVideoPlaybackQuality(),u=d==null?void 0:d.totalVideoFrames,c=(o=(l=this.videoRef)==null?void 0:l.videoWidth)!=null?o:0,v=(r=(n=this.videoRef)==null?void 0:n.videoHeight)!=null?r:0;return[this.state.tagResult,{valid:this.state.valid,duration:a,frames:u,videoWidth:c,videoHeight:v}]},this.emitEvent=t=>{this.fns[t]&&this.fns[t]()},this.combineResult=(t,e={})=>{var s,l;const{isMulti:o}=t,{key:n,value:r}=t.value;if(o){let a=(l=(s=e[n])==null?void 0:s.split(";"))!=null?l:[];a.includes(r)?a=a.filter(u=>u!==r):a.push(r);const d=new Set(a);return e[n]=Array.from(d).join(";"),___default.default.pickBy(e,u=>u)}return e[n]=e[n]===r?void 0:r,___default.default.pickBy(e,a=>a)},this.setResult=t=>{this.setState({tagResult:t}),this.fns.render&&this.fns.render()},this.setLabel=(t,e)=>{this.setLabelBySelectedList(t,e)},this.keydown=t=>{const e=utils.getKeyCodeNumber(t.keyCode);if(e){const s=e-1;if(this.config.inputList.length===1){this.labelSelectedList=[0,s],this.setLabel(0,s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500);return}this.labelSelectedList.length===1?(this.labelSelectedList=[this.labelSelectedList[0],s],this.setLabel(this.labelSelectedList[0],s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500)):(this.labelSelectedList=[s],this.emitEvent("expend"))}},this.setValid=t=>{this.setState({valid:t}),t===!1&&this.setState({tagResult:[]}),this.emitEvent("render")},this.setResultFromImgList=t=>{var e;const{imgList:s,imgIndex:l,step:o}=t;if(!s[l])return;const n=index.jsonParser(s[l].result),r=n[`step_${o}`];this.setState({tagResult:(e=r==null?void 0:r.result)!=null?e:[],valid:(n==null?void 0:n.valid)===void 0?!0:n.valid})},this.state={tagResult:[],labelSelectedList:[],valid:!0}}get config(){const i=StepUtils.getCurrentStepInfo(this.props.step,this.props.stepList);return index.jsonParser(i==null?void 0:i.config)}get history(){return{initRecord:()=>{},pushHistory:()=>{}}}get currentTagResult(){var i;return(i=this.state.tagResult[0])!=null?i:{}}get valid(){return this.state.valid}singleOn(i,t){this.fns[i]=t}on(i,t){this.singleOn(i,t)}getTagResultByCode(i,t){var e,s,l;try{const o=(s=(e=this.config)==null?void 0:e.inputList)!=null?s:[],n=o.length>1,r=t!==void 0?i:0,a=t!==void 0?t:i,d=n?o[r]:o[0],u=((l=d.subSelected)!=null?l:[])[a];if(d&&u)return{value:{key:d.value,value:u.value},isMulti:d.isMulti}}catch(o){return}}setLabelBySelectedList(i,t){var e,s,l,o;const n=this.getTagResultByCode(i,t);if(n){const r=this.combineResult(n,(s=(e=this.state.tagResult[0])==null?void 0:e.result)!=null?s:{}),a=[{sourceID:lbAnnotation.CommonToolUtils.getSourceID(),id:(o=(l=this.currentTagResult)==null?void 0:l.id)!=null?o:lbAnnotation.uuid(8,62),result:r}];this.setState({tagResult:a},()=>this.emitEvent("render"))}}componentDidMount(){document.addEventListener("keydown",this.keydown),this.props.onMounted(this),this.setResultFromImgList(this.props)}componentWillUnmount(){document.addEventListener("keydown",this.keydown),this.props.onUnmounted()}shouldComponentUpdate(i){return i.imgIndex!==this.props.imgIndex&&this.setResultFromImgList(i),!0}render(){var i;const{imgIndex:t,imgList:e,pageForward:s,pageJump:l,pageBackward:o}=this.props,{tagResult:n,valid:r}=this.state;return React__default.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"}},React__default.default.createElement(index$1.VideoPlayer,{imgIndex:t,imgList:e,pageBackward:o,pageForward:s,pageJump:l,valid:r,setVideoRef:a=>{this.videoRef=a}}),React__default.default.createElement(VideoTagLayer.VideoTagLayer,{result:n,inputList:(i=this.config)==null?void 0:i.inputList}))}}exports.TagToolInstanceAdaptor=TagToolInstanceAdaptor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import h from"react";import{CommonToolUtils as p,uuid as f}from"@labelbee/lb-annotation";import y from"../../utils/StepUtils.js";import{jsonParser as c}from"../../utils/index.js";import{VideoPlayer as L}from"./index.js";import{VideoTagLayer as R}from"./VideoTagLayer.js";import g from"lodash";import{getKeyCodeNumber as b}from"./utils.js";class S extends h.Component{constructor(i){super(i);this.fns={},this.labelSelectedList=[],this.clearResult=(t=!0,e)=>{const s=e?this.state.tagResult.map(l=>((l==null?void 0:l.result[e])&&delete l.result[e],l)):[];this.setState({tagResult:s},()=>this.emitEvent("render"))},this.exportData=()=>{var t,e,s,l,r,n,o;const a=(e=(t=this.videoRef)==null?void 0:t.duration)!=null?e:0,d=(s=this.videoRef)==null?void 0:s.getVideoPlaybackQuality(),u=d==null?void 0:d.totalVideoFrames,m=(r=(l=this.videoRef)==null?void 0:l.videoWidth)!=null?r:0,v=(o=(n=this.videoRef)==null?void 0:n.videoHeight)!=null?o:0;return[this.state.tagResult,{valid:this.state.valid,duration:a,frames:u,videoWidth:m,videoHeight:v}]},this.emitEvent=t=>{this.fns[t]&&this.fns[t]()},this.combineResult=(t,e={})=>{var s,l;const{isMulti:r}=t,{key:n,value:o}=t.value;if(r){let a=(l=(s=e[n])==null?void 0:s.split(";"))!=null?l:[];a.includes(o)?a=a.filter(u=>u!==o):a.push(o);const d=new Set(a);return e[n]=Array.from(d).join(";"),g.pickBy(e,u=>u)}return e[n]=e[n]===o?void 0:o,g.pickBy(e,a=>a)},this.setResult=t=>{this.setState({tagResult:t}),this.fns.render&&this.fns.render()},this.setLabel=(t,e)=>{this.setLabelBySelectedList(t,e)},this.keydown=t=>{const e=b(t.keyCode);if(e){const s=e-1;if(this.config.inputList.length===1){this.labelSelectedList=[0,s],this.setLabel(0,s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500);return}this.labelSelectedList.length===1?(this.labelSelectedList=[this.labelSelectedList[0],s],this.setLabel(this.labelSelectedList[0],s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500)):(this.labelSelectedList=[s],this.emitEvent("expend"))}},this.setValid=t=>{this.setState({valid:t}),t===!1&&this.setState({tagResult:[]}),this.emitEvent("render")},this.setResultFromImgList=t=>{var e;const{imgList:s,imgIndex:l,step:r}=t;if(!s[l])return;const n=c(s[l].result),o=n[`step_${r}`];this.setState({tagResult:(e=o==null?void 0:o.result)!=null?e:[],valid:(n==null?void 0:n.valid)===void 0?!0:n.valid})},this.state={tagResult:[],labelSelectedList:[],valid:!0}}get config(){const i=y.getCurrentStepInfo(this.props.step,this.props.stepList);return c(i==null?void 0:i.config)}get history(){return{initRecord:()=>{},pushHistory:()=>{}}}get currentTagResult(){var i;return(i=this.state.tagResult[0])!=null?i:{}}get valid(){return this.state.valid}singleOn(i,t){this.fns[i]=t}on(i,t){this.singleOn(i,t)}getTagResultByCode(i,t){var e,s,l;try{const r=(s=(e=this.config)==null?void 0:e.inputList)!=null?s:[],n=r.length>1,o=t!==void 0?i:0,a=t!==void 0?t:i,d=n?r[o]:r[0],u=((l=d.subSelected)!=null?l:[])[a];if(d&&u)return{value:{key:d.value,value:u.value},isMulti:d.isMulti}}catch(r){return}}setLabelBySelectedList(i,t){var e,s,l,r;const n=this.getTagResultByCode(i,t);if(n){const o=this.combineResult(n,(s=(e=this.state.tagResult[0])==null?void 0:e.result)!=null?s:{}),a=[{sourceID:p.getSourceID(),id:(r=(l=this.currentTagResult)==null?void 0:l.id)!=null?r:f(8,62),result:o}];this.setState({tagResult:a},()=>this.emitEvent("render"))}}componentDidMount(){document.addEventListener("keydown",this.keydown),this.props.onMounted(this),this.setResultFromImgList(this.props)}componentWillUnmount(){document.addEventListener("keydown",this.keydown),this.props.onUnmounted()}shouldComponentUpdate(i){return i.imgIndex!==this.props.imgIndex&&this.setResultFromImgList(i),!0}render(){var i;const{imgIndex:t,imgList:e,pageForward:s,pageJump:l,pageBackward:r}=this.props,{tagResult:n,valid:o}=this.state;return h.createElement("div",{style:{height:"100%",width:"100%",position:"relative"}},h.createElement(L,{imgIndex:t,imgList:e,pageBackward:r,pageForward:s,pageJump:l,valid:o,setVideoRef:a=>{this.videoRef=a}}),h.createElement(R,{result:n,inputList:(i=this.config)==null?void 0:i.inputList}))}}export{S as TagToolInstanceAdaptor};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|