@labelbee/lb-components 1.20.0-alpha.9 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/components/audioAnnotate/textInput/index.js +1 -1
  2. package/dist/components/videoAnnotate/index.js +1 -1
  3. package/dist/components/videoPlayer/TagToolInstanceAdaptor.js +1 -0
  4. package/dist/components/videoPlayer/VideoTagLayer.js +1 -1
  5. package/dist/components/videoPlayer/components/controller/index.js +1 -1
  6. package/dist/components/videoPlayer/index.js +1 -1
  7. package/dist/components/videoPlayer/utils.js +1 -1
  8. package/dist/index.css +2 -261
  9. package/dist/index.js +1 -1
  10. package/dist/store/annotation/reducer.js +1 -1
  11. package/dist/types/App.d.ts +2 -2
  12. package/dist/types/components/audioAnnotate/index.d.ts +1 -1
  13. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -1
  14. package/dist/types/components/pointCloudView/PointCloud3DView.d.ts +1 -1
  15. package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +1 -1
  16. package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -1
  17. package/dist/types/components/pointCloudView/PointCloudSegment.d.ts +1 -1
  18. package/dist/types/components/pointCloudView/PointCloudSegment2DView.d.ts +1 -1
  19. package/dist/types/components/pointCloudView/PointCloudSegmentListener.d.ts +1 -1
  20. package/dist/types/components/pointCloudView/PointCloudSideView.d.ts +1 -1
  21. package/dist/types/components/pointCloudView/PointCloudTopView.d.ts +3 -3
  22. package/dist/types/components/pointCloudView/index.d.ts +3 -3
  23. package/dist/types/components/videoAnnotate/index.d.ts +7 -18
  24. package/dist/types/components/{videoAnnotate/videoTagTool → videoPlayer}/TagToolInstanceAdaptor.d.ts +10 -6
  25. package/dist/types/components/videoPlayer/VideoTagLayer.d.ts +0 -1
  26. package/dist/types/components/videoPlayer/components/controller/index.d.ts +2 -4
  27. package/dist/types/components/videoPlayer/index.d.ts +0 -11
  28. package/dist/types/components/videoPlayer/utils.d.ts +0 -6
  29. package/dist/types/index.d.ts +1 -1
  30. package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -2
  31. package/dist/utils/audio.js +1 -1
  32. package/dist/views/MainView/LLMLayout/index.js +1 -1
  33. package/dist/views/MainView/index.js +1 -1
  34. package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  35. package/dist/views/MainView/sidebar/index.js +1 -1
  36. package/es/components/audioAnnotate/textInput/index.js +1 -1
  37. package/es/components/videoAnnotate/index.js +1 -1
  38. package/es/components/videoPlayer/TagToolInstanceAdaptor.js +1 -0
  39. package/es/components/videoPlayer/VideoTagLayer.js +1 -1
  40. package/es/components/videoPlayer/components/controller/index.js +1 -1
  41. package/es/components/videoPlayer/index.js +1 -1
  42. package/es/components/videoPlayer/utils.js +1 -1
  43. package/es/index.css +2 -261
  44. package/es/index.js +1 -1
  45. package/es/store/annotation/reducer.js +1 -1
  46. package/es/utils/audio.js +1 -1
  47. package/es/views/MainView/index.js +1 -1
  48. package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  49. package/es/views/MainView/sidebar/index.js +1 -1
  50. package/package.json +4 -6
  51. package/dist/assets/annotation/video/icon_timePoint.svg.js +0 -1
  52. package/dist/assets/annotation/video/icon_videoCut.svg.js +0 -1
  53. package/dist/assets/annotation/video/icon_videoCutting.svg.js +0 -1
  54. package/dist/components/videoAnnotate/videoClipTool/VideoClipToolContext.js +0 -1
  55. package/dist/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +0 -1
  56. package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +0 -1
  57. package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.module.scss.js +0 -1
  58. package/dist/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.js +0 -1
  59. package/dist/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.module.scss.js +0 -1
  60. package/dist/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.js +0 -1
  61. package/dist/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.module.scss.js +0 -1
  62. package/dist/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.js +0 -1
  63. package/dist/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.module.scss.js +0 -1
  64. package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +0 -1
  65. package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +0 -1
  66. package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +0 -1
  67. package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.module.scss.js +0 -1
  68. package/dist/components/videoAnnotate/videoClipTool/constant.js +0 -1
  69. package/dist/components/videoAnnotate/videoClipTool/index.js +0 -1
  70. package/dist/components/videoAnnotate/videoClipTool/index.module.scss.js +0 -1
  71. package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +0 -1
  72. package/dist/components/videoAnnotate/videoTextTool/index.js +0 -1
  73. package/dist/components/videoPlayer/VideoTextLayer.js +0 -2
  74. package/dist/types/components/videoAnnotate/videoClipTool/VideoClipToolContext.d.ts +0 -27
  75. package/dist/types/components/videoAnnotate/videoClipTool/components/ToolTipForClip.d.ts +0 -8
  76. package/dist/types/components/videoAnnotate/videoClipTool/components/annotatedList/index.d.ts +0 -7
  77. package/dist/types/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.d.ts +0 -14
  78. package/dist/types/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.d.ts +0 -18
  79. package/dist/types/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.d.ts +0 -6
  80. package/dist/types/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.d.ts +0 -3
  81. package/dist/types/components/videoAnnotate/videoClipTool/components/videoTrack/index.d.ts +0 -11
  82. package/dist/types/components/videoAnnotate/videoClipTool/constant.d.ts +0 -26
  83. package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +0 -131
  84. package/dist/types/components/videoAnnotate/videoTextTool/index.d.ts +0 -56
  85. package/dist/types/components/videoPlayer/VideoTextLayer.d.ts +0 -2
  86. package/es/assets/annotation/video/icon_timePoint.svg.js +0 -1
  87. package/es/assets/annotation/video/icon_videoCut.svg.js +0 -1
  88. package/es/assets/annotation/video/icon_videoCutting.svg.js +0 -1
  89. package/es/components/videoAnnotate/videoClipTool/VideoClipToolContext.js +0 -1
  90. package/es/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +0 -1
  91. package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +0 -1
  92. package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.module.scss.js +0 -1
  93. package/es/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.js +0 -1
  94. package/es/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.module.scss.js +0 -1
  95. package/es/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.js +0 -1
  96. package/es/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.module.scss.js +0 -1
  97. package/es/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.js +0 -1
  98. package/es/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.module.scss.js +0 -1
  99. package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +0 -1
  100. package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +0 -1
  101. package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +0 -1
  102. package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.module.scss.js +0 -1
  103. package/es/components/videoAnnotate/videoClipTool/constant.js +0 -1
  104. package/es/components/videoAnnotate/videoClipTool/index.js +0 -1
  105. package/es/components/videoAnnotate/videoClipTool/index.module.scss.js +0 -1
  106. package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +0 -1
  107. package/es/components/videoAnnotate/videoTextTool/index.js +0 -1
  108. package/es/components/videoPlayer/VideoTextLayer.js +0 -2
  109. /package/dist/components/{videoAnnotate/videoTagTool → videoPlayer}/TagToolInstanceAdaptorI18nProvider.js +0 -0
  110. /package/dist/types/components/{videoAnnotate/videoTagTool → videoPlayer}/TagToolInstanceAdaptorI18nProvider.d.ts +0 -0
  111. /package/es/components/{videoAnnotate/videoTagTool → videoPlayer}/TagToolInstanceAdaptorI18nProvider.js +0 -0
package/es/index.css CHANGED
@@ -128,246 +128,6 @@
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-height: calc(100% - 80px - 90px - 24px);
341
- padding-right: 4px;
342
- overflow: auto;
343
- z-index: 22;
344
- }
345
-
346
- .index-module_timeSliceWrapper__kebC3 {
347
- height: 80px;
348
- margin-bottom: 8px;
349
- transition: opacity 0.4s ease-in-out;
350
- opacity: 0.3;
351
- }
352
- .index-module_timeSliceWrapper__kebC3.index-module_active__cIGVq {
353
- opacity: 1;
354
- }
355
- .index-module_timeSliceWrapper__kebC3 .index-module_timeSliceItemText__FJFwH,
356
- .index-module_timeSliceWrapper__kebC3 .index-module_timeSliceItemAttribute__--3E1 {
357
- height: 40px;
358
- font-size: 16px;
359
- color: white;
360
- }
361
- .index-module_timeSliceWrapper__kebC3 .index-module_timeSliceItemText__FJFwH {
362
- background-color: #CCC;
363
- padding: 8px 24px;
364
- }
365
- .index-module_timeSliceWrapper__kebC3 .index-module_timeSliceItemAttribute__--3E1 span {
366
- display: inline-block;
367
- height: 40px;
368
- line-height: 40px;
369
- padding: 0 24px;
370
- }
371
131
  .index-module_speedControllerWrap__aFz7r {
372
132
  display: flex;
373
133
  color: white;
@@ -1994,13 +1754,6 @@
1994
1754
  overflow-y: scroll;
1995
1755
  }
1996
1756
 
1997
- .textToolSwitchItem {
1998
- display: flex;
1999
- justify-content: space-between;
2000
- margin-top: 20px;
2001
- font-size: 12px;
2002
- }
2003
-
2004
1757
  .textareaContainer {
2005
1758
  position: relative;
2006
1759
  padding: 0;
@@ -2225,20 +1978,11 @@
2225
1978
  flex-direction: column;
2226
1979
  background-color: black;
2227
1980
  overflow: hidden;
2228
- flex: 1 1;
2229
1981
  }
2230
1982
  .bee-video-wrapper .bee-video-container {
2231
- height: calc(100% - 80px);
1983
+ flex: 1;
2232
1984
  overflow: hidden;
2233
1985
  position: relative;
2234
- display: flex;
2235
- flex-direction: column;
2236
- }
2237
- .bee-video-wrapper .bee-video-container .bee-video {
2238
- flex: 1 1;
2239
- }
2240
- .bee-video-wrapper .bee-video-container .bee-video-track {
2241
- height: calc(100% - 90px - 24px);
2242
1986
  }
2243
1987
 
2244
1988
  .bee-video-progress {
@@ -2286,10 +2030,7 @@
2286
2030
  }
2287
2031
 
2288
2032
  .bee-video-controller__wrapper {
2289
- position: absolute;
2290
- bottom: 0px;
2291
- left: 0px;
2292
- right: 0px;
2033
+ position: relative;
2293
2034
  }
2294
2035
 
2295
2036
  .bee-video-controller {
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 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
+ 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 P,PageForward as g,PageJump as v}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as _}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as j}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 T=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?T(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,y=(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(),A=(o,e)=>{const[t,l]=d();return m(e,()=>({toolInstance:t,annotationEngine:r.getState().annotation.annotationEngine,pageBackwardActions:()=>r.dispatch(P()),pageForwardActions:()=>r.dispatch(g()),pageJump:a=>{const i=~~a-1;r.dispatch(v(i))},hello:()=>alert("hello labelBee!!!")}),[t]),n.createElement(u,{store:r,context:j},n.createElement(f,{i18n:c},n.createElement(_,null,n.createElement(w,E(y({},o),{setToolInstance:a=>{var i;l(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}})))))};var C=n.forwardRef(A);export{C as default,r as store};
@@ -1 +1 @@
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};
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)&&gt(t,r,e[r]);if(pt)for(var r of pt(e))Ot.call(e,r)&&gt(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};
package/es/utils/audio.js CHANGED
@@ -1 +1 @@
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
+ import"antd";import{cStyle as b}from"@labelbee/lb-annotation";import"lodash";import l from"decimal.js";import c from"moment";const{COLORS_ARRAY:a,ICON_ARRAY:$,INVALID_ICON:F,NULL_COLOR:d,NULL_ICON:k,WHITE_FONT_COLOR_ARRAY:h}=b,C={label:"\u6587\u672C",key:"text",required:!1,default:"",maxLength:1e3},I=(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}},p=(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}},A=(t,e)=>new l(Number(t)||0).minus(Number(e)||0).toNumber(),_=(t,e)=>new l(t).add(e).toNumber(),v=t=>{let e=null;return n=>e?n.target===(e==null?void 0:e.target):(e=n,setTimeout(()=>{e=null},t),!1)},x=v(300),N=t=>{const e=Math.floor(t*1e3),r=c.duration(e);return`${Math.floor(r.asMinutes())}:${c.utc(e).format("ss")}`},O=(t,e="ss.S")=>{const r=Math.floor(t*1e3),n=c.duration(r);return`${E(Math.floor(n.asMinutes()))}:${c.utc(r).format(e)}`},E=t=>t<10?`0${t}`:t,R=(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((s,f)=>{e>s&&(r=s,u=f)}),r&&u<o-1&&(n=t[u+1])),{min:r,max:n}},y=()=>{const t=document.createEvent("Event");t.initEvent("resize",!0,!0),window.dispatchEvent(t)};export{C as DEFAULT_TEXT_CONFIG_ITEM,y as dispatchResizeEvent,N as formatTime,m as getAttributeColor,p as getAttributeFontColor,i as getAttributeIndex,I as getAttributeShowText,R as getCanMoveRange,x as isDoubleClick,_ as precisionAdd,A as precisionMinus,O as timeFormat,g as updateColorOpacity};
@@ -1 +1 @@
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
+ import{ViewportProvider as C}from"../../components/customResizeHook/index.js";import{prefix as S}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 L 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 E 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 p}from"../../store/ctx.js";import{EToolName as y}from"../../data/enums/ToolType.js";import B from"./LLMLayout/index.js";import D from"../../components/audioAnnotate/index.js";import{LoadingOutlined as U}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,r=(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=`${S}-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,r({},e)),t.createElement(L,{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(L,{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,a=(o=_(n,i))==null?void 0:o.tool,d=E.isVideoTool(a),l=E.isPointCloudTool(a);return d?t.createElement(F,r({},e)):l?t.createElement(Z,r({},e)):t.createElement(Y,r({},e))},g=e=>{var o,n,i;const{t:a}=z(),{stepList:d,step:l}=e,m=(o=_(d,l))==null?void 0:o.tool,c=![y.LLM].includes(m),u=![y.LLM].includes(m),f=[q.PointCloud].includes(m);return t.createElement(C,null,t.createElement(b,{spinning:e.loading,indicator:t.createElement(U,null),tip:t.createElement("span",{style:{marginTop:200}},a("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,a,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:j,step:P}=e,h=(i=_(j,P))==null?void 0:i.tool,w=y.LLM===h,N=E.isAudioTool(h);return w?t.createElement(g,r({},e),t.createElement(B,r({},e))):N?t.createElement(g,r({},e),t.createElement(D,r({},e))):t.createElement(g,r({},e),t.createElement(v,{className:H("layout","container")},e==null?void 0:e.leftSider,t.createElement(X,{className:`${s}__content`},t.createElement(ee,r({},e)),t.createElement(W,null)),t.createElement(Q,{className:`${s}__side`,width:(a=c!=null?c:f)!=null?a: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:a,loading:d}=e,l=(o=a[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:p})(te);export{ne as default};
@@ -1 +1 @@
1
- import t,{useState as u,useEffect as F,useRef as U}from"react";import{connect as V}from"react-redux";import{cloneDeep as M}from"lodash";import{classnames as C}from"../../../../utils/index.js";import{Switch as z,Input as W}from"antd/es";import{cKeyCode as G,cTool as H}from"@labelbee/lb-annotation";import{PageForward as J}from"../../../../store/annotation/actionCreators.js";import{ConfigUtils as Q}from"../../../../utils/ConfigUtils.js";import{useTranslation as A}from"react-i18next";import{LabelBeeContext as X}from"../../../../store/ctx.js";var Y=Object.defineProperty,I=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,K=(e,o,n)=>o in e?Y(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,te=(e,o)=>{for(var n in o||(o={}))Z.call(o,n)&&K(e,n,o[n]);if(I)for(var n of I(o))ee.call(o,n)&&K(e,n,o[n]);return e};const R=G.default,{EVideoToolName:oe}=H,j=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},D=e=>{const{textareaProps:o,footer:n}=e;return t.createElement(t.Fragment,null,t.createElement(W.TextArea,te({bordered:!1,rows:6,onKeyDown:j,onKeyUp:j},o)),t.createElement("div",{className:C({textAreaLength:!0})},n))},$=e=>{var o;const n=U(null),[g,m]=u(!1),[N,v]=u(!1),{t:d}=A(),{disabled:i,config:s,result:c,updateText:T,index:E,switchToNextTextarea:h,hasMultiple:P,onNext:w}=e,{maxLength:p}=s,f=c?c[s.key]:"",b=(o=f==null?void 0:f.length)!=null?o:0,x=a=>{T&&(T(a,s.key),s.required&&v(!a))},y=P&&h,_={id:`textInput-${E}`,ref:n,disabled:i,value:f,maxLength:p,autoSize:{minRows:2,maxRows:6},onChange:a=>{const S=a.target.value;x(S)},onFocus:()=>{m(!0)},onBlur:a=>{m(!1),s.required&&v(!a.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:a=>{a.ctrlKey&&a.keyCode===R.Enter&&(w&&w(),a.preventDefault()),a.keyCode===R.Tab&&y&&(a.preventDefault(),a.nativeEvent.stopImmediatePropagation(),h(E)),a.nativeEvent.stopPropagation()}},L=t.createElement("div",{className:"textAreaFooter"},t.createElement("div",{className:"hotkeyTip"},y&&t.createElement("span",null,`[${d("Switch")}]Tab`),t.createElement("span",null,`[${d("TurnPage")}]Ctrl+Enter`)),t.createElement("div",{className:"wordCount"},t.createElement("span",{className:b>=p?"warning":""},b),"/",t.createElement("span",null,p)));return F(()=>{i&&m(!1)},[i]),t.createElement("div",{className:"textField"},t.createElement("div",{className:"label"},t.createElement("span",{className:C({required:s.required})},s.label),t.createElement("i",{className:C({clearText:!0,disabled:i}),onClick:()=>{i||x("")}})),t.createElement("div",{className:C({disabled:i,"textarea-outline":!0,"ant-input-focused":g,textareaContainer:!0,focus:g,invalid:N})},t.createElement(D,{footer:L,textareaProps:_})))},ne=({toolInstance:e,imgIndex:o,dispatch:n,triggerEventAfterIndexChanged:g,step:m,stepList:N,basicResultList:v})=>{var d,i,s;const[c,T]=u([]),[E,h]=u(0),[P,w]=u(!0),[,p]=u(0),{t:f}=A(),b=r=>{const l=(r+1)%c.length;x(l)},x=r=>{setTimeout(()=>{const l=document.getElementById(`textInput-${r}`);l&&(h(r),l.focus(),l.select(),l.scrollIntoView({behavior:"smooth",block:"center"}))})};F(()=>{e&&(T(M(e.config.configList)),e.singleOn("valueUpdated",()=>{p(r=>r+1)}))},[e]);const y=(s=(i=(d=e==null?void 0:e.textList)==null?void 0:d[0])==null?void 0:i.value)!=null?s:{},_=(r,l)=>{var k,O;(O=e==null?void 0:e.updateTextValue)==null||O.call(e,l,r,(k=e==null?void 0:e.textList)==null?void 0:k[0])};F(()=>{o>-1&&g&&x(0)},[o]);const L=()=>{n(J(!0))},a=r=>{w(r),e==null||e.toggleShowText(r)},S=Q.getStepConfig(N,m),q=S.dataSourceStep>0&&v.length===0,B=S.tool===oe.VideoTextTool;return e&&t.createElement("div",{className:"textToolOperationMenu"},c.map((r,l)=>t.createElement($,{config:r,key:r.key,index:l,result:y,updateText:_,switchToNextTextarea:b,hasMultiple:c.length>1,focus:E===l,onNext:L,disabled:q})),B&&t.createElement("div",{className:"textToolSwitchItem"},f("toggleShowText"),t.createElement(z,{style:{alignSelf:"center"},checked:P,onChange:r=>{a(r)}})))};function ae(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 re=V(ae,null,null,{context:X})(ne);export{$ as SingleTextInput,D as TextareaWithFooter,re as default};
1
+ import n,{useState as d,useEffect as _,useRef as K}from"react";import{connect as R}from"react-redux";import{cloneDeep as j}from"lodash";import{classnames as C}from"../../../../utils/index.js";import{Input as D}from"antd/es";import{cKeyCode as $}from"@labelbee/lb-annotation";import{PageForward as q}from"../../../../store/annotation/actionCreators.js";import{ConfigUtils as B}from"../../../../utils/ConfigUtils.js";import{useTranslation as U}from"react-i18next";import{LabelBeeContext as M}from"../../../../store/ctx.js";var z=Object.defineProperty,I=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,G=(e,t)=>{for(var a in t||(t={}))V.call(t,a)&&S(e,a,t[a]);if(I)for(var a of I(t))W.call(t,a)&&S(e,a,t[a]);return e};const L=$.default,F=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},O=e=>{const{textareaProps:t,footer:a}=e;return n.createElement(n.Fragment,null,n.createElement(D.TextArea,G({bordered:!1,rows:6,onKeyDown:F,onKeyUp:F},t)),n.createElement("div",{className:C({textAreaLength:!0})},a))},k=e=>{var t;const a=K(null),[x,c]=d(!1),[w,g]=d(!1),{t:u}=U(),{disabled:l,config:i,result:v,updateText:E,index:T,switchToNextTextarea:h,hasMultiple:P,onNext:p}=e,{maxLength:m}=i,f=v?v[i.key]:"",b=(t=f==null?void 0:f.length)!=null?t:0,N=o=>{E&&(E(o,i.key),i.required&&g(!o))},y=P&&h,r={id:`textInput-${T}`,ref:a,disabled:l,value:f,maxLength:m,autoSize:{minRows:2,maxRows:6},onChange:o=>{const A=o.target.value;N(A)},onFocus:()=>{c(!0)},onBlur:o=>{c(!1),i.required&&g(!o.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:o=>{o.ctrlKey&&o.keyCode===L.Enter&&(p&&p(),o.preventDefault()),o.keyCode===L.Tab&&y&&(o.preventDefault(),o.nativeEvent.stopImmediatePropagation(),h(T)),o.nativeEvent.stopPropagation()}},s=n.createElement("div",{className:"textAreaFooter"},n.createElement("div",{className:"hotkeyTip"},y&&n.createElement("span",null,`[${u("Switch")}]Tab`),n.createElement("span",null,`[${u("TurnPage")}]Ctrl+Enter`)),n.createElement("div",{className:"wordCount"},n.createElement("span",{className:b>=m?"warning":""},b),"/",n.createElement("span",null,m)));return _(()=>{l&&c(!1)},[l]),n.createElement("div",{className:"textField"},n.createElement("div",{className:"label"},n.createElement("span",{className:C({required:i.required})},i.label),n.createElement("i",{className:C({clearText:!0,disabled:l}),onClick:()=>{l||N("")}})),n.createElement("div",{className:C({disabled:l,"textarea-outline":!0,"ant-input-focused":x,textareaContainer:!0,focus:x,invalid:w})},n.createElement(O,{footer:s,textareaProps:r})))},H=({toolInstance:e,imgIndex:t,dispatch:a,triggerEventAfterIndexChanged:x,step:c,stepList:w,basicResultList:g})=>{var u,l;const[i,v]=d([]),[E,T]=d(0),[,h]=d(0),P=r=>{const s=(r+1)%i.length;p(s)},p=r=>{setTimeout(()=>{const s=document.getElementById(`textInput-${r}`);s&&(T(r),s.focus(),s.select(),s.scrollIntoView({behavior:"smooth",block:"center"}))})};_(()=>{e&&(v(j(e.config.configList)),e.singleOn("valueUpdated",()=>{h(r=>r+1)}))},[e]);const m=(r,s)=>{e.updateTextValue(s,r)};_(()=>{t>-1&&x&&p(0)},[t]);const f=(l=(u=e.textList[0])==null?void 0:u.value)!=null?l:{},b=()=>{a(q(!0))},y=B.getStepConfig(w,c).dataSourceStep>0&&g.length===0;return n.createElement("div",{className:"textToolOperationMenu"},i.map((r,s)=>n.createElement(k,{config:r,key:r.key,index:s,result:f,updateText:m,switchToNextTextarea:P,hasMultiple:i.length>1,focus:E===s,onNext:b,disabled:y})))};function J(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 Q=R(J,null,null,{context:M})(H);export{k as SingleTextInput,O as TextareaWithFooter,Q as default};
@@ -1 +1 @@
1
- import{prefix as F}from"../../../constant/index.js";import{EToolName as o}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(r=>K.getCurrentStepInfo(r.annotation.step,r.annotation.stepList)),[s,w]=R(!0),n=b==null?void 0:b.tool,{t:x}=z();if(!n)return null;const V=r=>{const c=e.createElement(J,null);return e.createElement(L,{header:x("Style"),className:"panel",key:r},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=e.createElement(p,null),v=e.createElement(W,{onChange:(r,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([o.Rect,o.Point,o.Line,o.Rect,o.Polygon,o.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===o.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===o.Text)return e.createElement("div",{className:`${t}`},e.createElement(p,null));if(n===ne.PointCloud){const r=()=>{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:()=>r()},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:()=>r(),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===o.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},v,a),l):n===o.LLM?y:null};export{oe as default,t as sidebarCls};
1
+ import{prefix as O}from"../../../constant/index.js";import{EToolName as n}from"../../../data/enums/ToolType.js";import F from"../../../utils/StepUtils.js";import{Collapse as d}from"antd/es";import e,{useState as K}from"react";import{useTranslation as R}from"react-i18next";import V from"./AnnotationText/index.js";import z from"./ClearIcon/index.js";import D,{PointCloudOperation as y}from"./GeneralOperation/index.js";import G from"./ImgAttributeInfo/index.js";import U from"./SwitchAttributeList/index.js";import u,{expandIconFuc as j}from"./TagSidebar/index.js";import C from"./TextToolSidebar/index.js";import N from"./PointCloudToolSidebar/index.js";import q from"./ToolStyle/index.js";import{cTool as H}from"@labelbee/lb-annotation";import J from"./ScribbleSidebar/index.js";import{ToolIcons as Q}from"./ToolIcons.js";import{useSelector as W}from"../../../store/ctx.js";import{Tabs as v}from"antd";import{classnames as X}from"../../../utils/index.js";import _ from"../../../assets/annotation/common/icon_menu_fold.svg.js";import Y from"../../../components/LLMToolView/sidebar/index.js";const{EVideoToolName:Z,EPointCloudName:ee}=H,{Panel:I}=d,t=`${O}-sidebar`,te=({sider:l,enableColorPicker:$,setSiderWidth:p,propsSiderWidth:ne,checkMode:L})=>{const f=W(r=>F.getCurrentStepInfo(r.annotation.step,r.annotation.stepList)),[c,A]=K(!0),o=f==null?void 0:f.tool,{t:E}=R();if(!o)return null;const P=r=>{const i=e.createElement(q,null);return e.createElement(I,{header:E("Style"),className:"panel",key:r},i)},b=e.createElement(Q,{toolName:o,onChange:()=>{}}),s=e.createElement(U,null),x=e.createElement(V,null),S=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:j},P("1")),T=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:j},e.createElement(I,{header:e.createElement("div",null,E("Adjust"),e.createElement(z,null)),className:"panel",key:"imgAttribute"},e.createElement(G,null))),a=e.createElement(D,null),w=e.createElement(u,null),k=e.createElement(C,null),g=e.createElement(J,{onChange:(r,i)=>{}}),h=e.createElement(Y,{checkMode:L}),m=e.createElement("div",{className:`${t}__horizontal`}),B=e.createElement(N,{enableColorPicker:$}),M=e.createElement(y,null);if(l)return typeof l=="function"?e.createElement("div",{className:`${t}`},l({toolIcon:b,attributeList:s,annotationText:x,toolStyle:S,imageAttributeInfo:T,operation:a,tagToolSideBar:w,textToolSideBar:k,horizontal:m,pointCloudToolSidebar:B,pointCloudOperation:M,scribbleSidebar:g,LLMSidebar:h})):l;if([n.Rect,n.Point,n.Line,n.Rect,n.Polygon,n.Cuboid].includes(o))return e.createElement("div",{className:`${t}`},b,m,s,x,m,e.createElement("div",{className:`${t}__content`},S,T),a);if(o===n.Tag)return e.createElement("div",{className:`${t}`},e.createElement(u,null));if(o===Z.VideoTagTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(u,null)),a);if(o===n.Text)return e.createElement("div",{className:`${t}`},e.createElement(C,null));if(o===ee.PointCloud){const r=()=>{A(!c),p&&p(c?48:void 0)},i=e.createElement("div",{style:{width:"48px",height:"100%",display:"flex",justifyContent:"center",background:"#ffffff"}},e.createElement("span",{onClick:()=>r()},e.createElement("img",{style:{width:"16px",height:"16px",marginTop:"18px",cursor:"pointer",transform:"rotate(180deg)"},src:_})));return c?e.createElement(v,{type:"card",activeKey:"1",className:X({[`${t}`]:!0,[`${t}__pointCloud`]:!0}),tabBarExtraContent:{left:e.createElement("span",{onClick:()=>r(),style:{padding:"0px 4px"}},e.createElement("img",{style:{width:"16px",height:"16px",marginLeft:"4px",cursor:"pointer"},src:_}))}},e.createElement(v.TabPane,{tab:"\u5DE5\u5177\u9762\u677F",key:"1",style:{height:"100%",display:"flex",flexDirection:"column"}},e.createElement("div",{className:`${t}__content`},e.createElement(N,null)),e.createElement(y,null))):i}return o===n.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},g,s),a):o===n.LLM?h:null};export{te as default,t as sidebarCls};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.20.0-alpha.9",
3
+ "version": "1.20.0",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",
@@ -43,29 +43,27 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@ant-design/icons": "^4.6.2",
46
- "@labelbee/lb-annotation": "1.24.0-alpha.6",
47
- "@labelbee/lb-utils": "1.16.0-alpha.3",
46
+ "@labelbee/lb-annotation": "1.24.0",
47
+ "@labelbee/lb-utils": "1.16.0",
48
48
  "@labelbee/wavesurfer": "1.0.0",
49
49
  "@types/react-dom": "^18.2.7",
50
- "@types/react-transition-group": "^4.4.9",
51
50
  "ahooks": "^3.4.0",
52
51
  "classnames": "^2.3.0",
53
52
  "decimal.js": "^10.4.3",
54
53
  "github-markdown-css": "^5.2.0",
55
54
  "lodash": "^4.17.21",
56
55
  "postcss-url": "^10.1.3",
57
- "re-resizable": "^6.9.9",
58
56
  "react-colorful": "^5.6.1",
59
57
  "react-i18next": "^11.12.0",
60
58
  "react-markdown": "^8.0.7",
61
59
  "react-redux": "^7.2.3",
62
60
  "react-syntax-highlighter": "^15.5.0",
63
- "react-transition-group": "^4.4.5",
64
61
  "redux": "^4.0.5",
65
62
  "redux-actions": "^2.6.5",
66
63
  "redux-thunk": "^2.3.0",
67
64
  "rehype-katex": "^6.0.3",
68
65
  "diff-match-patch": "^1.0.5",
66
+ "re-resizable": "^6.9.9",
69
67
  "remark-math": "^5.1.1",
70
68
  "remark-gfm": "^3.0.1",
71
69
  "resize-observer-polyfill": "^1.5.1"
@@ -1 +0,0 @@
1
- "use strict";var img="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='20' height='20' viewBox='0 0 20 20'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: none%3b %7d .cls-2 %7b clip-path: url(%23clip-path)%3b %7d .cls-3 %7b fill: rgba(0%2c0%2c0%2c0)%3b %7d .cls-4 %7b clip-path: url(%23clip-path-2)%3b %7d .cls-5 %7b fill: %23bbb%3b %7d %3c/style%3e %3cclipPath id='clip-path'%3e %3cpath id='%e8%b7%af%e5%be%84_706' data-name='%e8%b7%af%e5%be%84 706' class='cls-1' d='M0%2c4H20V-16H0Z' transform='translate(0 16)'/%3e %3c/clipPath%3e %3cclipPath id='clip-path-2'%3e %3cpath id='%e8%b7%af%e5%be%84_708' data-name='%e8%b7%af%e5%be%84 708' class='cls-1' d='M9.019-14.953a6.887%2c6.887%2c0%2c0%2c1%2c2.653.525A6.81%2c6.81%2c0%2c0%2c1%2c13.843-13a6.656%2c6.656%2c0%2c0%2c1%2c1.467%2c2.125%2c6.522%2c6.522%2c0%2c0%2c1%2c.54%2c2.608%2c8.608%2c8.608%2c0%2c0%2c1-.924%2c3.831%2c12.094%2c12.094%2c0%2c0%2c1-2.038%2c2.9%2c16.4%2c16.4%2c0%2c0%2c1-3.46%2c2.81.811.811%2c0%2c0%2c1-.823%2c0%2c16.4%2c16.4%2c0%2c0%2c1-3.46-2.81%2c12.13%2c12.13%2c0%2c0%2c1-2.038-2.9%2c8.672%2c8.672%2c0%2c0%2c1-.92-3.832%2c6.522%2c6.522%2c0%2c0%2c1%2c.54-2.608A6.677%2c6.677%2c0%2c0%2c1%2c4.195-13%2c6.84%2c6.84%2c0%2c0%2c1%2c6.365-14.43%2c6.92%2c6.92%2c0%2c0%2c1%2c9.019-14.953Zm0%2c4.646a2.35%2c2.35%2c0%2c0%2c0-2.35%2c2.35%2c2.35%2c2.35%2c0%2c0%2c0%2c2.35%2c2.35%2c2.35%2c2.35%2c0%2c0%2c0%2c2.35-2.35A2.35%2c2.35%2c0%2c0%2c0%2c9.019-10.307Z' transform='translate(-2.188 14.953)'/%3e %3c/clipPath%3e %3c/defs%3e %3cg id='icon_timePoint' transform='translate(0 16)'%3e %3cg id='%e7%bb%84_1284' data-name='%e7%bb%84 1284' class='cls-2' transform='translate(0 -16)'%3e %3cpath id='%e8%b7%af%e5%be%84_705' data-name='%e8%b7%af%e5%be%84 705' class='cls-3' d='M-5-21H27.5V11.5H-5Z' transform='translate(-1.25 14.75)'/%3e %3c/g%3e %3cg id='%e7%bb%84_1285' data-name='%e7%bb%84 1285' class='cls-4' transform='translate(3.169 -14.172)'%3e %3cpath id='%e8%b7%af%e5%be%84_707' data-name='%e8%b7%af%e5%be%84 707' class='cls-5' d='M-2.812-19.953H22.6V8.141H-2.812Z' transform='translate(-3.064 14.077)'/%3e %3c/g%3e %3c/g%3e%3c/svg%3e";module.exports=img;
@@ -1 +0,0 @@
1
- "use strict";var img="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='20' height='20' viewBox='0 0 20 20'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: none%3b %7d .cls-2 %7b clip-path: url(%23clip-path)%3b %7d .cls-3 %7b fill: rgba(0%2c0%2c0%2c0)%3b %7d .cls-4 %7b clip-path: url(%23clip-path-2)%3b %7d .cls-5 %7b fill: %23bbb%3b %7d %3c/style%3e %3cclipPath id='clip-path'%3e %3cpath id='%e8%b7%af%e5%be%84_683' data-name='%e8%b7%af%e5%be%84 683' class='cls-1' d='M0%2c4H20V-16H0Z' transform='translate(0 16)'/%3e %3c/clipPath%3e %3cclipPath id='clip-path-2'%3e %3cpath id='%e8%b7%af%e5%be%84_685' data-name='%e8%b7%af%e5%be%84 685' class='cls-1' d='M5.959-3.6A3.049%2c3.049%2c0%2c0%2c0%2c2.91-.547%2c3.047%2c3.047%2c0%2c0%2c0%2c5.959%2c2.5%2c3.049%2c3.049%2c0%2c0%2c0%2c9.008-.549%2c3.047%2c3.047%2c0%2c0%2c0%2c5.959-3.6ZM6.011.924A1.578%2c1.578%2c0%2c0%2c1%2c4.435-.652%2c1.577%2c1.577%2c0%2c0%2c1%2c6.011-2.229%2c1.575%2c1.575%2c0%2c0%2c1%2c7.588-.654%2c1.578%2c1.578%2c0%2c0%2c1%2c6.011.924Zm7.121-4.73A3.075%2c3.075%2c0%2c0%2c0%2c10.058-.732%2c3.073%2c3.073%2c0%2c0%2c0%2c13.133%2c2.34%2c3.075%2c3.075%2c0%2c0%2c0%2c16.207-.734a3.076%2c3.076%2c0%2c0%2c0-3.074-3.072ZM13.211.869A1.577%2c1.577%2c0%2c0%2c1%2c11.635-.707a1.577%2c1.577%2c0%2c0%2c1%2c1.576-1.576A1.577%2c1.577%2c0%2c0%2c1%2c14.787-.707%2c1.577%2c1.577%2c0%2c0%2c1%2c13.211.869Zm2.26-15.555a3.853%2c3.853%2c0%2c0%2c1%2c.631%2c4.1L9.533-2.23s-4.518-5.2-6.357-7.777A4.217%2c4.217%2c0%2c0%2c1%2c3.279-15L9.533-7.012ZM9.533-3.965a.789.789%2c0%2c0%2c0%2c.789-.789.789.789%2c0%2c0%2c0-.789-.789.789.789%2c0%2c0%2c0-.789.789A.789.789%2c0%2c0%2c0%2c9.533-3.965Z' transform='translate(-2.384 15)'/%3e %3c/clipPath%3e %3c/defs%3e %3cg id='icon_videoCut' transform='translate(0 16)'%3e %3cg id='%e7%bb%84_1219' data-name='%e7%bb%84 1219' class='cls-2' transform='translate(0 -16)'%3e %3cpath id='%e8%b7%af%e5%be%84_682' data-name='%e8%b7%af%e5%be%84 682' class='cls-3' d='M-5-21H27.5V11.5H-5Z' transform='translate(-1.25 14.75)'/%3e %3c/g%3e %3cg id='%e7%bb%84_1220' data-name='%e7%bb%84 1220' class='cls-4' transform='translate(2.98 -14.75)'%3e %3cpath id='%e8%b7%af%e5%be%84_684' data-name='%e8%b7%af%e5%be%84 684' class='cls-5' d='M-2.616-20H23.926V10H-2.616Z' transform='translate(-3.634 13.75)'/%3e %3c/g%3e %3c/g%3e%3c/svg%3e";module.exports=img;
@@ -1 +0,0 @@
1
- "use strict";var img="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='72' height='24' viewBox='0 0 72 24'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: none%3b %7d .cls-2 %7b fill: %23e02020%3b %7d .cls-3 %7b clip-path: url(%23clip-path)%3b %7d .cls-4 %7b fill: rgba(0%2c0%2c0%2c0)%3b %7d .cls-5 %7b clip-path: url(%23clip-path-2)%3b %7d .cls-6%2c .cls-7 %7b fill: white%3b %7d .cls-7 %7b font-size: 14px%3b font-family: SourceHanSansCN-Medium%2c Source Han Sans CN%3b font-weight: 500%3b %7d %3c/style%3e %3cclipPath id='clip-path'%3e %3cpath id='%e8%b7%af%e5%be%84_683' data-name='%e8%b7%af%e5%be%84 683' class='cls-1' d='M0-2H14V-16H0Z' transform='translate(0 16)'/%3e %3c/clipPath%3e %3cclipPath id='clip-path-2'%3e %3cpath id='%e8%b7%af%e5%be%84_685' data-name='%e8%b7%af%e5%be%84 685' class='cls-1' d='M4.884-7.02A2.133%2c2.133%2c0%2c0%2c0%2c2.752-4.886%2c2.132%2c2.132%2c0%2c0%2c0%2c4.884-2.754%2c2.133%2c2.133%2c0%2c0%2c0%2c7.016-4.888%2c2.132%2c2.132%2c0%2c0%2c0%2c4.884-7.02Zm.037%2c3.163a1.1%2c1.1%2c0%2c0%2c1-1.1-1.1%2c1.1%2c1.1%2c0%2c0%2c1%2c1.1-1.1%2c1.1%2c1.1%2c0%2c0%2c1%2c1.1%2c1.1A1.1%2c1.1%2c0%2c0%2c1%2c4.921-3.857ZM9.9-7.167a2.151%2c2.151%2c0%2c0%2c0-2.15%2c2.151A2.15%2c2.15%2c0%2c0%2c0%2c9.9-2.866a2.151%2c2.151%2c0%2c0%2c0%2c2.15-2.151A2.152%2c2.152%2c0%2c0%2c0%2c9.9-7.167ZM9.955-3.9A1.1%2c1.1%2c0%2c0%2c1%2c8.853-5a1.1%2c1.1%2c0%2c0%2c1%2c1.1-1.1%2c1.1%2c1.1%2c0%2c0%2c1%2c1.1%2c1.1A1.1%2c1.1%2c0%2c0%2c1%2c9.955-3.9Zm1.58-10.885a2.7%2c2.7%2c0%2c0%2c1%2c.441%2c2.869L7.383-6.064S4.224-9.705%2c2.937-11.507A2.953%2c2.953%2c0%2c0%2c1%2c3.01-15L7.383-9.41Zm-4.152%2c7.5a.552.552%2c0%2c0%2c0%2c.552-.552.552.552%2c0%2c0%2c0-.552-.552.552.552%2c0%2c0%2c0-.552.552A.552.552%2c0%2c0%2c0%2c7.383-7.278Z' transform='translate(-2.384 15)'/%3e %3c/clipPath%3e %3c/defs%3e %3cg id='icon_videoCutting' transform='translate(-32 -218)'%3e %3crect id='%e7%9f%a9%e5%bd%a2_414' data-name='%e7%9f%a9%e5%bd%a2 414' class='cls-2' width='72' height='24' rx='4' transform='translate(32 218)'/%3e %3cg id='%e7%bb%84_1232' data-name='%e7%bb%84 1232' transform='translate(3)'%3e %3cg id='%e7%bb%84_1230' data-name='%e7%bb%84 1230' transform='translate(36 239)'%3e %3cg id='%e7%bb%84_1219' data-name='%e7%bb%84 1219' class='cls-3' transform='translate(0 -16)'%3e %3cpath id='%e8%b7%af%e5%be%84_682' data-name='%e8%b7%af%e5%be%84 682' class='cls-4' d='M-5-21H17.75V1.75H-5Z' transform='translate(0.625 16.625)'/%3e %3c/g%3e %3cg id='%e7%bb%84_1220' data-name='%e7%bb%84 1220' class='cls-5' transform='translate(2.091 -15.123)'%3e %3cpath id='%e8%b7%af%e5%be%84_684' data-name='%e8%b7%af%e5%be%84 684' class='cls-6' d='M-2.616-20H15.945V.993H-2.616Z' transform='translate(-1.755 15.626)'/%3e %3c/g%3e %3c/g%3e %3ctext id='%e6%88%aa%e5%8f%96%e4%b8%ad' class='cls-7' transform='translate(52 235)'%3e%3ctspan x='0' y='0'%3e%e6%88%aa%e5%8f%96%e4%b8%ad%3c/tspan%3e%3c/text%3e %3c/g%3e %3c/g%3e%3c/svg%3e";module.exports=img;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),constant=require("./constant.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const VideoClipToolContext=React__default.default.createContext({result:[],selectedID:"",attributeList:[],clipStatus:constant.EClipStatus.Stop}),VideoClipToolContextProvider=VideoClipToolContext.Provider,VideoClipAnnotatedListContext=React__default.default.createContext({onSelectedTimeSlice:()=>{},removeTimeSlice:()=>{},updateSelectedSliceTimeProperty:()=>{}});VideoClipAnnotatedListContext.Provider,exports.VideoClipAnnotatedListContext=VideoClipAnnotatedListContext,exports.VideoClipToolContext=VideoClipToolContext,exports.VideoClipToolContextProvider=VideoClipToolContextProvider;
@@ -1 +0,0 @@
1
- "use strict";var audio=require("../../../../utils/audio.js"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),React=require("react"),constant=require("../constant.js"),utils=require("../../../videoPlayer/utils.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const ToolTipForClip=t=>{var a,l;const{slot:n,item:e,attributeList:o}=t,{t:r}=reactI18next.useTranslation();if(!n)return null;const{type:s,attribute:d,textAttribute:c}=e;if(e.start===void 0||e.end===void 0)return null;const i=utils.decimalReserved(e.start,2),u=(l=utils.decimalReserved((a=e.end)!=null?a:0,2))!=null?l:0,v=React__default.default.createElement("div",null,React__default.default.createElement("div",null,s===constant.ETimeSliceType.Period?`${audio.timeFormat(i,"ss:SS")}~${audio.timeFormat(u,"ss:SS")}\uFF0C${audio.precisionMinus(u,i)}s`:audio.timeFormat(i,"ss:SS")),React__default.default.createElement("div",null,`${r("Attribute")}\uFF1A${lbAnnotation.AttributeUtils.getAttributeShowText(d,o)||r("NoAttribute")}`),React__default.default.createElement("div",null,`${r("textTool")}\uFF1A${c}`));return React__default.default.createElement(antd.Tooltip,{title:v},n)};module.exports=ToolTipForClip;
@@ -1 +0,0 @@
1
- "use strict";var audio=require("../../../../../utils/audio.js"),index$1=require("../../../../../utils/index.js"),icons=require("@ant-design/icons"),React=require("react"),constant=require("../../constant.js"),index=require("../timeSliceRange/index.js"),ToolTipForClip=require("../ToolTipForClip.js"),index$2=require("../videoTrack/index.js"),index_module=require("./index.module.scss.js"),utils=require("../../../../videoPlayer/utils.js"),ctx=require("../../../../../store/ctx.js"),reactRedux=require("react-redux"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const TimeSliceIcon=({type:e})=>e===constant.ETimeSliceType.Time?React__default.default.createElement(icons.EnvironmentFilled,null):React__default.default.createElement(icons.ScissorOutlined,{rotate:270}),EmptyVideoClipAnnotatedList=()=>{const{t:e}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:index_module.noContent},React__default.default.createElement("div",null,e("NoClippedData")),React__default.default.createElement("div",null,React__default.default.createElement("span",{className:index_module.hotkey},"X"),e("ClipSlice")),React__default.default.createElement("div",null,React__default.default.createElement("span",{className:index_module.hotkey},"E"),e("TimeStamp")))},VideoClipAnnotatedListWrapper=({children:e})=>{const t=e.length===0;return React__default.default.createElement("div",{className:index$1.classnames({[index_module.empty]:t,[index_module.timeSliceListContent]:!0})},t?React__default.default.createElement(EmptyVideoClipAnnotatedList,null):e)},VideoClipAnnotatedItem=({timeSliceProps:e,index:t,exportContext:i})=>{const{selectedID:a,attributeList:n,onSelectedTimeSlice:r,removeTimeSlice:d}=i;return React__default.default.createElement("div",{key:t,className:index$1.classnames({[index_module.timeSliceItem]:!0,[index_module.timeSliceItemActivated]:e.id===a}),onClick:()=>{r(e)}},React__default.default.createElement(ToolTipForClip,{slot:React__default.default.createElement("div",{className:index_module.timeSliceItemContent},React__default.default.createElement("div",{className:index_module.textOverflow},`${t+1}\u3001\u3010${constant.TIME_SLICE_TYPE[e.type]}\u3011 ${index$2.getDisplayContent(e,n)}`),React__default.default.createElement("div",{className:index$1.classnames({[index_module.textOverflow]:!0})},React__default.default.createElement(TimeSliceIcon,{type:e.type}),React__default.default.createElement("span",{style:{marginLeft:10}},`${audio.timeFormat(e.start,"ss:SS")} ${e.end&&e.type===constant.ETimeSliceType.Period?"~ "+audio.timeFormat(e.end,"ss:SS")+", "+utils.decimalReserved(e.end-e.start,2)+"s":""}`))),item:e,attributeList:n}),React__default.default.createElement(icons.CloseCircleFilled,{className:index_module.timeSliceItemDeleteIcon,onClick:u=>{u.stopPropagation(),d(e)}}))},VideoClipAnnotatedList=e=>{const{toolInstance:t}=e,{selectedID:i,result:a,videoPlayer:n,clipStatus:r,updateSelectedSliceTimeProperty:d}=(t==null?void 0:t.exportContext)||{},[u,o]=React.useState(0),{t:m}=reactI18next.useTranslation();React.useEffect(()=>(t&&t.singleOn("changeClipSidebar",l=>{o(s=>s+1)}),()=>{var l;(l=t==null?void 0:t.unbindAll)==null||l.call(t,"changeClipSidebar")}),[t]);const v=a==null?void 0:a.find(l=>l.id===i),c=a==null?void 0:a.filter(l=>l.end!==null);return(t==null?void 0:t.exportContext)?React__default.default.createElement("div",null,React__default.default.createElement("div",{className:index_module.timeSliceListHeader},m("AnnotatedList")),React__default.default.createElement(VideoClipAnnotatedListWrapper,null,c==null?void 0:c.map((l,s)=>React__default.default.createElement(VideoClipAnnotatedItem,{timeSliceProps:l,index:s,key:l.id,exportContext:(t==null?void 0:t.exportContext)||{}}))),React__default.default.createElement(index,{selectedTimeSlice:v,videoPlayer:n,updateTimeForSelected:d,disabled:r===constant.EClipStatus.Clipping})):null},mapStateToProps=({annotation:e})=>{const{toolInstance:t}=e;return{toolInstance:t}};var VideoClipAnnotatedList$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(VideoClipAnnotatedList);module.exports=VideoClipAnnotatedList$1;
@@ -1 +0,0 @@
1
- "use strict";var styles={timeSliceListContent:"index-module_timeSliceListContent__gvFHy",empty:"index-module_empty__wcFM6",noContent:"index-module_noContent__zjGb0",hotkey:"index-module_hotkey__dDkgv",timeSliceItem:"index-module_timeSliceItem__Xa-cQ",timeSliceItemActivated:"index-module_timeSliceItemActivated__Zlb3b",timeSliceAttribute:"index-module_timeSliceAttribute__Q5E-f",timeSliceItemContent:"index-module_timeSliceItemContent__Aqa8l",timeSliceItemDeleteIcon:"index-module_timeSliceItemDeleteIcon__nlQ6B"};module.exports=styles;
@@ -1 +0,0 @@
1
- "use strict";var reResizable=require("re-resizable"),React=require("react"),ToolTipForClip=require("../ToolTipForClip.js"),index=require("../videoTrack/index.js"),index_module=require("./index.module.scss.js"),utils=require("../../../../videoPlayer/utils.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const TRACK_HEIGHT=45,ResizableSnippet=e=>{var t;const{track:r,currentTime:a,attributeList:n,readonly:p,onClipping:h,onTrackResizeStart:o}=e,{start:s,end:m}=r,_=m||a,[g,d]=React.useState({width:0,height:0}),w=(i,O,P,u)=>{var v;const R=(u.width-g.width)/((v=P.parentNode)==null?void 0:v.clientWidth);d(u),e.onResize(O,R)},y=()=>{d({width:0,height:0}),o==null||o()},c=__spreadValues({transform:"none",overflow:"hidden",textOverflow:"ellipsis",fontSize:12},e.style),b={top:!1,right:!0,left:!0,bottom:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},f=React__default.default.createElement("div",{style:{margin:"10px 5px"}},React__default.default.createElement("div",{className:index_module.textOverflow},`${utils.decimalReserved(Math.max(_-s,1),0)}s`),React__default.default.createElement("div",{className:index_module.textOverflow},index.getDisplayContent(r,n)));let l;if(h||p||!e.isSelected){const i=__spreadProps(__spreadValues({},c),{height:TRACK_HEIGHT});e.isSelected&&a-s<0&&(i.width=100,i.backgroundColor="transparent"),l=React__default.default.createElement("div",{style:i},f)}else l=React__default.default.createElement(reResizable.Resizable,{size:{width:(t=e.style.width)!=null?t:0,height:TRACK_HEIGHT},minWidth:1,onResize:w,onResizeStart:y,enable:b,style:c},f);return React__default.default.createElement(ToolTipForClip,{slot:l,item:__spreadProps(__spreadValues({},r),{end:r.end===null?a:r.end}),attributeList:n})};module.exports=ResizableSnippet;
@@ -1 +0,0 @@
1
- "use strict";var styles={textOverflow:"index-module_textOverflow__HcSP3"};module.exports=styles;
@@ -1 +0,0 @@
1
- "use strict";var index=require("../../../../../utils/index.js"),antd=require("antd"),_=require("lodash"),React=require("react"),constant=require("../../constant.js"),index_module=require("./index.module.scss.js"),audio=require("../../../../../utils/audio.js"),utils=require("../../../../videoPlayer/utils.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(u){return u&&typeof u=="object"&&"default"in u?u:{default:u}}var ___default=_interopDefaultLegacy(_),React__default=_interopDefaultLegacy(React);const TimeInput=({initialVal:u,timeType:l="",videoPlayer:a,min:i,max:F,updateTime:n,disabled:o})=>{const[E,c]=React.useState(""),{t:m}=reactI18next.useTranslation(),d=()=>{C(E).then(t=>{n(t)}).catch(t=>{antd.message.error(t),p()})},B=t=>{const[r,s]=t.split(":");return~~r*60+parseFloat(s)},f=(t,r=!1)=>{if(i!==void 0&&t<i){const e=audio.timeFormat(i,"ss.SS");return r?`\u4FEE\u6539\u65F6\u95F4\u5931\u8D25, \u4FEE\u6539\u65F6\u95F4\u4E0D\u5141\u8BB8\u5C11\u4E8E${e}`:`\u5F53\u524D\u65F6\u95F4\u683C\u5F0F\u8F93\u5165\u6709\u8BEF, \u8F93\u5165\u65F6\u95F4\u4E0D\u5141\u8BB8\u5C11\u4E8E${e}`}if(F!==void 0&&t>F){const e=audio.timeFormat(F,"ss.SS");return r?`\u4FEE\u6539\u65F6\u95F4\u5931\u8D25, \u4FEE\u6539\u65F6\u95F4\u4E0D\u5141\u8BB8\u5927\u4E8E${e}`:`\u5F53\u524D\u65F6\u95F4\u683C\u5F0F\u8F93\u5165\u6709\u8BEF, \u8F93\u5165\u65F6\u95F4\u4E0D\u5141\u8BB8\u5927\u4E8E${e}`}const s=a==null?void 0:a.duration;if(a&&s&&t>s){const e=audio.timeFormat(s,"ss.SS");return r?`\u4FEE\u6539\u65F6\u95F4\u5931\u8D25, \u8F93\u5165\u65F6\u95F4\u4E0D\u5141\u8BB8\u5927\u4E8E${e}`:`\u5F53\u524D\u65F6\u95F4\u683C\u5F0F\u8F93\u5165\u6709\u8BEF, \u8F93\u5165\u65F6\u95F4\u4E0D\u5141\u8BB8\u5927\u4E8E${e}`}},C=t=>new Promise((r,s)=>{if(t.match(/^\d+\:\d\d\.\d\d$/)){const e=B(t),v=f(e);if(v){s(v);return}r(e)}else s(new Error("\u5F53\u524D\u65F6\u95F4\u683C\u5F0F\u8F93\u5165\u6709\u8BEF, \u65F6\u95F4\u683C\u5F0F\u5E94\u4E3Axx:xx.xx"))}),p=()=>{___default.default.isNumber(u)&&c(audio.timeFormat(u,"ss.SS"))},D=()=>{if(!o&&a){const t=utils.decimalReserved(a==null?void 0:a.currentTime,2),r=f(t,!0);if(r){antd.message.error(r);return}n(t)}};return React.useEffect(()=>{p()},[u]),React__default.default.createElement("div",{className:index_module.inputWrapper},React__default.default.createElement(antd.Input,{placeholder:"00:00.00",value:E,onChange:t=>c(t.target.value),onBlur:d,onPressEnter:d,disabled:o}),React__default.default.createElement("span",{className:index.classnames({[index_module.getCurr]:!0,[index_module.disabled]:o!=null?o:!1}),onClick:D},m(l==="start"?"GetStartTime":"GetEndTime")))},TimeSliceRange=({selectedTimeSlice:u,videoPlayer:l,updateTimeForSelected:a,disabled:i})=>{if(!u)return null;const{t:F}=reactI18next.useTranslation();return(u==null?void 0:u.type)===constant.ETimeSliceType.Period?React__default.default.createElement("div",{className:index_module.timeSliceInputContainer},React__default.default.createElement("div",{className:index_module.title},F("ClipTime")),React__default.default.createElement("div",{className:index_module.inputContainer},React__default.default.createElement(TimeInput,{initialVal:u.start,timeType:"start",videoPlayer:l,max:audio.precisionMinus(u.end,constant.PER_SLICE_CHANGE),updateTime:n=>{a(n,"start")},disabled:i}),React__default.default.createElement("span",{className:index_module.spliter}),React__default.default.createElement(TimeInput,{initialVal:u.end,timeType:"end",videoPlayer:l,min:audio.precisionAdd(u.start,constant.PER_SLICE_CHANGE),updateTime:n=>{a(n,"end")},disabled:i}))):React__default.default.createElement("div",{className:index_module.timeSliceInputContainer},React__default.default.createElement("div",{className:index_module.title},F("StampTime")),React__default.default.createElement(TimeInput,{initialVal:u.start,videoPlayer:l,updateTime:n=>{a(n,"start")}}))};module.exports=TimeSliceRange;
@@ -1 +0,0 @@
1
- "use strict";var styles={timeSliceInputContainer:"index-module_timeSliceInputContainer__579hr",title:"index-module_title__9kdsk",inputWrapper:"index-module_inputWrapper__uXmv-",getCurr:"index-module_getCurr__-dchP",disabled:"index-module_disabled__j6aK6",inputContainer:"index-module_inputContainer__PqtI8",spliter:"index-module_spliter__wXZhC"};module.exports=styles;
@@ -1 +0,0 @@
1
- "use strict";var React=require("react"),index_module=require("./index.module.scss.js"),icon_videoCut=require("../../../../../assets/annotation/video/icon_videoCut.svg.js"),icon_timePoint=require("../../../../../assets/annotation/video/icon_timePoint.svg.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const VideoClipToolHotkey=({toggleClipStatus:e,addTime:t})=>React__default.default.createElement("div",{className:index_module.clipToolbar},React__default.default.createElement("span",{className:index_module.buttonWrapper},React__default.default.createElement("i",{className:index_module.cutButton,onClick:()=>{e==null||e()},style:{backgroundImage:icon_videoCut}}),"\u622A\u53D6"),React__default.default.createElement("span",{className:index_module.buttonWrapper},React__default.default.createElement("i",{className:index_module.localButton,onClick:t,style:{backgroundImage:icon_timePoint}}),"\u6807\u65F6\u95F4\u70B9"));module.exports=VideoClipToolHotkey;
@@ -1 +0,0 @@
1
- "use strict";var styles={clipToolbar:"index-module_clipToolbar__amC2X",buttonWrapper:"index-module_buttonWrapper__o1C44",cutButton:"index-module_cutButton__M6mOs",localButton:"index-module_localButton__6D1-H"};module.exports=styles;
@@ -1 +0,0 @@
1
- "use strict";var index=require("../../../../../utils/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),React=require("react"),reactTransitionGroup=require("react-transition-group"),constant=require("../../constant.js"),index_module=require("./index.module.scss.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__spreadValues=(e,t)=>{for(var i in t||(t={}))__hasOwnProp.call(t,i)&&__defNormalProp(e,i,t[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(t))__propIsEnum.call(t,i)&&__defNormalProp(e,i,t[i]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const VideoTimeSlicesOverVideo=e=>{const{attributeList:t,result:i,currentTime:l,extraStyle:u}=e,m=r=>{const{type:a,start:s,end:c}=r;let n=!1;return a===constant.ETimeSliceType.Time?n=lbAnnotation.MathUtils.isInRange(l,[s-.1,s+.1]):n=c===null||lbAnnotation.MathUtils.isInRange(l,[s,c]),n},d=[],o=[];i.forEach(r=>{(m(r)?o:d).push(r)});const p=o.sort((r,a)=>r.start-a.start).map(r=>__spreadProps(__spreadValues({},r),{withinTime:!0})).map(r=>React__default.default.createElement(reactTransitionGroup.CSSTransition,{classNames:"fade",key:r.id,timeout:500},React__default.default.createElement("div",{className:index.classnames({[index_module.timeSliceWrapper]:!0,[index_module.active]:r.withinTime})},React__default.default.createElement("div",{className:index_module.timeSliceItemAttribute,style:{textAlign:"right"}},React__default.default.createElement("span",{style:{backgroundColor:lbAnnotation.AttributeUtils.getAttributeColor(r.attribute,t)}},`${constant.TIME_SLICE_TYPE[r.type]}: ${lbAnnotation.AttributeUtils.getAttributeShowText(r.attribute,t)||"\u65E0\u5C5E\u6027"}`)),r.textAttribute&&React__default.default.createElement("div",{className:index_module.timeSliceItemText},`\u6587\u672C: ${r.textAttribute}`))));return React__default.default.createElement("div",{className:index_module.videoTimeSlices,style:u},React__default.default.createElement(reactTransitionGroup.TransitionGroup,{className:"fade-group"},p))};module.exports=VideoTimeSlicesOverVideo;