@labelbee/lb-components 1.23.0-alpha.6 → 1.23.0-alpha.60

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 (180) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/assets/annotation/icon_link.svg.js +1 -0
  3. package/dist/assets/annotation/icon_unlink.svg.js +1 -0
  4. package/dist/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
  5. package/dist/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
  6. package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  7. package/dist/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  8. package/dist/assets/icons/ad33251.svg +26 -0
  9. package/dist/components/AnnotationView/index.js +1 -1
  10. package/dist/components/LLMToolView/index.js +1 -1
  11. package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
  12. package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  13. package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
  14. package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  15. package/dist/components/LLMToolView/sidebar/index.js +1 -1
  16. package/dist/components/LLMToolView/utils/data.js +1 -1
  17. package/dist/components/NLPToolView/index.js +1 -1
  18. package/dist/components/NLPToolView/textContent/index.js +1 -1
  19. package/dist/components/audioAnnotate/audioContext/index.js +1 -1
  20. package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
  21. package/dist/components/audioAnnotate/index.js +1 -1
  22. package/dist/components/audioAnnotate/textInput/index.js +1 -1
  23. package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  24. package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
  25. package/dist/components/audioPlayer/clipRegion/index.js +1 -1
  26. package/dist/components/audioPlayer/index.js +1 -1
  27. package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
  28. package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
  29. package/dist/components/longText/index.js +1 -1
  30. package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
  31. package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  32. package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
  33. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  34. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  35. package/dist/components/pointCloudView/PointCloudListener.js +1 -1
  36. package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  37. package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
  38. package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
  39. package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  40. package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
  41. package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
  42. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  43. package/dist/components/pointCloudView/hooks/usePolygon.js +1 -1
  44. package/dist/components/pointCloudView/hooks/useRotate.js +1 -1
  45. package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  46. package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
  47. package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
  48. package/dist/components/pointCloudView/index.js +1 -1
  49. package/dist/components/pointCloudView/utils/map.js +1 -0
  50. package/dist/components/subAttributeList/index.js +1 -0
  51. package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
  52. package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  53. package/dist/index.css +59 -17
  54. package/dist/index.js +1 -1
  55. package/dist/store/Actions.js +1 -1
  56. package/dist/store/annotatedBox/index.js +1 -1
  57. package/dist/store/annotation/actionCreators.js +1 -1
  58. package/dist/store/annotation/reducer.js +1 -1
  59. package/dist/types/App.d.ts +3 -1
  60. package/dist/types/components/AnnotationView/index.d.ts +1 -0
  61. package/dist/types/components/LLMToolView/utils/data.d.ts +1 -1
  62. package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
  63. package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
  64. package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
  65. package/dist/types/components/audioPlayer/index.d.ts +28 -21
  66. package/dist/types/components/longText/index.d.ts +1 -0
  67. package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
  68. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +2 -1
  69. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +24 -4
  70. package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +21 -0
  71. package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
  72. package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +5 -0
  73. package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
  74. package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +3 -2
  75. package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
  76. package/dist/types/components/subAttributeList/index.d.ts +10 -0
  77. package/dist/types/components/videoAnnotate/index.d.ts +2 -1
  78. package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
  79. package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
  80. package/dist/types/index.d.ts +6 -1
  81. package/dist/types/store/Actions.d.ts +1 -0
  82. package/dist/types/store/annotatedBox/index.d.ts +2 -0
  83. package/dist/types/store/annotation/actionCreators.d.ts +3 -2
  84. package/dist/types/store/annotation/reducer.d.ts +1 -0
  85. package/dist/types/store/annotation/types.d.ts +9 -2
  86. package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
  87. package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +23 -0
  88. package/dist/types/utils/index.d.ts +25 -1
  89. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
  90. package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
  91. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
  92. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
  93. package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
  94. package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
  95. package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
  96. package/dist/utils/AnnotationDataUtils.js +1 -1
  97. package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -0
  98. package/dist/utils/index.js +1 -1
  99. package/dist/views/MainView/index.js +1 -1
  100. package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
  101. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  102. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  103. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  104. package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
  105. package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  106. package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  107. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  108. package/es/App.js +1 -1
  109. package/es/assets/annotation/icon_link.svg.js +1 -0
  110. package/es/assets/annotation/icon_unlink.svg.js +1 -0
  111. package/es/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
  112. package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
  113. package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  114. package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  115. package/es/components/AnnotationView/index.js +1 -1
  116. package/es/components/LLMToolView/index.js +1 -1
  117. package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
  118. package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  119. package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
  120. package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  121. package/es/components/LLMToolView/sidebar/index.js +1 -1
  122. package/es/components/LLMToolView/utils/data.js +1 -1
  123. package/es/components/NLPToolView/index.js +1 -1
  124. package/es/components/NLPToolView/textContent/index.js +1 -1
  125. package/es/components/audioAnnotate/audioContext/index.js +1 -1
  126. package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
  127. package/es/components/audioAnnotate/index.js +1 -1
  128. package/es/components/audioAnnotate/textInput/index.js +1 -1
  129. package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  130. package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
  131. package/es/components/audioPlayer/clipRegion/index.js +1 -1
  132. package/es/components/audioPlayer/index.js +1 -1
  133. package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
  134. package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
  135. package/es/components/longText/index.js +1 -1
  136. package/es/components/pointCloud2DRectOperationView/index.js +1 -1
  137. package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  138. package/es/components/pointCloudView/PointCloud2DView.js +1 -1
  139. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  140. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  141. package/es/components/pointCloudView/PointCloudListener.js +1 -1
  142. package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  143. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  144. package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
  145. package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  146. package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
  147. package/es/components/pointCloudView/hooks/useHistory.js +1 -1
  148. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  149. package/es/components/pointCloudView/hooks/usePolygon.js +1 -1
  150. package/es/components/pointCloudView/hooks/useRotate.js +1 -1
  151. package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  152. package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
  153. package/es/components/pointCloudView/hooks/useStatus.js +1 -1
  154. package/es/components/pointCloudView/index.js +1 -1
  155. package/es/components/pointCloudView/utils/map.js +1 -0
  156. package/es/components/subAttributeList/index.js +1 -0
  157. package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
  158. package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  159. package/es/index.css +59 -17
  160. package/es/index.js +1 -1
  161. package/es/store/Actions.js +1 -1
  162. package/es/store/annotatedBox/index.js +1 -1
  163. package/es/store/annotation/actionCreators.js +1 -1
  164. package/es/store/annotation/reducer.js +1 -1
  165. package/es/utils/AnnotationDataUtils.js +1 -1
  166. package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
  167. package/es/utils/index.js +1 -1
  168. package/es/views/MainView/index.js +1 -1
  169. package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
  170. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  171. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  172. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  173. package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
  174. package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  175. package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  176. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  177. package/package.json +3 -3
  178. package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
  179. package/dist/assets/icons/9d70807.svg +0 -5
  180. package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
@@ -1 +1 @@
1
- import{getClassName as n}from"../../utils/dom.js";import t,{useContext as I,useState as T,useEffect as p}from"react";import y from"./PointCloud3DView.js";import k from"./PointCloudBackView.js";import B from"./PointCloudTopView.js";import F from"./PointCloudSideView.js";import _ from"./PointCloud2DView.js";import R from"./PointCloudListener.js";import M from"./PointCloudSegmentListener.js";import G from"./PointCloudSegment.js";import O from"./PointCloudSegmentStatus.js";import Z from"./PointCloudSegmentToolbar.js";import U from"./PointCloudSegment2DView.js";import{connect as W}from"react-redux";import{LabelBeeContext as $,useDispatch as q}from"../../store/ctx.js";import{AnnotatedAttributesPanelFixedLeft as z,AnnotatedAttributesPanelFixedRight as H}from"../../views/MainView/toolFooter/AnnotatedAttributes/index.js";import{PointCloudContext as J}from"./PointCloudContext.js";import{PointCloudUtils as K,EPointCloudPattern as Q}from"@labelbee/lb-utils";import{useCustomToolInstance as X}from"../../hooks/annotation.js";import{jsonParser as Y}from"../../utils/index.js";import{a2MapStateToProps as tt}from"../../store/annotation/map.js";import g from"classnames";import et from"./components/sideAndBackOverView/index.js";import{SetLoadPCDFileLoading as ot}from"../../store/annotation/actionCreators.js";const nt=E=>{const{currentData:a,imgList:L,drawLayerSlot:c,checkMode:i,intelligentFit:S,imgIndex:w,config:x,measureVisible:b}=E,e=I(J),{globalPattern:d,setGlobalPattern:j,selectedIDs:C}=e,v=q(),[l,P]=T(!1),V=(C==null?void 0:C.length)>0&&l,h=Y(a.result),{toolInstanceRef:r,clearToolInstance:D}=X({basicInfo:h});if(p(()=>{r.current.setPointCloudGlobalPattern=o=>{o!==d&&(j(o),e.clearAllDetectionInstance(),D())}},[d]),p(()=>{var o;if(ot(v,!0),a){const{boxParamsList:s,polygonList:m,lineList:u,sphereParamsList:A,segmentation:N}=K.parsePointCloudCurrentResult((o=a==null?void 0:a.result)!=null?o:"");e.setPointCloudResult(s),e.setPolygonList(m),e.setLineList(u),e.setPointCloudSphereList(A),e.setSegmentation(N)}},[w]),p(()=>{r.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],r.current.exportCustomData=()=>{var o,s,m,u;return{resultPolygon:(o=e.polygonList)!=null?o:[],resultLine:(s=e.lineList)!=null?s:[],resultPoint:(m=e.pointCloudSphereList)!=null?m:[],segmentation:(u=e.segmentation)!=null?u:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),L.length===0)return null;if(d===Q.Segmentation)return t.createElement(t.Fragment,null,t.createElement(M,{checkMode:i,toolInstanceRef:r}),t.createElement(Z,null),t.createElement("div",{className:n("point-cloud-layout")},t.createElement(G,{checkMode:i}),t.createElement(U,null)),t.createElement(O,{config:x}),c==null?void 0:c({direct:!0}));let f=t.createElement("div",{className:n("point-cloud-container","left-bottom")},t.createElement(k,{checkMode:i}),t.createElement(F,{checkMode:i}));return l&&(f=t.createElement(et,{selectAndEnlarge:V,checkMode:i})),t.createElement(t.Fragment,null,t.createElement(R,{checkMode:i,toolInstanceRef:r}),t.createElement("div",{className:n("point-cloud-layout"),onContextMenu:o=>o.preventDefault()},t.createElement("div",{className:n("point-cloud-wrapper")},t.createElement(z,null),t.createElement("div",{className:n("point-cloud-content")},t.createElement("div",{className:n("point-cloud-container","left")},t.createElement(y,null),f),t.createElement("div",{className:g({[n("point-cloud-container","right")]:!0,[n("point-cloud-container","rightZoom")]:l})},t.createElement(B,{drawLayerSlot:c,checkMode:i,intelligentFit:S,setIsEnlargeTopView:P,onExitZoom:()=>{P(!1)},isEnlargeTopView:l}),t.createElement("div",{className:g({[n("point-cloud-container","right-bottom")]:!l,[n("point-cloud-container","right-bottom-floatLeft")]:l})},t.createElement(_,{isEnlargeTopView:l,thumbnailWidth:l?300:455,checkMode:i,measureVisible:b})))),t.createElement(H,null))))};var it=W(tt,null,null,{context:$})(nt);export{it as default};
1
+ import{getClassName as n}from"../../utils/dom.js";import t,{useContext as T,useState as y,useEffect as C}from"react";import _ from"./PointCloud3DView.js";import k from"./PointCloudBackView.js";import B from"./PointCloudTopView.js";import F from"./PointCloudSideView.js";import R from"./PointCloud2DView.js";import M from"./PointCloudListener.js";import G from"./PointCloudSegmentListener.js";import O from"./PointCloudSegment.js";import Z from"./PointCloudSegmentStatus.js";import U from"./PointCloudSegmentToolbar.js";import W from"./PointCloudSegment2DView.js";import{connect as $}from"react-redux";import{LabelBeeContext as q,useDispatch as z}from"../../store/ctx.js";import{AnnotatedAttributesPanelFixedLeft as H,AnnotatedAttributesPanelFixedRight as J}from"../../views/MainView/toolFooter/AnnotatedAttributes/index.js";import{PointCloudContext as K}from"./PointCloudContext.js";import{PointCloudUtils as Q,EPointCloudPattern as X}from"@labelbee/lb-utils";import{useCustomToolInstance as Y}from"../../hooks/annotation.js";import{jsonParser as tt}from"../../utils/index.js";import{a2MapStateToProps as et}from"../../store/annotation/map.js";import L from"classnames";import ot from"./components/sideAndBackOverView/index.js";import{SetLoadPCDFileLoading as nt}from"../../store/annotation/actionCreators.js";const it=E=>{const{currentData:a,imgList:S,drawLayerSlot:d,checkMode:i,intelligentFit:w,imgIndex:x,config:b,measureVisible:j}=E,e=T(K),{globalPattern:p,setGlobalPattern:v,selectedIDs:P}=e,V=z(),[l,f]=y(!1),h=(P==null?void 0:P.length)>0&&l,D=tt(a.result),{toolInstanceRef:r,clearToolInstance:A}=Y({basicInfo:D});if(C(()=>{r.current.setPointCloudGlobalPattern=o=>{o!==p&&(v(o),e.clearAllDetectionInstance(),A())}},[p]),C(()=>{var o;if(nt(V,!0),a){const{boxParamsList:s,polygonList:m,lineList:u,sphereParamsList:c,segmentation:N,rectList:I}=Q.parsePointCloudCurrentResult((o=a==null?void 0:a.result)!=null?o:"");e.setPointCloudResult(s),e.setPolygonList(m),e.setLineList(u),e.setPointCloudSphereList(c),e.setRectList(I),e.setSegmentation(N)}},[x]),C(()=>{r.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],r.current.exportCustomData=()=>{var o,s,m,u,c;return{resultPolygon:(o=e.polygonList)!=null?o:[],resultLine:(s=e.lineList)!=null?s:[],resultPoint:(m=e.pointCloudSphereList)!=null?m:[],resultRect:(u=e.rectList)!=null?u:[],segmentation:(c=e.segmentation)!=null?c:[]}}},[e.pointCloudBoxList,e.rectList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),S.length===0)return null;if(p===X.Segmentation)return t.createElement(t.Fragment,null,t.createElement(G,{checkMode:i,toolInstanceRef:r}),t.createElement(U,null),t.createElement("div",{className:n("point-cloud-layout")},t.createElement(O,{checkMode:i}),t.createElement(W,null)),t.createElement(Z,{config:b}),d==null?void 0:d({direct:!0}));let g=t.createElement("div",{className:n("point-cloud-container","left-bottom")},t.createElement(k,{checkMode:i}),t.createElement(F,{checkMode:i}));return l&&(g=t.createElement(ot,{selectAndEnlarge:h,checkMode:i})),t.createElement(t.Fragment,null,t.createElement(M,{checkMode:i,toolInstanceRef:r}),t.createElement("div",{className:n("point-cloud-layout"),onContextMenu:o=>o.preventDefault()},t.createElement("div",{className:n("point-cloud-wrapper")},t.createElement(H,null),t.createElement("div",{className:n("point-cloud-content")},t.createElement("div",{className:n("point-cloud-container","left")},t.createElement(_,null),g),t.createElement("div",{className:L({[n("point-cloud-container","right")]:!0,[n("point-cloud-container","rightZoom")]:l})},t.createElement(B,{drawLayerSlot:d,checkMode:i,intelligentFit:w,setIsEnlargeTopView:f,onExitZoom:()=>{f(!1)},isEnlargeTopView:l}),t.createElement("div",{className:L({[n("point-cloud-container","right-bottom")]:!l,[n("point-cloud-container","right-bottom-floatLeft")]:l})},t.createElement(R,{isEnlargeTopView:l,thumbnailWidth:l?300:455,checkMode:i,measureVisible:j})))),t.createElement(J,null))))};var lt=$(et,null,null,{context:q})(it);export{lt as default};
@@ -0,0 +1 @@
1
+ const s=(n,r,d,a)=>{let e=n.get(r);e||(e=new Map,n.set(r,e));let t=e.get(d);return t||(t=new WeakSet,e.set(d,t)),t.add(a),n};export{s as addMapIndirectWeakSetItem};
@@ -0,0 +1 @@
1
+ import o,{useEffect as g}from"react";import{Checkbox as y,Select as u,Divider as x}from"antd";import{I18nextProvider as S,useTranslation as _}from"react-i18next";import E from"../attributeList/index.js";import{i18n as v}from"@labelbee/lb-utils";var h=Object.defineProperty,s=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,f=(t,a,r)=>a in t?h(t,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[a]=r,P=(t,a)=>{for(var r in a||(a={}))w.call(a,r)&&f(t,r,a[r]);if(s)for(var r of s(a))O.call(a,r)&&f(t,r,a[r]);return t};const k={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"},C=t=>{const{subAttributeList:a,setSubAttribute:r,getValue:i,lang:p}=t,{t:c}=_();g(()=>{var e;p&&((e=v)==null||e.changeLanguage(p))},[]);const m=(e,n)=>{if(Array.isArray(n)){r(e,n.join(";"));return}r(e,n)},d=e=>{const n=i(e);return(e==null?void 0:e.isMulti)?n?n==null?void 0:n.split(";"):[]:n};return o.createElement(o.Fragment,null,a.map(e=>{var n;return(e==null?void 0:e.subSelected)&&o.createElement("div",{style:{marginTop:12},key:e.value},o.createElement("div",{style:k},c("SubAttribute"),"-",e.key),((n=e.subSelected)==null?void 0:n.length)<5?(e==null?void 0:e.isMulti)?o.createElement(y.Group,{style:{padding:"0px 20px 16px 16px"},options:e.subSelected.map(l=>({label:l.key,value:l.value})),value:d(e),onChange:l=>m(e.value,l)}):o.createElement(E,{list:e.subSelected.map(l=>({label:l.key,value:l.value})),selectedAttribute:i(e),num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:l=>r(e.value,l),style:{marginBottom:12}}):o.createElement(u,{style:{margin:"0px 20px 16px 16px",width:"87%"},mode:(e==null?void 0:e.isMulti)?"multiple":void 0,value:d(e),placeholder:c("PleaseSelect"),onChange:l=>m(e.value,l),allowClear:!0},e.subSelected.map(l=>o.createElement(u.Option,{key:l.value,value:l.value},l.key))),o.createElement(x,{style:{margin:0}}))}))},L=t=>o.createElement(S,{i18n:v},o.createElement(C,P({},t)));export{L as default};
@@ -1 +1 @@
1
- import{MathUtils as C,CommonToolUtils as F,uuid as A,AttributeUtils as k}from"@labelbee/lb-annotation";import{jsonParser as P}from"../../../utils/index.js";import{precisionAdd as I,precisionMinus as V,isImageValue as R}from"../../../utils/audio.js";import{message as m}from"antd";import b from"lodash";import g from"react";import _ from"./index.module.scss.js";import{VideoClipToolContextProvider as B}from"./VideoClipToolContext.js";import{EClipStatus as o,ETimeSliceType as T,PER_SLICE_CHANGE as v,SLICE_MIN_TIME as x}from"./constant.js";import{VideoPlayer as j}from"../../videoPlayer/index.js";import M from"./components/videoTimeSlicesOverVideo/index.js";import U from"../../../assets/annotation/video/icon_videoCutting.svg.js";import{decimalReserved as L}from"../../videoPlayer/utils.js";class N extends g.Component{constructor(r){super(r);this.fns=new Map,this.throttledUpdateTime=b.throttle(t=>{this.videoPlayer.currentTime=t},100,{trailing:!0}),this.stepInfo=()=>this.props.stepInfo,this.emitEvent=t=>{const e=this.fns.get(t);e&&e.forEach(i=>{i&&i()})},this.setValid=t=>{this.setState({valid:t}),t===!1&&(this.clearResult(),this.updateSidebar())},this.updateSidebar=()=>{this.emitEvent("changeClipSidebar"),this.emitEvent("updateTextAttribute"),this.emitEvent("changeAttributeSidebar")},this.exportData=()=>{var t,e;const i=(e=(t=this.videoRef)==null?void 0:t.duration)!=null?e:0;return[this.state.result.filter(s=>s.end!==null),{valid:this.state.valid,duration:i}]},this.updateSelectedSliceTimeStartByPer=t=>{var e,i;if(this.state.clipStatus===o.Clipping){m.info("\u622A\u53D6\u4E2D\u4E0D\u652F\u6301\u8C03\u6574\u5F00\u59CB\u65F6\u95F4");return}if(this.selectedSliceIndex>-1){const s=(i=(e=this.videoPlayer)==null?void 0:e.duration)!=null?i:0,{end:l,start:u,type:a}=this.state.result[this.selectedSliceIndex],n=C.withinRange(I(u,t),[0,V(a===T.Time?s:l,v)]);this.updateSelectedSliceTimeProperty(n,"start")}},this.updateSelectedSliceTimeEndByPer=t=>{var e,i;if(this.state.clipStatus===o.Clipping){m.info("\u622A\u53D6\u4E2D\u4E0D\u652F\u6301\u8C03\u6574\u7ED3\u675F\u65F6\u95F4");return}if(this.selectedSliceIndex>-1){const s=this.state.result[this.selectedSliceIndex],l=(i=(e=this.videoPlayer)==null?void 0:e.duration)!=null?i:0;if(s.type===T.Time){m.info("\u65F6\u95F4\u70B9\u4EC5\u652F\u6301\u8C03\u6574\u5F00\u59CB\u65F6\u95F4");return}const{end:u,start:a}=s,n=C.withinRange(I(u,t),[I(a,v),l]);this.updateSelectedSliceTimeProperty(n,"end")}},this.updateSelectedSliceTimeProperty=(t,e)=>{if(this.selectedSliceIndex>-1){const{result:i}=this.state;i[this.selectedSliceIndex][e]=t,this.setState({result:b.cloneDeep(i)}),this.updateSidebar()}},this.keyDownEvents=t=>{if(!F.hotkeyFilter(t))return;const e=t.target;switch(e&&(e==null?void 0:e.tag)==="INPUT"&&(e==null?void 0:e.type)==="radio"&&t.preventDefault(),t.key.toLocaleLowerCase()){case"x":this.toggleClipStatus();break;case"e":this.addTime();break;case"escape":this.cancelClipped();break;case"-":this.updateSelectedSliceTimeStartByPer(-v);break;case"=":this.updateSelectedSliceTimeStartByPer(v);break;case"[":this.updateSelectedSliceTimeEndByPer(-v);break;case"]":this.updateSelectedSliceTimeEndByPer(v);break}},this.setVideoError=(t,e,i)=>{if(t){const{clipStatus:s}=this.state;s===o.Clipping&&this.toggleClipStatus(i)}this.setState({videoError:t,loading:!1})},this.clearResult=()=>{this.setState({result:[],selectedID:"",textValue:""}),this.updateSidebar()},this.cancelClipped=()=>{const{result:t,selectedID:e,clipStatus:i}=this.state;if(i!==o.Clipping)return;const s=t.findIndex(l=>l.id===e);s>-1&&(t.splice(s,1),this.setState({result:t,selectedID:"",clipStatus:o.Stop}),this.updateSidebar())},this.toggleClipStatus=t=>{var e,i,s;if(this.disabled)return;const{clipStatus:l,selectedAttribute:u}=this.state,a=l!==o.Clipping;let n=a?o.Clipping:o.Stop,{result:d,selectedID:c,textValue:p}=this.state;const h=b.cloneDeep(d),S=t||((e=this.videoPlayer)==null?void 0:e.currentTime),y=(i=this.videoPlayer)==null?void 0:i.duration;if(y===void 0||S===void 0)return;const w=L(S,2);if(a){const f=A();c=f,h.push({start:w,end:null,attribute:u,textAttribute:this.defaultTextAttribute,duration:y,id:f,type:T.Period}),p=this.defaultTextAttribute}else{const f=h.findIndex(E=>E.id===c),D=h[f];D&&(S-D.start<x?(h.splice(f,1),m.info(`\u622A\u53D6\u7247\u6BB5\u4E0D\u80FD\u77ED\u4E8E${x}s`),n=o.Stop,c="",p=""):(h[f].end=L(S,2),(s=this.videoPlayer)==null||s.pause(),m.success(`\u5DF2\u622A\u53D6\u7247\u6BB5${d.length}`)))}this.setState({clipStatus:n,result:h,selectedID:c,textValue:p}),this.updateSidebar()},this.addTime=()=>{var t,e,i,s;if(this.disabled)return;const{result:l,selectedAttribute:u,selectedID:a}=this.state,n=A(),d=b.cloneDeep(l),c=((t=this.videoPlayer)==null?void 0:t.currentTime)||0;d.push({start:c,end:c,attribute:u,textAttribute:this.defaultTextAttribute,id:n,type:T.Time,duration:(i=(e=this.videoPlayer)==null?void 0:e.duration)!=null?i:0});const p={result:d,selectedID:n,textValue:this.defaultTextAttribute},h=d.find(S=>S.id===a);this.isClipping&&h?(delete p.selectedID,delete p.textValue,m.success(`\u5DF2\u622A\u53D6\u65F6\u95F4\u70B9${d.length-1}`)):(s=this.videoPlayer)==null||s.pause(),this.setState(p),this.updateSidebar()},this.updateCurrentTime=t=>{this.setState({currentTime:t})},this.contextToCancel=t=>{this.state.clipStatus===o.Stop&&(t.preventDefault(),this.setState({selectedID:""}),this.updateSidebar())},this.onTrackResize=(t,e,i)=>{var s,l;const{result:u}=this.state,a=u.find(n=>n.id===t);if(a){const n=a.duration,d=e==="left",c=d?"start":"end",p=d?-n*i:n*i,h=d?[0,Math.max(((s=a.end)!=null?s:0)-x,0)]:[a.start+x,n],S=C.withinRange(p+((l=a==null?void 0:a[c])!=null?l:0),h);a[c]=S,this.throttledUpdateTime(S)}this.setState({result:[...u]}),this.updateSidebar()},this.renderMediaContent=()=>{var t;const{pageForward:e,pageJump:i,pageBackward:s}=this.props,{result:l,videoError:u,valid:a,currentTime:n}=this.state;return g.createElement("div",{className:_.clipContainer},g.createElement(j,{imgIndex:this.props.imgIndex,imgList:this.props.imgList,pageBackward:s,pageForward:e,pageJump:i,valid:a,setVideoRef:d=>{this.videoPlayer=d},showVideoTrack:!u,onTrackResize:this.onTrackResize,drawLayerSlot:this.props.drawLayerSlot,footer:this.props.footer,dataLoaded:this.props.onVideoLoaded,toggleClipStatus:this.toggleClipStatus,addTime:this.addTime,updateCurrentTime:this.updateCurrentTime}),g.createElement(M,{key:(t=this.videoPlayer)==null?void 0:t.currentTime,result:l,currentTime:n,attributeList:this.props.config.attributeList,extraStyle:{top:this.props.drawLayerSlot?40:0}}),this.isClipping&&g.createElement("i",{className:_.clipping,style:{backgroundImage:U}}))},this.onSelectedTimeSlice=t=>{var e;this.isClipping||(this.setState({selectedID:t.id,selectedAttribute:t.attribute,textValue:t.textAttribute,currentTime:t.start}),this.updateSidebar(),(e=this.videoPlayer)==null||e.pause(),this.videoPlayer.currentTime=t.start)},this.removeTimeSlice=t=>{const{result:e}=this.state,i=this.state.selectedID===t.id?"":this.state.selectedID,s=e.findIndex(l=>l.id===t.id);s>-1&&(e.splice(s,1),this.setState({result:[...e],selectedID:i}),this.updateSidebar())},this.setResult=(t=!0,e=this.props)=>{try{const{imgIndex:i,imgList:s}=e;if(!s[i])return;const u=P(s[i].result)[`step_${this.stepInfo().step}`],a=(u==null?void 0:u.result)||[],n=R(s[i].result||"[]");this.setState({result:a,loading:t,selectedID:"",textValue:"",selectedAttribute:"",clipStatus:o.Stop,valid:n},()=>{this.updateSidebar(),n||m.info("\u65E0\u6548\u89C6\u9891\uFF0C\u8BF7\u8DF3\u8FC7")})}catch(i){console.error("\u6570\u636E\u89E3\u6790\u5931\u8D25"),this.setState({result:[],loading:!1,selectedID:"",textValue:"",selectedAttribute:"",valid:!0},()=>{this.updateSidebar()})}},this.setDefaultAttribute=t=>{const{result:e,selectedID:i}=this.state,s=e.find(l=>l.id===i);s&&i&&(s.attribute=t),this.setState({selectedAttribute:t,result:[...e]}),this.updateSidebar()},this.textChange=t=>{const{result:e,selectedID:i}=this.state;if(this.setState({textValue:t}),i){const s=e.find(l=>l.id===i);s&&(s.textAttribute=t,this.setState({result:[...e]}),this.updateSidebar())}},this.state={result:[],selectedAttribute:"",textValue:"",clipStatus:o.Stop,selectedID:"",loading:!1,videoError:!1,remainingTime:0,currentTime:0,configLoading:!1,valid:!0}}get videoUrl(){var r;const{imgIndex:t,imgList:e}=this.props;return((r=e[t])==null?void 0:r.url)||""}get isClipping(){return this.state.clipStatus===o.Clipping}get resultJSON(){const{imgIndex:r,imgList:t}=this.props;return t.length===0||!t[r]?"[]":t[r].result}get disabled(){return!this.state.valid||this.state.videoError}get loading(){return this.state.loading||this.state.configLoading}get defaultTextAttribute(){return k.getTextAttribute(this.state.result,this.props.config.textCheckType)}get defaultAttribute(){return this.state.selectedAttribute}get selectedID(){return this.state.selectedID}get selectedSliceIndex(){return this.state.result.findIndex(r=>r.id===this.state.selectedID)}get exportContext(){return{selectedID:this.state.selectedID,result:this.state.result,clipStatus:this.state.clipStatus,videoPlayer:this.videoPlayer,attributeList:this.props.config.attributeList,onSelectedTimeSlice:this.onSelectedTimeSlice,removeTimeSlice:this.removeTimeSlice,updateSelectedSliceTimeProperty:this.updateSelectedSliceTimeProperty}}get valid(){return this.state.valid}get config(){var r;return P((r=this.props.stepInfo)==null?void 0:r.config)}get selectedText(){var r,t;return(t=(r=this.state.result)==null?void 0:r[this.selectedSliceIndex])==null?void 0:t.textAttribute}componentDidMount(){this.setState({loading:!1}),this.setResult(!1),this.props.onMounted(this),window.addEventListener("keydown",this.keyDownEvents)}componentWillUnmount(){this.props.onUnmounted(),window.removeEventListener("keydown",this.keyDownEvents)}shouldComponentUpdate(r,t){const e=r.imgIndex-this.props.imgIndex,i=r.step-this.props.step;return(e!==0||i!==0)&&(this.setResult(!0,r),i!==0&&this.setState({loading:!1})),!0}singleOn(r,t){this.fns.set(r,[t])}on(r,t){this.singleOn(r,t)}unbindAll(r){this.fns.delete(r)}render(){const{selectedID:r,result:t,clipStatus:e,selectedAttribute:i}=this.state;return g.createElement(B,{value:{videoPlayer:this.videoPlayer,result:t,selectedID:r,attributeList:this.props.config.attributeList,clipStatus:e,selectedAttribute:i,contextToCancel:this.contextToCancel}},this.renderMediaContent())}}export{N as default};
1
+ import{MathUtils as C,CommonToolUtils as F,uuid as A,AttributeUtils as R}from"@labelbee/lb-annotation";import{jsonParser as P}from"../../../utils/index.js";import{precisionAdd as y,precisionMinus as k,isImageValue as V}from"../../../utils/audio.js";import{message as m}from"antd";import b from"lodash";import g from"react";import _ from"./index.module.scss.js";import{VideoClipToolContextProvider as B}from"./VideoClipToolContext.js";import{EClipStatus as d,ETimeSliceType as T,PER_SLICE_CHANGE as v,SLICE_MIN_TIME as x}from"./constant.js";import{VideoPlayer as j}from"../../videoPlayer/index.js";import M from"./components/videoTimeSlicesOverVideo/index.js";import U from"../../../assets/annotation/video/icon_videoCutting.svg.js";import{decimalReserved as L}from"../../videoPlayer/utils.js";class N extends g.Component{constructor(r){super(r);this.fns=new Map,this.throttledUpdateTime=b.throttle(t=>{this.videoPlayer.currentTime=t},100,{trailing:!0}),this.stepInfo=()=>this.props.stepInfo,this.emitEvent=t=>{const e=this.fns.get(t);e&&e.forEach(i=>{i&&i()})},this.setValid=t=>{this.setState({valid:t}),t===!1&&(this.clearResult(),this.updateSidebar())},this.updateSidebar=()=>{this.emitEvent("changeClipSidebar"),this.emitEvent("updateTextAttribute"),this.emitEvent("changeAttributeSidebar")},this.exportData=()=>{var t,e;const i=(e=(t=this.videoRef)==null?void 0:t.duration)!=null?e:0;return[this.state.result.filter(s=>s.end!==null),{valid:this.state.valid,duration:i}]},this.updateSelectedSliceTimeStartByPer=t=>{var e,i;if(this.state.clipStatus===d.Clipping){m.info("\u622A\u53D6\u4E2D\u4E0D\u652F\u6301\u8C03\u6574\u5F00\u59CB\u65F6\u95F4");return}if(this.selectedSliceIndex>-1){const s=(i=(e=this.videoPlayer)==null?void 0:e.duration)!=null?i:0,{end:l,start:u,type:a}=this.state.result[this.selectedSliceIndex],n=C.withinRange(y(u,t),[0,k(a===T.Time?s:l,v)]);this.updateSelectedSliceTimeProperty(n,"start")}},this.updateSelectedSliceTimeEndByPer=t=>{var e,i;if(this.state.clipStatus===d.Clipping){m.info("\u622A\u53D6\u4E2D\u4E0D\u652F\u6301\u8C03\u6574\u7ED3\u675F\u65F6\u95F4");return}if(this.selectedSliceIndex>-1){const s=this.state.result[this.selectedSliceIndex],l=(i=(e=this.videoPlayer)==null?void 0:e.duration)!=null?i:0;if(s.type===T.Time){m.info("\u65F6\u95F4\u70B9\u4EC5\u652F\u6301\u8C03\u6574\u5F00\u59CB\u65F6\u95F4");return}const{end:u,start:a}=s,n=C.withinRange(y(u,t),[y(a,v),l]);this.updateSelectedSliceTimeProperty(n,"end")}},this.updateSelectedSliceTimeProperty=(t,e)=>{if(this.selectedSliceIndex>-1){const{result:i}=this.state;i[this.selectedSliceIndex][e]=t,this.setState({result:b.cloneDeep(i)}),this.updateSidebar()}},this.keyDownEvents=t=>{if(!F.hotkeyFilter(t))return;const e=t.target;switch(e&&(e==null?void 0:e.tag)==="INPUT"&&(e==null?void 0:e.type)==="radio"&&t.preventDefault(),t.key.toLocaleLowerCase()){case"x":this.toggleClipStatus();break;case"e":this.addTime();break;case"escape":this.cancelClipped();break;case"-":this.updateSelectedSliceTimeStartByPer(-v);break;case"=":this.updateSelectedSliceTimeStartByPer(v);break;case"[":this.updateSelectedSliceTimeEndByPer(-v);break;case"]":this.updateSelectedSliceTimeEndByPer(v);break}},this.setVideoError=(t,e,i)=>{if(t){const{clipStatus:s}=this.state;s===d.Clipping&&this.toggleClipStatus(i)}this.setState({videoError:t,loading:!1})},this.clearResult=()=>{this.setState({result:[],selectedID:"",textValue:""}),this.updateSidebar()},this.cancelClipped=()=>{const{result:t,selectedID:e,clipStatus:i}=this.state;if(i!==d.Clipping)return;const s=t.findIndex(l=>l.id===e);s>-1&&(t.splice(s,1),this.setState({result:t,selectedID:"",clipStatus:d.Stop}),this.updateSidebar())},this.toggleClipStatus=t=>{var e,i;if(typeof((e=this.props)==null?void 0:e.annotationBefore)=="function"){(i=this.props)==null||i.annotationBefore(()=>this.setClipResult(t));return}this.setClipResult(t)},this.setClipResult=t=>{var e,i,s;if(this.disabled)return;const{clipStatus:l,selectedAttribute:u}=this.state,a=l!==d.Clipping;let n=a?d.Clipping:d.Stop,{result:o,selectedID:c,textValue:h}=this.state;const p=b.cloneDeep(o),S=t||((e=this.videoPlayer)==null?void 0:e.currentTime),I=(i=this.videoPlayer)==null?void 0:i.duration;if(I===void 0||S===void 0)return;const w=L(S,2);if(a){const f=A();c=f,p.push({start:w,end:null,attribute:u,textAttribute:this.defaultTextAttribute,duration:I,id:f,type:T.Period}),h=this.defaultTextAttribute}else{const f=p.findIndex(E=>E.id===c),D=p[f];D&&(S-D.start<x?(p.splice(f,1),m.info(`\u622A\u53D6\u7247\u6BB5\u4E0D\u80FD\u77ED\u4E8E${x}s`),n=d.Stop,c="",h=""):(p[f].end=L(S,2),(s=this.videoPlayer)==null||s.pause(),m.success(`\u5DF2\u622A\u53D6\u7247\u6BB5${o.length}`)))}this.setState({clipStatus:n,result:p,selectedID:c,textValue:h}),this.updateSidebar()},this.addTime=()=>{var t,e,i,s;if(this.disabled)return;const{result:l,selectedAttribute:u,selectedID:a}=this.state,n=A(),o=b.cloneDeep(l),c=((t=this.videoPlayer)==null?void 0:t.currentTime)||0;o.push({start:c,end:c,attribute:u,textAttribute:this.defaultTextAttribute,id:n,type:T.Time,duration:(i=(e=this.videoPlayer)==null?void 0:e.duration)!=null?i:0});const h={result:o,selectedID:n,textValue:this.defaultTextAttribute},p=o.find(S=>S.id===a);this.isClipping&&p?(delete h.selectedID,delete h.textValue,m.success(`\u5DF2\u622A\u53D6\u65F6\u95F4\u70B9${o.length-1}`)):(s=this.videoPlayer)==null||s.pause(),this.setState(h),this.updateSidebar()},this.updateCurrentTime=t=>{this.setState({currentTime:t})},this.contextToCancel=t=>{this.state.clipStatus===d.Stop&&(t.preventDefault(),this.setState({selectedID:""}),this.updateSidebar())},this.onTrackResize=(t,e,i)=>{var s,l;const{result:u}=this.state,a=u.find(n=>n.id===t);if(a){const n=a.duration,o=e==="left",c=o?"start":"end",h=o?-n*i:n*i,p=o?[0,Math.max(((s=a.end)!=null?s:0)-x,0)]:[a.start+x,n],S=C.withinRange(h+((l=a==null?void 0:a[c])!=null?l:0),p);a[c]=S,this.throttledUpdateTime(S)}this.setState({result:[...u]}),this.updateSidebar()},this.renderMediaContent=()=>{var t;const{pageForward:e,pageJump:i,pageBackward:s}=this.props,{result:l,videoError:u,valid:a,currentTime:n}=this.state;return g.createElement("div",{className:_.clipContainer},g.createElement(j,{imgIndex:this.props.imgIndex,imgList:this.props.imgList,pageBackward:s,pageForward:e,pageJump:i,valid:a,setVideoRef:o=>{this.videoPlayer=o},showVideoTrack:!u,onTrackResize:this.onTrackResize,drawLayerSlot:this.props.drawLayerSlot,footer:this.props.footer,dataLoaded:this.props.onVideoLoaded,toggleClipStatus:this.toggleClipStatus,addTime:this.addTime,updateCurrentTime:this.updateCurrentTime}),g.createElement(M,{key:(t=this.videoPlayer)==null?void 0:t.currentTime,result:l,currentTime:n,attributeList:this.props.config.attributeList,extraStyle:{top:this.props.drawLayerSlot?40:0}}),this.isClipping&&g.createElement("i",{className:_.clipping,style:{backgroundImage:U}}))},this.onSelectedTimeSlice=t=>{var e;this.isClipping||(this.setState({selectedID:t.id,selectedAttribute:t.attribute,textValue:t.textAttribute,currentTime:t.start}),this.updateSidebar(),(e=this.videoPlayer)==null||e.pause(),this.videoPlayer.currentTime=t.start)},this.removeTimeSlice=t=>{const{result:e}=this.state,i=this.state.selectedID===t.id?"":this.state.selectedID,s=e.findIndex(l=>l.id===t.id);s>-1&&(e.splice(s,1),this.setState({result:[...e],selectedID:i}),this.updateSidebar())},this.setResult=(t=!0,e=this.props)=>{try{const{imgIndex:i,imgList:s}=e;if(!s[i])return;const u=P(s[i].result)[`step_${this.stepInfo().step}`],a=(u==null?void 0:u.result)||[],n=V(s[i].result||"[]");this.setState({result:a,loading:t,selectedID:"",textValue:"",selectedAttribute:"",clipStatus:d.Stop,valid:n},()=>{this.updateSidebar(),n||m.info("\u65E0\u6548\u89C6\u9891\uFF0C\u8BF7\u8DF3\u8FC7")})}catch(i){console.error("\u6570\u636E\u89E3\u6790\u5931\u8D25"),this.setState({result:[],loading:!1,selectedID:"",textValue:"",selectedAttribute:"",valid:!0},()=>{this.updateSidebar()})}},this.setDefaultAttribute=t=>{const{result:e,selectedID:i}=this.state,s=e.find(l=>l.id===i);s&&i&&(s.attribute=t),this.setState({selectedAttribute:t,result:[...e]}),this.updateSidebar()},this.textChange=t=>{const{result:e,selectedID:i}=this.state;if(this.setState({textValue:t}),i){const s=e.find(l=>l.id===i);s&&(s.textAttribute=t,this.setState({result:[...e]}),this.updateSidebar())}},this.state={result:[],selectedAttribute:"",textValue:"",clipStatus:d.Stop,selectedID:"",loading:!1,videoError:!1,remainingTime:0,currentTime:0,configLoading:!1,valid:!0}}get videoUrl(){var r;const{imgIndex:t,imgList:e}=this.props;return((r=e[t])==null?void 0:r.url)||""}get isClipping(){return this.state.clipStatus===d.Clipping}get resultJSON(){const{imgIndex:r,imgList:t}=this.props;return t.length===0||!t[r]?"[]":t[r].result}get disabled(){return!this.state.valid||this.state.videoError}get loading(){return this.state.loading||this.state.configLoading}get defaultTextAttribute(){return R.getTextAttribute(this.state.result,this.props.config.textCheckType)}get defaultAttribute(){return this.state.selectedAttribute}get selectedID(){return this.state.selectedID}get selectedSliceIndex(){return this.state.result.findIndex(r=>r.id===this.state.selectedID)}get exportContext(){return{selectedID:this.state.selectedID,result:this.state.result,clipStatus:this.state.clipStatus,videoPlayer:this.videoPlayer,attributeList:this.props.config.attributeList,onSelectedTimeSlice:this.onSelectedTimeSlice,removeTimeSlice:this.removeTimeSlice,updateSelectedSliceTimeProperty:this.updateSelectedSliceTimeProperty}}get valid(){return this.state.valid}get config(){var r;return P((r=this.props.stepInfo)==null?void 0:r.config)}get selectedText(){var r,t;return(t=(r=this.state.result)==null?void 0:r[this.selectedSliceIndex])==null?void 0:t.textAttribute}componentDidMount(){this.setState({loading:!1}),this.setResult(!1),this.props.onMounted(this),window.addEventListener("keydown",this.keyDownEvents)}componentWillUnmount(){this.props.onUnmounted(),window.removeEventListener("keydown",this.keyDownEvents)}shouldComponentUpdate(r,t){const e=r.imgIndex-this.props.imgIndex,i=r.step-this.props.step;return(e!==0||i!==0)&&(this.setResult(!0,r),i!==0&&this.setState({loading:!1})),!0}singleOn(r,t){this.fns.set(r,[t])}on(r,t){this.singleOn(r,t)}unbindAll(r){this.fns.delete(r)}render(){const{selectedID:r,result:t,clipStatus:e,selectedAttribute:i}=this.state;return g.createElement(B,{value:{videoPlayer:this.videoPlayer,result:t,selectedID:r,attributeList:this.props.config.attributeList,clipStatus:e,selectedAttribute:i,contextToCancel:this.contextToCancel}},this.renderMediaContent())}}export{N as default};
@@ -1 +1 @@
1
- import h from"react";import{TagUtils as p,CommonToolUtils as m,uuid as v}from"@labelbee/lb-annotation";import{jsonParser as c}from"../../../utils/index.js";import{VideoPlayer as f}from"../../videoPlayer/index.js";import{VideoTagLayer as y}from"../../videoPlayer/VideoTagLayer.js";import g from"lodash";import{getKeyCodeNumber as L}from"../../videoPlayer/utils.js";class R extends h.Component{constructor(s){super(s);this.fns={},this.labelSelectedList=[],this.clearResult=(t=!0,e)=>{const l=e?this.state.tagResult.map(i=>((i==null?void 0:i.result[e])&&delete i.result[e],i)):[];this.setState({tagResult:l},()=>this.emitEvent("render"))},this.exportData=()=>{var t,e;const l=(e=(t=this.videoPlayer)==null?void 0:t.duration)!=null?e:0;return[this.state.tagResult,{valid:this.state.valid,duration:l}]},this.emitEvent=t=>{this.fns[t]&&this.fns[t]()},this.combineResult=(t,e={})=>{var l,i;const{isMulti:n}=t,{key:o,value:r}=t.value;if(n){let a=(i=(l=e[o])==null?void 0:l.split(";"))!=null?i:[];a.includes(r)?a=a.filter(u=>u!==r):a.push(r);const d=new Set(a);return e[o]=Array.from(d).join(";"),g.pickBy(e,u=>u)}return e[o]=e[o]===r?void 0:r,g.pickBy(e,a=>a)},this.setResult=t=>{this.setState({tagResult:t}),this.fns.render&&this.fns.render()},this.setLabel=(t,e)=>{this.setLabelBySelectedList(t,e)},this.keydown=t=>{var e;const l=L(t.keyCode);if(l){const i=l-1;if(((e=this.config.inputList)==null?void 0:e.length)===1){this.labelSelectedList=[0,i],this.setLabel(0,i),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500);return}this.labelSelectedList.length===1?(this.labelSelectedList=[this.labelSelectedList[0],i],this.setLabel(this.labelSelectedList[0],i),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500)):(this.labelSelectedList=[i],this.emitEvent("expend"))}},this.setValid=t=>{this.setState({valid:t}),t===!1&&this.setState({tagResult:[]}),this.emitEvent("render")},this.setResultFromImgList=t=>{const{imgList:e,imgIndex:l,stepInfo:i}=t;if(!e[l])return;const n=c(e[l].result),o=n[`step_${i.step}`],r=this.getInitResultList();this.setState({tagResult:o?o==null?void 0:o.result:r,valid:(n==null?void 0:n.valid)===void 0?!0:n.valid},()=>this.emitEvent("render"))},this.getInitResultList=()=>{var t;return p.getDefaultTagResult((t=this.config.inputList)!=null?t:[],[])},this.state={tagResult:[],labelSelectedList:[],valid:!0}}get config(){var s;return c((s=this.props.stepInfo)==null?void 0:s.config)}get history(){return{initRecord:()=>{},pushHistory:()=>{}}}get currentTagResult(){var s;return(s=this.state.tagResult[0])!=null?s:{}}get valid(){return this.state.valid}singleOn(s,t){this.fns[s]=t}on(s,t){this.singleOn(s,t)}unbindAll(s){delete this.fns[s]}getTagResultByCode(s,t){var e,l,i;try{const n=(l=(e=this.config)==null?void 0:e.inputList)!=null?l:[],o=(n==null?void 0:n.length)>1,r=t!==void 0?s:0,a=t!==void 0?t:s,d=o?n[r]:n[0],u=((i=d.subSelected)!=null?i:[])[a];if(d&&u)return{value:{key:d.value,value:u.value},isMulti:d.isMulti}}catch(n){return}}setLabelBySelectedList(s,t){var e,l,i,n;const o=this.getTagResultByCode(s,t);if(o){const r=this.combineResult(o,(l=(e=this.state.tagResult[0])==null?void 0:e.result)!=null?l:{}),a=[{sourceID:m.getSourceID(),id:(n=(i=this.currentTagResult)==null?void 0:i.id)!=null?n:v(8,62),result:r}];this.setState({tagResult:a},()=>this.emitEvent("render"))}}componentDidMount(){document.addEventListener("keydown",this.keydown),this.props.onMounted(this),this.setResultFromImgList(this.props)}componentWillUnmount(){document.addEventListener("keydown",this.keydown),this.props.onUnmounted()}shouldComponentUpdate(s){return s.imgIndex!==this.props.imgIndex&&this.setResultFromImgList(s),!0}render(){var s;const{imgIndex:t,imgList:e,pageForward:l,pageJump:i,pageBackward:n}=this.props,{tagResult:o,valid:r}=this.state;return h.createElement("div",{style:{height:"100%",width:"100%",position:"relative",display:"flex",flexDirection:"column"}},h.createElement(f,{imgIndex:t,imgList:e,pageBackward:n,pageForward:l,pageJump:i,valid:r,setVideoRef:a=>{this.videoPlayer=a},dataLoaded:this.props.onVideoLoaded,drawLayerSlot:this.props.drawLayerSlot,footer:this.props.footer}),h.createElement(y,{result:o,inputList:(s=this.config)==null?void 0:s.inputList,hasPromptLayer:!!this.props.drawLayerSlot}))}}export{R as TagToolInstanceAdaptor};
1
+ import h from"react";import{TagUtils as m,CommonToolUtils as f,uuid as v}from"@labelbee/lb-annotation";import{jsonParser as g}from"../../../utils/index.js";import{VideoPlayer as y}from"../../videoPlayer/index.js";import{VideoTagLayer as L}from"../../videoPlayer/VideoTagLayer.js";import p,{cloneDeep as R}from"lodash";import{getKeyCodeNumber as b}from"../../videoPlayer/utils.js";class S extends h.Component{constructor(e){super(e);this.fns={},this.labelSelectedList=[],this.clearResult=(t=!0,s)=>{const n=s?this.state.tagResult.map(i=>((i==null?void 0:i.result[s])&&delete i.result[s],i)):[];this.setState({tagResult:n},()=>this.emitEvent("render"))},this.exportData=()=>{var t,s;const n=(s=(t=this.videoPlayer)==null?void 0:t.duration)!=null?s:0;return[this.state.tagResult,{valid:this.state.valid,duration:n}]},this.emitEvent=t=>{this.fns[t]&&this.fns[t]()},this.combineResult=(t,s={})=>{var n,i;const l=R(s),{isMulti:a}=t,{key:r,value:d}=t.value;if(a){let o=(i=(n=l[r])==null?void 0:n.split(";"))!=null?i:[];o.includes(d)?o=o.filter(c=>c!==d):o.push(d);const u=new Set(o);return l[r]=Array.from(u).join(";"),p.pickBy(l,c=>c)}return l[r]=l[r]===d?void 0:d,p.pickBy(l,o=>o)},this.setResult=t=>{this.setState({tagResult:t}),this.fns.render&&this.fns.render()},this.setLabel=(t,s)=>{this.setLabelBySelectedList(t,s)},this.keydown=t=>{var s;const n=b(t.keyCode);if(n){const i=n-1;if(((s=this.config.inputList)==null?void 0:s.length)===1){this.labelSelectedList=[0,i],this.setLabel(0,i),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500);return}this.labelSelectedList.length===1?(this.labelSelectedList=[this.labelSelectedList[0],i],this.setLabel(this.labelSelectedList[0],i),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500)):(this.labelSelectedList=[i],this.emitEvent("expend"))}},this.setValid=t=>{this.setState({valid:t}),t===!1&&this.setState({tagResult:[]}),this.emitEvent("render")},this.setResultFromImgList=t=>{const{imgList:s,imgIndex:n,stepInfo:i}=t;if(!s[n])return;const l=g(s[n].result),a=l[`step_${i.step}`],r=this.getInitResultList();this.setState({tagResult:a?a==null?void 0:a.result:r,valid:(l==null?void 0:l.valid)===void 0?!0:l.valid},()=>this.emitEvent("render"))},this.getInitResultList=()=>{var t;return m.getDefaultTagResult((t=this.config.inputList)!=null?t:[],[])},this.state={tagResult:[],labelSelectedList:[],valid:!0}}get config(){var e;return g((e=this.props.stepInfo)==null?void 0:e.config)}get history(){return{initRecord:()=>{},pushHistory:()=>{}}}get currentTagResult(){var e;return(e=this.state.tagResult[0])!=null?e:{}}get valid(){return this.state.valid}singleOn(e,t){this.fns[e]=t}on(e,t){this.singleOn(e,t)}unbindAll(e){delete this.fns[e]}getTagResultByCode(e,t){var s,n,i;try{const l=(n=(s=this.config)==null?void 0:s.inputList)!=null?n:[],a=(l==null?void 0:l.length)>1,r=t!==void 0?e:0,d=t!==void 0?t:e,o=a?l[r]:l[0],u=((i=o.subSelected)!=null?i:[])[d];if(o&&u)return{value:{key:o.value,value:u.value},isMulti:o.isMulti}}catch(l){return}}setLabelBySelectedList(e,t){var s,n,i,l,a,r;const d=this.getTagResultByCode(e,t);if(d){const o=this.combineResult(d,(n=(s=this.state.tagResult[0])==null?void 0:s.result)!=null?n:{}),u=[{sourceID:f.getSourceID(),id:(l=(i=this.currentTagResult)==null?void 0:i.id)!=null?l:v(8,62),result:o}];if(typeof((a=this.props)==null?void 0:a.annotationBefore)=="function"){(r=this.props)==null||r.annotationBefore(()=>this.setState({tagResult:u},()=>this.emitEvent("render")));return}this.setState({tagResult:u},()=>this.emitEvent("render"))}}componentDidMount(){document.addEventListener("keydown",this.keydown),this.props.onMounted(this),this.setResultFromImgList(this.props)}componentWillUnmount(){document.addEventListener("keydown",this.keydown),this.props.onUnmounted()}shouldComponentUpdate(e){return e.imgIndex!==this.props.imgIndex&&this.setResultFromImgList(e),!0}render(){var e;const{imgIndex:t,imgList:s,pageForward:n,pageJump:i,pageBackward:l}=this.props,{tagResult:a,valid:r}=this.state;return h.createElement("div",{style:{height:"100%",width:"100%",position:"relative",display:"flex",flexDirection:"column"}},h.createElement(y,{imgIndex:t,imgList:s,pageBackward:l,pageForward:n,pageJump:i,valid:r,setVideoRef:d=>{this.videoPlayer=d},dataLoaded:this.props.onVideoLoaded,drawLayerSlot:this.props.drawLayerSlot,footer:this.props.footer}),h.createElement(L,{result:a,inputList:(e=this.config)==null?void 0:e.inputList,hasPromptLayer:!!this.props.drawLayerSlot}))}}export{S as TagToolInstanceAdaptor};
package/es/index.css CHANGED
@@ -49,13 +49,19 @@
49
49
  right: -5px;
50
50
  top: -5px;
51
51
  }
52
+ .index-module_rectRotateSensitivitySlider__tGjUn {
53
+ padding: 12px 20px;
54
+ }
55
+ .index-module_rectRotateSensitivitySlider__tGjUn .index-module_title__aAJW6 {
56
+ margin-bottom: 16px;
57
+ }
52
58
  .index-module_container__RwV5P {
53
59
  padding: 12px 20px;
54
60
  }
55
61
  .index-module_container__RwV5P .index-module_content__vHpS9 {
56
62
  display: flex;
57
63
  justify-content: space-between;
58
- margin-top: 4px;
64
+ margin-top: 16px;
59
65
  }
60
66
  .index-module_latexEditor__0fK8G {
61
67
  line-height: 32px;
@@ -132,6 +138,12 @@
132
138
  .index-module_outputDisplay__5dS48 .index-module_content__Iml6l .markdown-body {
133
139
  font-size: 14px;
134
140
  }
141
+
142
+ .index-module_tip__NFru6 {
143
+ margin-bottom: 8px;
144
+ color: rgba(0, 0, 0, 0.45);
145
+ font-size: 14px;
146
+ }
135
147
  .index-module_tagList__cvWor {
136
148
  padding: 0px 16px 16px 16px;
137
149
  }
@@ -720,6 +732,16 @@
720
732
  font-family: SourceHanSansCN-Medium;
721
733
  font-size: 14px;
722
734
  }
735
+ .index-module_label__xE6hM .index-module_labelText__Zg1c4 {
736
+ display: flex;
737
+ overflow: hidden;
738
+ width: 60%;
739
+ align-items: center;
740
+ }
741
+ .index-module_label__xE6hM .index-module_labelText__Zg1c4 .index-module_titleText__BRM44 {
742
+ max-width: calc(100% - 20px);
743
+ overflow: hidden;
744
+ }
723
745
  .index-module_label__xE6hM .index-module_required__iElYl::before {
724
746
  display: inline-block;
725
747
  margin-right: 4px;
@@ -732,6 +754,7 @@
732
754
  .index-module_label__xE6hM .index-module_extra__PW5Qk {
733
755
  float: right;
734
756
  margin-right: 5px;
757
+ width: 40%;
735
758
  }
736
759
 
737
760
  .index-module_textareaContainer__dTIv4 {
@@ -862,6 +885,7 @@
862
885
  flex-wrap: wrap;
863
886
  align-items: center;
864
887
  justify-content: center;
888
+ overflow: hidden;
865
889
  }
866
890
  .index-module_placeholderHotkey__0SKPo .text {
867
891
  color: #333;
@@ -878,7 +902,10 @@
878
902
 
879
903
  .index-module_attribute__g8Vbl {
880
904
  height: 22px;
881
- padding: 2px 8px;
905
+ padding: 0px 8px;
906
+ width: max-content;
907
+ max-width: 100%;
908
+ margin-left: auto;
882
909
  }
883
910
 
884
911
  .index-module_clearIcon__ZBZqI {
@@ -1141,7 +1168,8 @@
1141
1168
  }
1142
1169
  .index-module_clipSidebar__z2E8x .index-module_attributeList__2wnCE {
1143
1170
  flex: 1;
1144
- overflow: auto;
1171
+ overflow-x: hidden;
1172
+ overflow-y: auto;
1145
1173
  }
1146
1174
  .index-module_clipSidebar__z2E8x .index-module_attributeList__2wnCE .sensebee-radio-group,
1147
1175
  .index-module_clipSidebar__z2E8x .index-module_attributeList__2wnCE .sensebee-radio-group-no-limit-height .ant-radio-group {
@@ -1489,6 +1517,7 @@
1489
1517
  .bee-sidebar #style-width .ant-slider .ant-slider-track,
1490
1518
  .bee-sidebar #style-color .ant-slider .ant-slider-track,
1491
1519
  .bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
1520
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
1492
1521
  .bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
1493
1522
  background: #f5f5f5;
1494
1523
  }
@@ -1498,6 +1527,7 @@
1498
1527
  .bee-sidebar #style-width .ant-slider .ant-slider-dot,
1499
1528
  .bee-sidebar #style-color .ant-slider .ant-slider-dot,
1500
1529
  .bee-sidebar #style-fillOpacity .ant-slider .ant-slider-dot,
1530
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-dot,
1501
1531
  .bee-sidebar #style-borderOpacity .ant-slider .ant-slider-dot {
1502
1532
  width: 0;
1503
1533
  height: 0;
@@ -1509,6 +1539,7 @@
1509
1539
  .bee-sidebar #style-width .ant-slider .ant-slider-handle,
1510
1540
  .bee-sidebar #style-color .ant-slider .ant-slider-handle,
1511
1541
  .bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle,
1542
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle,
1512
1543
  .bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle {
1513
1544
  background-image: url("../dist/assets/icons/cc550fff.svg");
1514
1545
  background-repeat: no-repeat;
@@ -1526,6 +1557,7 @@
1526
1557
  .bee-sidebar #style-width .ant-slider .ant-slider-handle:focus,
1527
1558
  .bee-sidebar #style-color .ant-slider .ant-slider-handle:focus,
1528
1559
  .bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle:focus,
1560
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle:focus,
1529
1561
  .bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle:focus {
1530
1562
  box-shadow: none;
1531
1563
  }
@@ -1535,6 +1567,7 @@
1535
1567
  .bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
1536
1568
  .bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
1537
1569
  .bee-sidebar #style-fillOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
1570
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
1538
1571
  .bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow {
1539
1572
  color: inherit;
1540
1573
  font-style: normal;
@@ -1558,6 +1591,7 @@
1558
1591
  .bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
1559
1592
  .bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
1560
1593
  .bee-sidebar #style-fillOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
1594
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
1561
1595
  .bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header {
1562
1596
  position: relative;
1563
1597
  color: rgba(0, 0, 0, 0.85);
@@ -1584,6 +1618,9 @@
1584
1618
  .bee-sidebar #style-fillOpacity .ant-slider-rail,
1585
1619
  .bee-sidebar #style-fillOpacity .ant-slider-track,
1586
1620
  .bee-sidebar #style-fillOpacity .ant-slider-step,
1621
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-rail,
1622
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-track,
1623
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-step,
1587
1624
  .bee-sidebar #style-borderOpacity .ant-slider-rail,
1588
1625
  .bee-sidebar #style-borderOpacity .ant-slider-track,
1589
1626
  .bee-sidebar #style-borderOpacity .ant-slider-step {
@@ -1596,38 +1633,46 @@
1596
1633
  .bee-sidebar #style-width .ant-slider .ant-slider-track,
1597
1634
  .bee-sidebar #style-color .ant-slider .ant-slider-track,
1598
1635
  .bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
1636
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
1599
1637
  .bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
1600
1638
  background: none;
1601
1639
  }
1602
1640
  .bee-sidebar #style-radius .ant-slider-step .ant-slider-dot,
1603
- .bee-sidebar #style-width .ant-slider-step .ant-slider-dot {
1641
+ .bee-sidebar #style-width .ant-slider-step .ant-slider-dot,
1642
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot {
1604
1643
  height: 12px;
1605
1644
  background: #666666;
1606
1645
  border-radius: 0;
1607
1646
  margin-left: -2px;
1608
1647
  }
1609
1648
  .bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(1),
1610
- .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(1) {
1649
+ .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(1),
1650
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(1) {
1611
1651
  width: 1px;
1612
1652
  }
1613
1653
  .bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(2),
1614
- .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(2) {
1654
+ .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(2),
1655
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(2) {
1615
1656
  width: 2px;
1616
1657
  }
1617
1658
  .bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(3),
1618
- .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(3) {
1659
+ .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(3),
1660
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(3) {
1619
1661
  width: 3px;
1620
1662
  }
1621
1663
  .bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(4),
1622
- .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(4) {
1664
+ .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(4),
1665
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(4) {
1623
1666
  width: 4px;
1624
1667
  }
1625
1668
  .bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(5),
1626
- .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(5) {
1669
+ .bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(5),
1670
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(5) {
1627
1671
  width: 5px;
1628
1672
  }
1629
1673
  .bee-sidebar #style-radius .ant-slider:hover .ant-slider-rail,
1630
- .bee-sidebar #style-width .ant-slider:hover .ant-slider-rail {
1674
+ .bee-sidebar #style-width .ant-slider:hover .ant-slider-rail,
1675
+ .bee-sidebar #style-rectRotateSensitivity .ant-slider:hover .ant-slider-rail {
1631
1676
  background: #f5f5f5;
1632
1677
  }
1633
1678
  .bee-sidebar #style-color .ant-slider-rail {
@@ -2494,14 +2539,14 @@
2494
2539
  margin-right: 16px;
2495
2540
  background-image: url("../dist/assets/icons/7eadb9c4.svg");
2496
2541
  }
2497
- .bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__rotate-180 {
2542
+ .bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__rotate-90 {
2498
2543
  display: inline-block;
2499
2544
  height: 24px;
2500
2545
  width: 24px;
2501
2546
  background-repeat: no-repeat;
2502
2547
  cursor: pointer;
2503
2548
  flex: none;
2504
- background-image: url("../dist/assets/icons/9d70807.svg");
2549
+ background-image: url("../dist/assets/icons/ad33251.svg");
2505
2550
  }
2506
2551
  .bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__next {
2507
2552
  font-size: 24px;
@@ -3080,15 +3125,12 @@
3080
3125
  display: block;
3081
3126
  }
3082
3127
  .bee-sidebar__content__NLPList__item__text {
3083
- flex: 1 1;
3084
- padding: 16px;
3085
3128
  font-weight: 400;
3086
3129
  font-size: 12px;
3087
3130
  line-height: 20px;
3088
3131
  color: #666666;
3089
- overflow: hidden;
3090
- text-overflow: ellipsis;
3091
- white-space: nowrap;
3132
+ padding: 16px;
3133
+ width: 100%;
3092
3134
  }
3093
3135
  .bee-sidebar__content__NLPList__item__active {
3094
3136
  background-color: #eeefff;
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";export{default as TextContent}from"./components/NLPToolView/textContent/index.js";import{i18n as l}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import r,{useState as c,useImperativeHandle as m}from"react";import{I18nextProvider as f}from"react-i18next";import{Provider as u}from"react-redux";import x from"./App.js";import w from"./configureStore.js";import{PageBackward as P,PageForward as v,PageJump as T}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as g}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{default as MeasureCanvas}from"./components/measureCanvas/index.js";export{default as AnnotatedBox}from"./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js";export{FindTrackIDIndexInCheckMode as FindTrackIDIndex}from"./views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex/index.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var _=Object.defineProperty,I=Object.defineProperties,b=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,p=(o,e,t)=>e in o?_(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,A=(o,e)=>{for(var t in e||(e={}))V.call(e,t)&&p(o,t,e[t]);if(s)for(var t of s(e))C.call(e,t)&&p(o,t,e[t]);return o},O=(o,e)=>I(o,b(e));const n=w(),E=(o,e)=>{const[t,d]=c();return m(e,()=>({toolInstance:t,annotationEngine:n.getState().annotation.annotationEngine,pageBackwardActions:()=>n.dispatch(P()),pageForwardActions:()=>n.dispatch(v()),pageJump:a=>{const i=~~a-1;n.dispatch(T(i))},hello:()=>alert("hello labelBee!!!")}),[t]),r.createElement(u,{store:n,context:j},r.createElement(f,{i18n:l},r.createElement(g,null,r.createElement(x,O(A({},o),{setToolInstance:a=>{var i;d(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}})))))};var S=r.forwardRef(E);export{S as default,n 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";export{default as TextContent}from"./components/NLPToolView/textContent/index.js";import{i18n as l}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import r,{useState as c,useImperativeHandle as m}from"react";import{I18nextProvider as u}from"react-i18next";import{Provider as f}from"react-redux";import x from"./App.js";import w from"./configureStore.js";import{PageBackward as P,PageForward as v,PageJump as j}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as T}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as b}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{default as BatchSwitchConnectIn2DView}from"./views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js";export{default as MeasureCanvas}from"./components/measureCanvas/index.js";export{default as AnnotatedBox}from"./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js";export{default as RectRotateSensitivitySlider}from"./views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js";export{FindTrackIDIndexInCheckMode as FindTrackIDIndex}from"./views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex/index.js";export{WrapAudioPlayer as AudioPlayer}from"./components/audioPlayer/index.js";export{generatePointCloudBoxRects}from"./utils/index.js";export{default as SubAttributeList}from"./components/subAttributeList/index.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var g=Object.defineProperty,V=Object.defineProperties,C=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,d=(o,e,t)=>e in o?g(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,_=(o,e)=>{for(var t in e||(e={}))I.call(e,t)&&d(o,t,e[t]);if(s)for(var t of s(e))S.call(e,t)&&d(o,t,e[t]);return o},A=(o,e)=>V(o,C(e));const n=w(),h=(o,e)=>{const[t,p]=c();return m(e,()=>({toolInstance:t,annotationEngine:n.getState().annotation.annotationEngine,pageBackwardActions:()=>n.dispatch(P()),pageForwardActions:()=>n.dispatch(v()),pageJump:a=>{const i=~~a-1;n.dispatch(j(i))},hello:()=>alert("hello labelBee!!!")}),[t]),r.createElement(f,{store:n,context:b},r.createElement(u,{i18n:l},r.createElement(T,null,r.createElement(x,A(_({},o),{setToolInstance:a=>{var i;p(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}})))))};var y=r.forwardRef(h);export{y as default,n as store};
@@ -1 +1 @@
1
- const T={INIT_ALL_STATE:"@@INIT_ALL_STATE",UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",UPDATE_BEFORE_ROTATE:"@@UPDATE_BEFORE_ROTATE",SET_LOADING:"@@SET_LOADING",SET_LOADPCDFILE_LOADING:"@@SET_LOADPCDFILE_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_CHECK_MODE:"@@SET_CHECK_MODE",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST",UPDATE_ANNOTATION_VALID:"@@UPDATE_ANNOTATION_VALID",BATCH_UPDATE_TRACK_ID:"@@BATCH_UPDATE_TRACK_ID",BATCH_UPDATE_RESULT_BY_TRACK_ID:"@@BATCH_UPDATE_RESULT_BY_TRACK_ID",BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:"@@BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT",SET_PREDICT_RESULT_VISIBLE:"@@SET_PREDICT_RESULT_VISIBLE",SET_PREDICT_RESULT:"@@SET_PREDICT_RESULT",SET_HIGHLIGHT_ATTRIBUTE:"@@SET_HIGHLIGHT_ATTRIBUTE",UPDATE_PRE_DATA_PROCESS:"@@UPDATE_PRE_DATA_PROCESS"},_={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},E={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};export{T as ANNOTATION_ACTIONS,_ as IMAGE_ATTRIBUTE_ACTIONS,E as TOOL_STYLE_ACTIONS};
1
+ const T={INIT_ALL_STATE:"@@INIT_ALL_STATE",UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",UPDATE_BEFORE_ROTATE:"@@UPDATE_BEFORE_ROTATE",SET_LOADING:"@@SET_LOADING",SET_LOADPCDFILE_LOADING:"@@SET_LOADPCDFILE_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_CHECK_MODE:"@@SET_CHECK_MODE",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST",UPDATE_ANNOTATION_VALID:"@@UPDATE_ANNOTATION_VALID",BATCH_UPDATE_TRACK_ID:"@@BATCH_UPDATE_TRACK_ID",BATCH_UPDATE_RESULT_BY_TRACK_ID:"@@BATCH_UPDATE_RESULT_BY_TRACK_ID",BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:"@@BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT",SET_PREDICT_RESULT_VISIBLE:"@@SET_PREDICT_RESULT_VISIBLE",SET_PREDICT_RESULT:"@@SET_PREDICT_RESULT",SET_HIGHLIGHT_ATTRIBUTE:"@@SET_HIGHLIGHT_ATTRIBUTE",UPDATE_PRE_DATA_PROCESS:"@@UPDATE_PRE_DATA_PROCESS",UPDATE_IMG_INDEX_BY_EXTERNAL:"@@UPDATE_IMG_INDEX_BY_EXTERNAL"},_={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},E={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};export{T as ANNOTATION_ACTIONS,_ as IMAGE_ATTRIBUTE_ACTIONS,E as TOOL_STYLE_ACTIONS};
@@ -1 +1 @@
1
- import{create as o}from"zustand";const a=o(e=>({ptCtx:{},pointCloudBoxList:[],setPointCloudBoxList:t=>e(s=>({pointCloudBoxList:t})),highlightIDs:[],setHighlightIDs:t=>e(s=>({highlightIDs:t})),selectedIDs:[],setSelectedIDs:t=>e(s=>({selectedIDs:t})),setPtCtx:t=>e(s=>({ptCtx:t}))}));export{a as default};
1
+ import{create as i}from"zustand";const o=i(e=>({ptCtx:{},pointCloudBoxList:[],setPointCloudBoxList:t=>e(s=>({pointCloudBoxList:t})),highlightIDs:[],setHighlightIDs:t=>e(s=>({highlightIDs:t})),selectedIDs:[],setSelectedIDs:t=>e(s=>({selectedIDs:t})),rectRotateSensitivity:2,setRectRotateSensitivity:t=>e(s=>({rectRotateSensitivity:t})),setPtCtx:t=>e(s=>({ptCtx:t}))}));export{o as default};
@@ -1 +1 @@
1
- import{ANNOTATION_ACTIONS as a}from"../Actions.js";import{LoadFileAndFileData as O,getStepConfig as M}from"./reducer.js";import{ESubmitType as _}from"../../constant/index.js";import{EPageTurningOperation as y}from"../../data/enums/AnnotationSize.js";import j from"../../utils/PageOperator.js";import{jsonParser as K}from"../../utils/index.js";import{getBoxesByTrackID as V}from"../../components/predictTracking/previewResult/util.js";var v=(t,e,n)=>new Promise((o,r)=>{var i=u=>{try{d(n.next(u))}catch(p){r(p)}},s=u=>{try{d(n.throw(u))}catch(p){r(p)}},d=u=>u.done?o(u.value):Promise.resolve(u.value).then(i,s);d((n=n.apply(t,e)).next())});const N=(t,e)=>e.map(n=>t(n)),J=t=>t===y.Forward?_.Forward:t===y.Backward?_.Backward:t===y.Jump?_.Jump:_.Forward,Y=(t,e)=>{var n,o;const{imgList:r,imgIndex:i}=t,{dataSourceStep:s}=M(t.stepList,t.step);return((o=(n=K(r[i-1].result)[`step_${s}`])==null?void 0:n.result)==null?void 0:o.length)-1||e};function W(t){return{type:a.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function x({stepList:t}){return{type:a.SET_TASK_STEP_LIST,payload:{stepList:t}}}function G({stepList:t,step:e}){return{type:a.SET_TASK_CONFIG,payload:{stepList:t,step:e}}}function P(t){return{type:a.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function U(t){return{type:a.UPDATE_ON_SAVE,payload:{onSave:t}}}function L(t){return{type:a.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function D(t){return{type:a.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function R(t){return{type:a.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function C(t){return{type:a.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function m(t){return{type:a.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function X(){return{type:a.UPDATE_ROTATE}}function w(t){return{type:a.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function g(t){return{type:a.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function h(t){return{type:a.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function q(){return{type:a.COPY_BACKWARD_RESULT}}function z({id:t,newID:e,rangeIndex:n,imgList:o}){return{type:a.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:e,rangeIndex:n,imgList:o}}}function Z(t,e,n){return{type:a.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:e,rangeIndex:n}}}function $(){return{type:a.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const F=t=>({type:a.SET_CHECK_MODE,payload:{checkMode:t}}),B=t=>({type:a.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function Q({onSubmit:t,onSave:e,onPageChange:n,onStepChange:o,getFileData:r,pageSize:i,loadFileList:s,step:d,stepList:u,skipBeforePageTurning:p,beforeRotate:T,checkMode:l,highlightAttribute:E,preDataProcess:A}){const c=[];return t&&c.push(P(t)),e&&c.push(U(e)),n&&c.push(L(n)),o&&c.push(D(o)),r&&c.push(R(r)),s&&c.push(m(s)),i&&c.push(C(i)),p&&c.push(w(p)),T&&c.push(g(T)),A&&c.push(h(A)),typeof l=="boolean"&&c.push(F(l)),c.push(B(E)),c.push(G({stepList:u,step:d})),c.push({type:a.CALC_STEP_PROGRESS}),c.push({type:a.INIT_TOOL}),H=>N(H,c)}function tt({onSubmit:t,onSave:e,onPageChange:n,onStepChange:o,getFileData:r,pageSize:i,loadFileList:s,stepList:d,beforeRotate:u,highlightAttribute:p,preDataProcess:T}){const l=[];return t&&l.push(P(t)),e&&l.push(U(e)),n&&l.push(L(n)),o&&l.push(D(o)),r&&l.push(R(r)),s&&l.push(m(s)),i&&l.push(C(i)),u&&l.push(g(u)),T&&l.push(h(T)),l.push(B(p)),l.push(x({stepList:d})),E=>N(E,l)}const et=(t,e)=>{var n;const o=e==null?void 0:e.findIndex(r=>(r==null?void 0:r.step)===t);return(n=e[o+1])==null?void 0:n.step},nt=t=>(e,n)=>{const{annotation:o}=n(),{step:r,stepList:i}=o,s=et(r,i);return[e(k(s,t))]},k=(t,e)=>(n,o)=>{var r,i;const{annotation:s}=o();(r=s==null?void 0:s.onStepChange)==null||r.call(s,t);const d=(i=s==null?void 0:s.imgIndex)!=null?i:0;return[n({type:a.SUBMIT_RESULT}),n({type:a.SUBMIT_FILE_DATA,payload:{submitType:_.StepChanged}}),n({type:a.SET_STEP,payload:{toStep:t}}),n({type:a.CALC_STEP_PROGRESS}),n(O(e!=null?e:d,0))]},f=t=>e=>[e({type:a.SUBMIT_RESULT}),e({type:a.SUBMIT_FILE_DATA,payload:{submitType:t}})],at=(t,e,n,o)=>[t(f(n)),t(O(e,o))],ot=(t,e)=>[t({type:a.SUBMIT_RESULT}),t({type:a.SET_BASIC_INDEX,payload:{basicIndex:e}})],rt=(t,e)=>{t({type:a.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:e}})},it=(t=!1)=>(e,n)=>S(e,n,y.Backward,t),st=(t=!1)=>(e,n)=>S(e,n,y.Forward,t),ut=(t,e=!1)=>(n,o)=>{if(t!==o().imgIndex)return S(n,o,y.Jump,e,t)},b=(t,e,n,o)=>v(void 0,null,function*(){var r;const{loadFileList:i,imgList:s,pageSize:d}=e().annotation,u=Math.floor(n/d);I(t,!0);try{const p=yield i(u,d);if(I(t,!1),!((r=p==null?void 0:p.fileList)==null?void 0:r.length)||!(p==null?void 0:p.total))throw new Error("fileList and total are required");const T=o?new Array(p.total):[...s];return T.splice(u*d,d,...p.fileList),t({type:a.UPDATE_IMG_LIST,payload:{imgList:T}}),!0}catch(p){I(t,!1),console.error(p)}}),S=(t,e,n,o=!1,r)=>v(void 0,null,function*(){var i;const s=e().annotation,{fileIndexChanged:d,fileIndex:u,basicIndexChanged:p,basicIndex:T}=j.getNextPageInfo(n,s,r),l=J(n);if(rt(t,o),d){if(s.loading||!s.imgList[u]&&!(yield b(t,e,u)))return;(i=s.onPageChange)==null||i.call(s,u);const E=l===_.Backward?Y(e().annotation,T):T;return at(t,u,l,E)}return p?ot(t,T):t(f(l))}),pt=t=>{t(f(_.Save)),t({type:a.SAVE_RESULT})},I=(t,e)=>{t({type:a.SET_LOADING,payload:{loading:e}})},lt=(t,e)=>{t({type:a.SET_LOADING,payload:{loading:e}})},dt=(t,e)=>{t({type:a.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:e}})},ct=t=>{t({type:a.INIT_ALL_STATE,payload:{}})},Tt=(t,e)=>{t({type:a.SET_PREDICT_RESULT,payload:{result:e}})},_t=(t,e)=>{t({type:a.SET_PREDICT_RESULT_VISIBLE,payload:{visible:e}})},yt=(t,e)=>(n,o)=>{const{imgList:r,step:i}=o().annotation;return V(r,i,t,e)},Et=t=>(e,n)=>{var o,r;const{annotation:i}=n();return(r=(o=i==null?void 0:i.preDataProcess)==null?void 0:o.call(i,t))!=null?r:t.dataList};export{$ as BatchUpdateImgListResultByPredictResult,Z as BatchUpdateResultByTrackID,z as BatchUpdateTrackID,pt as ChangeSave,q as CopyBackWordResult,S as DispatcherTurning,yt as GetBoxesByID,ct as InitAnnotationState,Q as InitTaskData,it as PageBackward,st as PageForward,ut as PageJump,Et as PreDataProcess,I as SetAnnotationLoading,dt as SetLoadPCDFileLoading,lt as SetPointCloudLoading,Tt as SetPredictResult,_t as SetPredictResultVisible,G as SetTaskConfig,x as SetTaskStepList,nt as ToNextStep,f as ToSubmitFileData,g as UpdateBeforeRotate,F as UpdateCheckMode,R as UpdateGetFileData,m as UpdateGetFileList,B as UpdateHighlightAttribute,tt as UpdateInjectFunc,L as UpdateOnPageChange,U as UpdateOnSave,D as UpdateOnStepChange,P as UpdateOnSubmit,C as UpdatePageSize,h as UpdatePreDataProcess,k as UpdateProcessingStep,X as UpdateRotate,w as UpdateSkipBeforePageTurning,W as UpdateToolInstance,b as loadImgList};
1
+ import{ANNOTATION_ACTIONS as a}from"../Actions.js";import{LoadFileAndFileData as O,getStepConfig as K}from"./reducer.js";import{ESubmitType as E}from"../../constant/index.js";import{EPageTurningOperation as y}from"../../data/enums/AnnotationSize.js";import V from"../../utils/PageOperator.js";import{jsonParser as J}from"../../utils/index.js";import{getBoxesByTrackID as X}from"../../components/predictTracking/previewResult/util.js";var x=(t,e,n)=>new Promise((o,r)=>{var u=p=>{try{i(n.next(p))}catch(l){r(l)}},s=p=>{try{i(n.throw(p))}catch(l){r(l)}},i=p=>p.done?o(p.value):Promise.resolve(p.value).then(u,s);i((n=n.apply(t,e)).next())});const N=(t,e)=>e.map(n=>t(n)),Y=t=>t===y.Forward?E.Forward:t===y.Backward?E.Backward:t===y.Jump?E.Jump:E.Forward,W=(t,e)=>{var n,o,r;const{imgList:u,imgIndex:s}=t,{dataSourceStep:i}=K(t.stepList,t.step);return((r=(o=J((n=u[s-1])==null?void 0:n.result)[`step_${i}`])==null?void 0:o.result)==null?void 0:r.length)-1||e};function q(t){return{type:a.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function G({stepList:t}){return{type:a.SET_TASK_STEP_LIST,payload:{stepList:t}}}function w({stepList:t,step:e}){return{type:a.SET_TASK_CONFIG,payload:{stepList:t,step:e}}}function U(t){return{type:a.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function L(t){return{type:a.UPDATE_ON_SAVE,payload:{onSave:t}}}function D(t){return{type:a.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function R(t){return{type:a.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function m(t){return{type:a.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function g(t){return{type:a.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function C(t){return{type:a.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function z(){return{type:a.UPDATE_ROTATE}}function F(t){return{type:a.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function h(t){return{type:a.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function B(t){return{type:a.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function Z(){return{type:a.COPY_BACKWARD_RESULT}}function k(t){return{type:a.UPDATE_IMG_INDEX_BY_EXTERNAL,payload:{getImgIndexByExternal:t}}}function $({id:t,newID:e,rangeIndex:n,imgList:o}){return{type:a.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:e,rangeIndex:n,imgList:o}}}function Q(t,e,n){return{type:a.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:e,rangeIndex:n}}}function tt(){return{type:a.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const b=t=>({type:a.SET_CHECK_MODE,payload:{checkMode:t}}),v=t=>({type:a.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function et({onSubmit:t,onSave:e,onPageChange:n,onStepChange:o,getFileData:r,pageSize:u,loadFileList:s,step:i,stepList:p,skipBeforePageTurning:l,beforeRotate:_,checkMode:c,highlightAttribute:T,preDataProcess:f,getImgIndexByExternal:I}){const d=[];return t&&d.push(U(t)),e&&d.push(L(e)),n&&d.push(D(n)),o&&d.push(R(o)),r&&d.push(m(r)),s&&d.push(C(s)),u&&d.push(g(u)),l&&d.push(F(l)),_&&d.push(h(_)),f&&d.push(B(f)),typeof c=="boolean"&&d.push(b(c)),I&&d.push(k(I)),d.push(v(T)),d.push(w({stepList:p,step:i})),d.push({type:a.CALC_STEP_PROGRESS}),d.push({type:a.INIT_TOOL}),j=>N(j,d)}function nt({onSubmit:t,onSave:e,onPageChange:n,onStepChange:o,getFileData:r,pageSize:u,loadFileList:s,stepList:i,beforeRotate:p,highlightAttribute:l,preDataProcess:_}){const c=[];return t&&c.push(U(t)),e&&c.push(L(e)),n&&c.push(D(n)),o&&c.push(R(o)),r&&c.push(m(r)),s&&c.push(C(s)),u&&c.push(g(u)),p&&c.push(h(p)),_&&c.push(B(_)),c.push(v(l)),c.push(G({stepList:i})),T=>N(T,c)}const at=(t,e)=>{var n;const o=e==null?void 0:e.findIndex(r=>(r==null?void 0:r.step)===t);return(n=e[o+1])==null?void 0:n.step},ot=t=>(e,n)=>{const{annotation:o}=n(),{step:r,stepList:u}=o,s=at(r,u);return[e(H(s,t))]},H=(t,e)=>(n,o)=>{var r,u;const{annotation:s}=o();(r=s==null?void 0:s.onStepChange)==null||r.call(s,t);const i=(u=s==null?void 0:s.imgIndex)!=null?u:0;return[n({type:a.SUBMIT_RESULT}),n({type:a.SUBMIT_FILE_DATA,payload:{submitType:E.StepChanged}}),n({type:a.SET_STEP,payload:{toStep:t}}),n({type:a.CALC_STEP_PROGRESS}),n(O(e!=null?e:i,0))]},S=t=>e=>[e({type:a.SUBMIT_RESULT}),e({type:a.SUBMIT_FILE_DATA,payload:{submitType:t}})],rt=(t,e,n,o)=>[t(S(n)),t(O(e,o))],it=(t,e)=>[t({type:a.SUBMIT_RESULT}),t({type:a.SET_BASIC_INDEX,payload:{basicIndex:e}})],ut=(t,e)=>{t({type:a.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:e}})},st=(t=!1)=>(e,n)=>A(e,n,y.Backward,t),pt=(t=!1)=>(e,n)=>A(e,n,y.Forward,t),lt=(t,e=!1)=>(n,o)=>{if(t!==o().imgIndex)return A(n,o,y.Jump,e,t)},M=(t,e,n,o)=>x(void 0,null,function*(){var r;const{loadFileList:u,imgList:s,pageSize:i}=e().annotation,p=Math.floor(n/i);P(t,!0);try{const l=yield u(p,i);if(P(t,!1),!((r=l==null?void 0:l.fileList)==null?void 0:r.length)||!(l==null?void 0:l.total))throw new Error("fileList and total are required");const _=o?new Array(l.total):[...s];return _.splice(p*i,i,...l.fileList),t({type:a.UPDATE_IMG_LIST,payload:{imgList:_}}),!0}catch(l){P(t,!1),console.error(l)}}),A=(t,e,n,o=!1,r)=>x(void 0,null,function*(){var u,s;const i=e().annotation,p=Y(n);let{fileIndexChanged:l,fileIndex:_,basicIndexChanged:c,basicIndex:T}=V.getNextPageInfo(n,i,r);const f=(u=i==null?void 0:i.getImgIndexByExternal)==null?void 0:u.call(i,i.imgIndex,p);if(f!==void 0&&(l=!0,_=f),ut(t,o),l){if(i.loading||!i.imgList[_]&&!(yield M(t,e,_)))return;(s=i.onPageChange)==null||s.call(i,_);const I=p===E.Backward?W(e().annotation,T):T;return rt(t,_,p,I)}return c?it(t,T):t(S(p))}),dt=t=>{t(S(E.Save)),t({type:a.SAVE_RESULT})},P=(t,e)=>{t({type:a.SET_LOADING,payload:{loading:e}})},ct=(t,e)=>{t({type:a.SET_LOADING,payload:{loading:e}})},_t=(t,e)=>{t({type:a.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:e}})},Tt=t=>{t({type:a.INIT_ALL_STATE,payload:{}})},Et=(t,e)=>{t({type:a.SET_PREDICT_RESULT,payload:{result:e}})},yt=(t,e)=>{t({type:a.SET_PREDICT_RESULT_VISIBLE,payload:{visible:e}})},ft=(t,e)=>(n,o)=>{const{imgList:r,step:u}=o().annotation;return X(r,u,t,e)},It=t=>(e,n)=>{var o,r;const{annotation:u}=n();return(r=(o=u==null?void 0:u.preDataProcess)==null?void 0:o.call(u,t))!=null?r:t.dataList};export{tt as BatchUpdateImgListResultByPredictResult,Q as BatchUpdateResultByTrackID,$ as BatchUpdateTrackID,dt as ChangeSave,Z as CopyBackWordResult,A as DispatcherTurning,ft as GetBoxesByID,Tt as InitAnnotationState,et as InitTaskData,st as PageBackward,pt as PageForward,lt as PageJump,It as PreDataProcess,P as SetAnnotationLoading,_t as SetLoadPCDFileLoading,ct as SetPointCloudLoading,Et as SetPredictResult,yt as SetPredictResultVisible,w as SetTaskConfig,G as SetTaskStepList,ot as ToNextStep,S as ToSubmitFileData,h as UpdateBeforeRotate,b as UpdateCheckMode,m as UpdateGetFileData,C as UpdateGetFileList,v as UpdateHighlightAttribute,k as UpdateImgIndexByExternal,nt as UpdateInjectFunc,D as UpdateOnPageChange,L as UpdateOnSave,R as UpdateOnStepChange,U as UpdateOnSubmit,g as UpdatePageSize,B as UpdatePreDataProcess,H as UpdateProcessingStep,z as UpdateRotate,F as UpdateSkipBeforePageTurning,q as UpdateToolInstance,M as loadImgList};
@@ -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 l}from"../Actions.js";import{jsonParser as w}from"../../utils/index.js";import Y from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as vt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as ut,composeResult as J}from"../../utils/data.js";import O from"../../utils/StepUtils.js";import X from"../../utils/ToolUtils.js";import{MathUtils as at,CommonToolUtils as yt,AnnotationEngine as Pt,ImgUtils as Rt}from"@labelbee/lb-annotation";import{PointCloudUtils as ct,i18n as G}from"@labelbee/lb-utils";import{Modal as dt}from"antd";import{message as pt}from"antd/es";import _t from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as W}from"../../data/enums/ToolType.js";var Ct=Object.defineProperty,Ot=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,Nt=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))Nt.call(e,r)&&It(t,r,e[r]);return t},i=(t,e)=>Ot(t,ht(e)),mt=(t,e,r)=>new Promise((S,d)=>{var A=m=>{try{T(r.next(m))}catch(y){d(y)}},f=m=>{try{T(r.throw(m))}catch(y){d(y)}},T=m=>m.done?S(m.value):Promise.resolve(m.value).then(A,f);T((r=r.apply(t,e)).next())});const x=(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:""},Ut=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},Tt=(t,e)=>t.reduce((r,S)=>{if(S){const d=S.result;if(w(d)[`step_${e}`])return r+1}return r},0)/t.length,Bt=(t,e)=>{const{step:r,stepList:S}=t,d=O.getCurrentStepInfo(r,S),A=vt.jsonParser(d.config);if(X.isVideoTool(d==null?void 0:d.tool)||X.isAudioTool(d==null?void 0:d.tool)||X.isPointCloudTool(d==null?void 0:d.tool)||[W.LLM,W.NLP].includes(d==null?void 0:d.tool))return;const f=document.getElementById("toolContainer");if(!f)throw"Not exist dom named id-toolContainer";const T=At({width:window.innerWidth,height:window.innerHeight}),m=new Pt({container:f,toolName:d.tool,size:T,imgNode:e,config:A,style:JSON.parse(Dt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},wt=(t,e)=>(r,S)=>mt(void 0,null,function*(){var d,A;const{stepList:f,step:T}=S().annotation,m=O.currentToolIsVideo(T,f),y=O.currentToolIsPointCloud(T,f),h=((d=O.getCurrentStepInfo(T,f))==null?void 0:d.tool)===W.LLM,b=((A=O.getCurrentStepInfo(T,f))==null?void 0:A.tool)===W.NLP,N=O.currentToolIsAudio(T,f);if($(r,!0),yield r(xt(t)),m){r(Ft(t));return}if(y||h||N||b){r(jt(t));return}r(Gt(t,e))}),xt=t=>(e,r)=>mt(void 0,null,function*(){const{getFileData:S,imgList:d}=r().annotation;if(S){const A=yield S(d[t],t);e({type:l.SET_FILE_DATA,payload:{fileData:A,index:t}})}}),Ft=t=>e=>{e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},jt=t=>e=>{$(e,!1),e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},Gt=(t,e)=>(r,S)=>{var d;const{toolInstance:A,imgList:f}=S().annotation,T=(d=f==null?void 0:f[t])==null?void 0:d.url;Rt.load(T).then(m=>{$(r,!1),r({type:l.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),A==null||A.setErrorImg(),r({type:l.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Vt=({toolInstance:t,imgList:e,imgIndex:r,stepList:S,step:d=1})=>{var A,f,T,m;const y=((A=e[r])==null?void 0:A.result)||"",[h,b,N]=(f=t==null?void 0:t.exportData())!=null?f:[],V=(m=(T=t==null?void 0:t.exportCustomData)==null?void 0:T.call(t))!=null?m:{},M=ut(y,b),k=J(M,{step:d,stepList:S},{rect:h},V);return e.map((F,H)=>H===r?n(i(n({},F),{result:k}),N):n({},F))},Mt=(t=n({},ft),e)=>{var r,S,d,A,f,T,m,y,h,b,N,V,M,k,F,H,q,Z,Q,tt,et,ot,nt,st,lt;switch(e.type){case l.INIT_ALL_STATE:return n(n({},t),ft);case l.UPDATE_TOOL_INSTANCE:return i(n({},t),{toolInstance:e.payload.toolInstance});case l.UPDATE_IMG_LIST:return i(n({},t),{imgList:e.payload.imgList});case l.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=Tt(o,s);return i(n({},t),{stepProgress:u})}case l.SUBMIT_FILE_DATA:{const{imgList:o,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:L}=t;if(!p||!o[s])return t;const g=((r=o[s])==null?void 0:r.result)||"",[,_,I]=(S=p==null?void 0:p.exportData())!=null?S:[],E=(A=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?A:{},D=ut(g,_),P=J(D,{step:u,stepList:a},{rect:L},E),v=t.imgList.map((C,R)=>{if(R===s){const j=Y.dataCorrection(P,g,u,a);return n(i(n({},C),{result:j}),I)}return C});if(((f=e.payload)==null?void 0:f.submitType)===K.SyncImgList)return i(n({},t),{imgList:v});c&&c([v[s]],(T=e.payload)==null?void 0:T.submitType,s,v);const U=Tt(v,u);return i(n({},t),{stepProgress:U,imgList:v})}case l.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case l.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 L=c;if((p==null?void 0:p.length)>0){const g=(y=p[s])==null?void 0:y.id,_=c.map(I=>i(n({},I),{sourceID:g}));L=_t.cloneDeep(u).filter(I=>I.sourceID!==g),L.push(..._)}return i(n({},t),{resultList:L,imgList:o})}case l.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:L,basicResultList:g}=t;if(!o||!c)return t;const _=e.payload.basicIndex,I=(h=g[_])==null?void 0:h.id,E=w((b=u[a])==null?void 0:b.result),D=(L||[]).filter(j=>j.sourceID===I),P=x(p,s),{dataSourceStep:v,tool:U}=P,C=x(p,v);let R=[];return v&&U&&(R=(N=E[`step_${v}`])==null?void 0:N.result,(R==null?void 0:R.length)>0?(c==null||c.setBasicInfo(C.tool,R[_]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),pt.info(G.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),i(n({},t),{basicIndex:_})}case l.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return i(n({},t),{triggerEventAfterIndexChanged:!!o})}case l.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return i(n({},t),{imgIndex:e.payload.nextIndex});const c=O.getCurrentStepInfo(s,p),{nextIndex:L,imgNode:g,nextBasicIndex:_,imgError:I}=e.payload,E=_!=null?_:0,D=w((V=o[L])==null?void 0:V.result),P=D[`step_${c.step}`],v=!P,U={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};g&&I!==!0?a==null||a.setImgNode(g,U):u==null||u.setValid(U.valid);const C=x(p,c.step),{dataSourceStep:R,tool:j}=C,it=x(p,R),rt=R&&j,B=(H=(F=D[`step_${R}`])==null?void 0:F.result)!=null?H:[],z=Y.getInitialResultList(P==null?void 0:P.result,u,C,B,v);if(a==null||a.launchOperation(),rt&&((B==null?void 0:B.length)>0?a==null||a.setBasicInfo(it.tool,B[E]):(a==null||a.setBasicInfo(it.tool),a==null||a.forbidOperation(),pt.info(G.t("NoDependency")))),c.tool!=="check"){const Lt=(Z=(q=B[E])==null?void 0:q.id)!=null?Z:"",Et=rt?z.filter(St=>yt.isSameSourceID(St.sourceID,Lt)):z;(Q=u==null?void 0:u.history)==null||Q.initRecord(z,!0),u==null||u.setResult(Et)}return i(n({},t),{imgIndex:L,basicIndex:E,basicResultList:B,resultList:z})}case l.UPDATE_ANNOTATION_CONFIG:return i(n({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case l.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return i(n({},t),{stepList:o})}case l.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return i(n({},t),{stepList:o,step:s})}case l.INIT_TOOL:{const{imgNode:o}=t,s=Bt(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return i(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case l.SET_TOOL:{const o=(et=e.payload)==null?void 0:et.instance;return o?i(n({},t),{toolInstance:o}):n({},t)}case l.UPDATE_ON_SUBMIT:return i(n({},t),{onSubmit:e.payload.onSubmit});case l.UPDATE_ON_SAVE:return i(n({},t),{onSave:e.payload.onSave});case l.UPDATE_ON_PAGE_CHANGE:return i(n({},t),{onPageChange:e.payload.onPageChange});case l.SET_PREDICT_RESULT:return i(n({},t),{predictionResult:e.payload.result});case l.SET_PREDICT_RESULT_VISIBLE:return i(n({},t),{predictionResultVisible:e.payload.visible});case l.UPDATE_ON_STEP_CHANGE:return i(n({},t),{onStepChange:e.payload.onStepChange});case l.UPDATE_GET_FILE_DATA:return i(n({},t),{getFileData:e.payload.getFileData});case l.UPDATE_PAGE_SIZE:return i(n({},t),{pageSize:e.payload.pageSize});case l.UPDATE_LOAD_FILE_LIST:return i(n({},t),{loadFileList:e.payload.loadFileList});case l.UPDATE_BEFORE_ROTATE:return i(n({},t),{beforeRotate:e.payload.beforeRotate});case l.UPDATE_PRE_DATA_PROCESS:return i(n({},t),{preDataProcess:e.payload.preDataProcess});case l.SKIP_BEFORE_PAGE_TURNING:return i(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case l.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),i(n({},t),{imgList:a})}case l.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||(ot=o==null?void 0:o.updateRotate)==null||ot.call(o),t}case l.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(nt=o==null?void 0:o.valid)!=null?nt:!0;return dt.destroyAll(),dt.confirm({content:G.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:G.t("Confirm"),cancelText:G.t("Cancel")}),t}case l.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=Y.copyResultChange(p,a,(st=u[s].result)!=null?st:"");u[s]=i(n({},u[s]),{result:c});const g=w(c)[`step_${a}`],_=(g==null?void 0:g.result)||[];return o==null||o.setResult(_),o==null||o.history.pushHistory(_),(lt=o==null?void 0:o.asyncData)==null||lt.call(o,u[s]),i(n({},t),{imgList:[...u]})}case l.SET_STEP:{const{stepList:o,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=x(o,u);return s==null||s.setToolName(a.tool,a.config),i(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case l.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return i(n({},t),{loadPCDFileLoading:!!o})}case l.SET_LOADING:{const{loading:o}=e.payload;return i(n({},t),{loading:!!o})}case l.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return i(n({},t),{pointCloudLoading:!!o})}case l.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return i(n({},t),{checkMode:!!o})}case l.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return i(n({},t),{highlightAttribute:o})}case l.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=i(n({},_),{result:ct.batchUpdateTrackID({id:o,newID:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=i(n({},_),{result:ct.batchUpdateResultByTrackID({id:o,newData:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),i(n({},t),{imgList:g})}case l.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:E}=I;c[E]=_t.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const L=`step_${a}`,g=[],_=s.map((I,E)=>{if(c[E]){const D=I.result==="{}"?w(J("",{step:a,stepList:u},{rect:[]},{})):w(I.result);D[L].result.push(c[E]);const P=i(n({},I),{result:JSON.stringify(D)});return g.push({imgIndex:E,newInfo:P}),P}return I});return o==null||o(_,K.BatchUpdateImgList,-1,_,{updateImgList:g}),i(n({},t),{imgList:_})}default:return t}};export{wt as LoadFileAndFileData,Mt as annotationReducer,Vt as composeResultByToolInstance,x as getStepConfig,Ut as getTotalPage};
1
+ import{getFormatSize as Rt}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Pt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as i}from"../Actions.js";import{jsonParser as x}from"../../utils/index.js";import X from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as Ct}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as pt,composeResult as Y}from"../../utils/data.js";import O from"../../utils/StepUtils.js";import J from"../../utils/ToolUtils.js";import{MathUtils as gt,CommonToolUtils as Ot,AnnotationEngine as ht,ImgUtils as bt}from"@labelbee/lb-annotation";import{PointCloudUtils as _t,i18n as G}from"@labelbee/lb-utils";import{Modal as It}from"antd";import{message as mt}from"antd/es";import ft from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as W}from"../../data/enums/ToolType.js";var Nt=Object.defineProperty,Ut=Object.defineProperties,Bt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,xt=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable,Lt=(t,e,u)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,o=(t,e)=>{for(var u in e||(e={}))xt.call(e,u)&&Lt(t,u,e[u]);if(Tt)for(var u of Tt(e))wt.call(e,u)&&Lt(t,u,e[u]);return t},s=(t,e)=>Ut(t,Bt(e)),Et=(t,e,u)=>new Promise((S,d)=>{var A=m=>{try{E(u.next(m))}catch(R){d(R)}},L=m=>{try{E(u.throw(m))}catch(R){d(R)}},E=m=>m.done?S(m.value):Promise.resolve(m.value).then(A,L);E((u=u.apply(t,e)).next())});const w=(t,e)=>t.find(u=>u.step===e),St={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:""},Ft=t=>{const{imgList:e,imgPageSize:u}=t;return Math.ceil(e.length/u)},At=(t,e)=>t.reduce((u,S)=>{if(S){const d=S.result;if(x(d)[`step_${e}`])return u+1}return u},0)/t.length,jt=(t,e)=>{const{step:u,stepList:S}=t,d=O.getCurrentStepInfo(u,S),A=Ct.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)||[W.LLM,W.NLP].includes(d==null?void 0:d.tool))return;const L=document.getElementById("toolContainer");if(!L)throw"Not exist dom named id-toolContainer";const E=Rt({width:window.innerWidth,height:window.innerHeight}),m=new ht({container:L,toolName:d.tool,size:E,imgNode:e,config:A,style:JSON.parse(Pt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},Gt=(t,e)=>(u,S)=>Et(void 0,null,function*(){var d,A;const{stepList:L,step:E}=S().annotation,m=O.currentToolIsVideo(E,L),R=O.currentToolIsPointCloud(E,L),h=((d=O.getCurrentStepInfo(E,L))==null?void 0:d.tool)===W.LLM,b=((A=O.getCurrentStepInfo(E,L))==null?void 0:A.tool)===W.NLP,N=O.currentToolIsAudio(E,L);if($(u,!0),yield u(Vt(t)),m){u(Mt(t));return}if(R||h||N||b){u(kt(t));return}u(Ht(t,e))}),Vt=t=>(e,u)=>Et(void 0,null,function*(){const{getFileData:S,imgList:d}=u().annotation;if(S){const A=yield S(d[t],t);e({type:i.SET_FILE_DATA,payload:{fileData:A,index:t}})}}),Mt=t=>e=>{e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},kt=t=>e=>{$(e,!1),e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},Ht=(t,e)=>(u,S)=>{var d;const{toolInstance:A,imgList:L}=S().annotation,E=(d=L==null?void 0:L[t])==null?void 0:d.url;bt.load(E).then(m=>{$(u,!1),u({type:i.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(u,!1),A==null||A.setErrorImg(),u({type:i.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},zt=({toolInstance:t,imgList:e,imgIndex:u,stepList:S,step:d=1})=>{var A,L,E,m;const R=((A=e[u])==null?void 0:A.result)||"",[h,b,N]=(L=t==null?void 0:t.exportData())!=null?L:[],V=(m=(E=t==null?void 0:t.exportCustomData)==null?void 0:E.call(t))!=null?m:{},M=pt(R,b),k=Y(M,{step:d,stepList:S},{rect:h},V);return e.map((F,H)=>H===u?o(s(o({},F),{result:k}),N):o({},F))},Kt=(t=o({},St),e)=>{var u,S,d,A,L,E,m,R,h,b,N,V,M,k,F,H,q,Z,Q,tt,et,nt,ot,lt,st,it,rt,ut,at;switch(e.type){case i.INIT_ALL_STATE:return o(o({},t),St);case i.UPDATE_TOOL_INSTANCE:return s(o({},t),{toolInstance:e.payload.toolInstance});case i.UPDATE_IMG_LIST:return s(o({},t),{imgList:e.payload.imgList});case i.CALC_STEP_PROGRESS:{const{imgList:n,step:l}=t,r=At(n,l);return s(o({},t),{stepProgress:r})}case i.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:l,step:r,stepList:a,toolInstance:p,onSubmit:c,resultList:f}=t;if(!p||!n[l])return t;const I=((u=n[l])==null?void 0:u.result)||"",[,_,g]=(S=p==null?void 0:p.exportData())!=null?S:[],T=(A=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?A:{},D=pt(I,_),v=Y(D,{step:r,stepList:a},{rect:f},T),y=t.imgList.map((C,P)=>{if(P===l){const j=X.dataCorrection(v,I,r,a);return o(s(o({},C),{result:j}),g)}return C});if(((L=e.payload)==null?void 0:L.submitType)===K.SyncImgList)return s(o({},t),{imgList:y});c&&c([y[l]],(E=e.payload)==null?void 0:E.submitType,l,y);const U=At(y,r);return s(o({},t),{stepProgress:U,imgList:y})}case i.SAVE_RESULT:{const{imgList:n,imgIndex:l,onSave:r}=t;return r==null||r(n[l],l,n),o({},t)}case i.SUBMIT_RESULT:{const{imgList:n,basicIndex:l,resultList:r,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let f=c;if((p==null?void 0:p.length)>0){const I=(R=p[l])==null?void 0:R.id,_=c.map(g=>s(o({},g),{sourceID:I}));f=ft.cloneDeep(r).filter(g=>g.sourceID!==I),f.push(..._)}return s(o({},t),{resultList:f,imgList:n})}case i.SET_BASIC_INDEX:{const{toolInstance:n,step:l,imgList:r,imgIndex:a,stepList:p,annotationEngine:c,resultList:f,basicResultList:I}=t;if(!n||!c)return t;const _=e.payload.basicIndex,g=(h=I[_])==null?void 0:h.id,T=x((b=r[a])==null?void 0:b.result),D=(f||[]).filter(j=>j.sourceID===g),v=w(p,l),{dataSourceStep:y,tool:U}=v,C=w(p,y);let P=[];return y&&U&&(P=(N=T[`step_${y}`])==null?void 0:N.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(),mt.info(G.t("NoDependency")))),n==null||n.setResult(D),n==null||n.history.initRecord(D,!0),s(o({},t),{basicIndex:_})}case i.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=e.payload;return s(o({},t),{triggerEventAfterIndexChanged:!!n})}case i.LOAD_FILE_DATA:{const{imgList:n,step:l,toolInstance:r,annotationEngine:a,stepList:p}=t;if(!r)return s(o({},t),{imgIndex:e.payload.nextIndex});const c=O.getCurrentStepInfo(l,p),{nextIndex:f,imgNode:I,nextBasicIndex:_,imgError:g}=e.payload,T=_!=null?_:0,D=x((V=n[f])==null?void 0:V.result),v=D[`step_${c.step}`],y=!v,U={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};I&&g!==!0?a==null||a.setImgNode(I,U):r==null||r.setValid(U.valid);const C=w(p,c.step),{dataSourceStep:P,tool:j}=C,ct=w(p,P),dt=P&&j,B=(H=(F=D[`step_${P}`])==null?void 0:F.result)!=null?H:[],z=X.getInitialResultList(v==null?void 0:v.result,r,C,B,y);if(a==null||a.launchOperation(),dt&&((B==null?void 0:B.length)>0?a==null||a.setBasicInfo(ct.tool,B[T]):(a==null||a.setBasicInfo(ct.tool),a==null||a.forbidOperation(),mt.info(G.t("NoDependency")))),c.tool!=="check"){const Dt=(Z=(q=B[T])==null?void 0:q.id)!=null?Z:"",vt=dt?z.filter(yt=>Ot.isSameSourceID(yt.sourceID,Dt)):z;(Q=r==null?void 0:r.history)==null||Q.initRecord(z,!0),r==null||r.setResult(vt)}return s(o({},t),{imgIndex:f,basicIndex:T,basicResultList:B,resultList:z})}case i.UPDATE_ANNOTATION_CONFIG:return s(o({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case i.SET_TASK_STEP_LIST:{const{stepList:n}=e.payload;return s(o({},t),{stepList:n})}case i.SET_TASK_CONFIG:{const{stepList:n,step:l}=e.payload;return s(o({},t),{stepList:n,step:l})}case i.INIT_TOOL:{const{imgNode:n}=t,l=jt(t,n);if(l){const{toolInstance:r,annotationEngine:a}=l;return s(o({},t),{toolInstance:r,annotationEngine:a})}return o({},t)}case i.SET_TOOL:{const n=(et=e.payload)==null?void 0:et.instance;return n?s(o({},t),{toolInstance:n}):o({},t)}case i.UPDATE_ON_SUBMIT:return s(o({},t),{onSubmit:e.payload.onSubmit});case i.UPDATE_ON_SAVE:return s(o({},t),{onSave:e.payload.onSave});case i.UPDATE_ON_PAGE_CHANGE:return s(o({},t),{onPageChange:e.payload.onPageChange});case i.SET_PREDICT_RESULT:return s(o({},t),{predictionResult:e.payload.result});case i.SET_PREDICT_RESULT_VISIBLE:return s(o({},t),{predictionResultVisible:e.payload.visible});case i.UPDATE_ON_STEP_CHANGE:return s(o({},t),{onStepChange:e.payload.onStepChange});case i.UPDATE_GET_FILE_DATA:return s(o({},t),{getFileData:e.payload.getFileData});case i.UPDATE_PAGE_SIZE:return s(o({},t),{pageSize:e.payload.pageSize});case i.UPDATE_LOAD_FILE_LIST:return s(o({},t),{loadFileList:e.payload.loadFileList});case i.UPDATE_BEFORE_ROTATE:return s(o({},t),{beforeRotate:e.payload.beforeRotate});case i.UPDATE_PRE_DATA_PROCESS:return s(o({},t),{preDataProcess:e.payload.preDataProcess});case i.UPDATE_IMG_INDEX_BY_EXTERNAL:return s(o({},t),{getImgIndexByExternal:e.payload.getImgIndexByExternal});case i.SKIP_BEFORE_PAGE_TURNING:return s(o({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case i.SET_FILE_DATA:{const{fileData:n,index:l}=e.payload,{imgList:r}=t,a=[...r];return a[l]=o(o({},a[l]),n),s(o({},t),{imgList:a})}case i.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:l}=t;return l&&l()===!1||(nt=n==null?void 0:n.updateRotate)==null||nt.call(n),t}case i.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=t,l=(ot=n==null?void 0:n.valid)!=null?ot:!0;return It.destroyAll(),It.confirm({content:G.t(l?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!l)},okText:G.t("Confirm"),cancelText:G.t("Cancel")}),t}case i.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:l,imgList:r,step:a,stepList:p}=t;if(!n)return t;if(l===0||l>=r.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const c=r[l-1].result;if(!c)return t;const f=O.getCurrentStepInfo(a,p),I=(lt=f==null?void 0:f.step)!=null?lt:a,_=(st=n==null?void 0:n.valid)!=null?st:!0,g=X.copyResultChange({copyResult:c,step:I,currentResult:(it=r[l].result)!=null?it:"",preMappingImgList:(rt=r[l-1].mappingImgList)!=null?rt:[],mappingImgList:(ut=r[l].mappingImgList)!=null?ut:[],valid:_});r[l]=s(o({},r[l]),{result:g});const D=x(g)[`step_${a}`],v=(D==null?void 0:D.result)||[];return n==null||n.setResult(v),n==null||n.history.pushHistory(v),(at=n==null?void 0:n.asyncData)==null||at.call(n,r[l]),s(o({},t),{imgList:[...r]})}case i.SET_STEP:{const{stepList:n,annotationEngine:l}=t,{toStep:r}=e.payload;if(l){const a=w(n,r);return l==null||l.setToolName(a.tool,a.config),s(o({},t),{step:r,toolInstance:l==null?void 0:l.toolInstance})}return s(o({},t),{step:r})}case i.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=e.payload;return s(o({},t),{loadPCDFileLoading:!!n})}case i.SET_LOADING:{const{loading:n}=e.payload;return s(o({},t),{loading:!!n})}case i.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=e.payload;return s(o({},t),{pointCloudLoading:!!n})}case i.SET_CHECK_MODE:{const{checkMode:n}=e.payload;return s(o({},t),{checkMode:!!n})}case i.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=e.payload;return s(o({},t),{highlightAttribute:n})}case i.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:l,rangeIndex:r,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,f=[],I=a.map((_,g)=>{if(gt.isInRange(g,r)){const T=s(o({},_),{result:_t.batchUpdateTrackID({id:n,newID:l,result:_.result})});return f.push({imgIndex:g,newInfo:T}),T}return _});return c&&c([I[p]],K.BatchUpdateTrackID,p,I,{updateImgList:f}),s(o({},t),{imgList:I})}case i.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:l,rangeIndex:r}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,f=[],I=a.map((_,g)=>{if(gt.isInRange(g,r)){const T=s(o({},_),{result:_t.batchUpdateResultByTrackID({id:n,newData:l,result:_.result})});return f.push({imgIndex:g,newInfo:T}),T}return _});return c&&c([I[p]],K.BatchUpdateTrackID,p,I,{updateImgList:f}),s(o({},t),{imgList:I})}case i.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:l,stepList:r,step:a,predictionResult:p}=t,c={};p.forEach(g=>{const{index:T}=g;c[T]=ft.pick(g,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const f=`step_${a}`,I=[],_=l.map((g,T)=>{if(c[T]){const D=g.result==="{}"?x(Y("",{step:a,stepList:r},{rect:[]},{})):x(g.result);D[f].result.push(c[T]);const v=s(o({},g),{result:JSON.stringify(D)});return I.push({imgIndex:T,newInfo:v}),v}return g});return n==null||n(_,K.BatchUpdateImgList,-1,_,{updateImgList:I}),s(o({},t),{imgList:_})}default:return t}};export{Gt as LoadFileAndFileData,Kt as annotationReducer,zt as composeResultByToolInstance,w as getStepConfig,Ft as getTotalPage};
@@ -1 +1 @@
1
- import{uuid as v}from"@labelbee/lb-annotation";import{jsonParser as l}from"./index.js";import{EToolName as d}from"../data/enums/ToolType.js";import _ from"lodash";import y from"./StepUtils.js";var O=Object.defineProperty,P=Object.defineProperties,j=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,S=(a,t,e)=>t in a?O(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,E=(a,t)=>{for(var e in t||(t={}))w.call(t,e)&&S(a,e,t[e]);if(h)for(var e of h(t))x.call(t,e)&&S(a,e,t[e]);return a},N=(a,t)=>P(a,j(t));class R{static copyResultChange(t,e,r){try{const s=l(t),i=l(r),o=`step_${e}`;if(s[o]){const n=s[o];if(n.result)return n.result=n.result.map(u=>N(E({},u),{id:v(8,62)})),i[o]=n,JSON.stringify(i)}return t}catch(s){return t}}static isResultSourceMatchedDependence(t,e){const r=t==null?void 0:t.map(i=>i.sourceID).sort(),s=e==null?void 0:e.map(i=>i.id).sort();return _.isEqual(r,s)}static deltaUpdateBasicResultList(t,e){const r=t==null?void 0:t.map(s=>s.sourceID).sort();return e.filter(s=>!r.includes(s.id))}static getInitialResultList(t,e,r,s,i){const o=t!=null?t:[];switch(r.tool){case d.Tag:case d.Text:{if(r.dataSourceStep>0){const n=this.deltaUpdateBasicResultList(o,s);if(n.length>0)return o.concat(e.getInitResultList(r.dataSourceStep,n))}return i!==!0?o:e.getInitResultList(r.dataSourceStep,s)}default:return o}}static dataCorrection(t,e,r,s){var i,o;try{const u=`step_${y.getStepInfo(r,s).step}`,c=l(t),I=l(e),f=(i=c[u])==null?void 0:i.result,p=(o=I[u])==null?void 0:o.result;if(!p||_.isEqual(f.sort(this.idCmp),p.sort(this.idCmp)))return t;const m=this.findDeletedIds(f,p);if(m.length===0)return t;const D=r,g=this.getStepKeys(c).sort();return this.deleteRes(c,D,m,g),JSON.stringify(c)}catch(n){return console.error(n),t}}static idCmp(t,e){const r=t.id,s=e.id;return r<s?-1:r>s?1:0}static findDeletedIds(t,e){return this.findDeletedItems(e,t).map(r=>r.id)}static findDeletedItems(t,e){const r=[];return t.forEach(s=>{e.some(o=>o.id===s.id)||r.push(s)}),r}static getStepKeys(t){return Object.keys(t).map(e=>parseInt(e.replace("step_",""),10)).filter(e=>!isNaN(e))}static deleteRes(t,e,r,s){s.forEach(i=>{if(i>e){const o=t[`step_${i}`];if([d.FolderTag,d.Segmentation].includes(o.tool))return;if(o.dataSourceStep===e){const n=[];o.result=o.result.filter(u=>r.includes(u.sourceID)?(n.push(u.id),!1):!0),this.deleteRes(t,i,n,s)}else o.result=o.result.filter(n=>!r.includes(n.sourceID))}})}}export{R as default};
1
+ import{uuid as L}from"@labelbee/lb-annotation";import{jsonParser as v}from"./index.js";import{EToolName as I}from"../data/enums/ToolType.js";import S from"lodash";import _ from"./StepUtils.js";import{message as F}from"antd";import{i18n as E}from"@labelbee/lb-utils";class M{static traverseDF(t,s,e,i){s(t,e,i),typeof t=="object"&&t!==null&&(Array.isArray(t)?t.forEach((n,r)=>{this.traverseDF(n,s,r,t)}):Object.keys(t).forEach(n=>{this.traverseDF(t[n],s,n,t)}))}static getNextPath(t){var s,e,i;const{prePath:n,preMappingImgList:r,nextMappingImgList:a}=t,o=(e=(s=r==null?void 0:r.find(p=>p.path===n))==null?void 0:s.calib)==null?void 0:e.calName;return(i=a.find(p=>{var c;return((c=p.calib)==null?void 0:c.calName)===o}))==null?void 0:i.path}static copyResultItemHandler(t){const{item:s,key:e,parent:i,mappingImgList:n,preMappingImgList:r}=t,a=e===void 0?void 0:i[e];return e==="id"&&(i.id=L(8,62)),e==="imageName"&&(i.imageName=this.getNextPath({prePath:s,preMappingImgList:r,nextMappingImgList:n})),{value:e===void 0?void 0:i[e],oldValue:a}}static copyResultChange(t){const{copyResult:s,step:e,currentResult:i,mappingImgList:n,preMappingImgList:r,valid:a}=t;try{const o=v(s),d=v(i);d.valid=a;const p=`step_${e}`;if(o[p]){const c=o[p],g=["result","resultRect"],f=new Map,y=(l,u)=>{if(l===void 0||u===void 0){console.warn("invalid id");return}f.set(u,l)};if(g.forEach(l=>{c[l]&&this.traverseDF(c[l],(u,m,h)=>{const{value:x,oldValue:N}=this.copyResultItemHandler({item:u,key:m,parent:h,mappingImgList:n,preMappingImgList:r});l==="result"&&m==="id"&&x!==void 0&&N!==void 0&&f.set(N,x)})}),f.size){const l=c.resultRect;Array.isArray(l)&&l.forEach(u=>{const m=u.extId,h=f.get(m);m!==void 0&&h!==void 0&&(u.extId=h)})}const R=["resultRect","rects"],D=[];return this.traverseDF(c,(l,u,m)=>{S.isString(u)&&R.includes(u)&&Array.isArray(l)&&(m[u]=l.filter(h=>h.imageName?!0:(D.push(h),!1)))}),D.length&&(console.log(D),F.info(E.t("PartialResultsReplicationFailure"))),d[p]=c,JSON.stringify(d)}return s}catch(o){F.info(E.t("FailedToCopyResults"))}}static isResultSourceMatchedDependence(t,s){const e=t==null?void 0:t.map(n=>n.sourceID).sort(),i=s==null?void 0:s.map(n=>n.id).sort();return S.isEqual(e,i)}static deltaUpdateBasicResultList(t,s){const e=t==null?void 0:t.map(i=>i.sourceID).sort();return s.filter(i=>!e.includes(i.id))}static getInitialResultList(t,s,e,i,n){const r=t!=null?t:[];switch(e.tool){case I.Tag:case I.Text:{if(e.dataSourceStep>0){const a=this.deltaUpdateBasicResultList(r,i);if(a.length>0)return r.concat(s.getInitResultList(e.dataSourceStep,a))}return n!==!0?r:s.getInitResultList(e.dataSourceStep,i)}default:return r}}static dataCorrection(t,s,e,i){var n,r;try{const o=`step_${_.getStepInfo(e,i).step}`,d=v(t),p=v(s),c=(n=d[o])==null?void 0:n.result,g=(r=p[o])==null?void 0:r.result;if(!g||S.isEqual(c.sort(this.idCmp),g.sort(this.idCmp)))return t;const f=this.findDeletedIds(c,g);if(f.length===0)return t;const y=e,R=this.getStepKeys(d).sort();return this.deleteRes(d,y,f,R),JSON.stringify(d)}catch(a){return console.error(a),t}}static idCmp(t,s){const e=t.id,i=s.id;return e<i?-1:e>i?1:0}static findDeletedIds(t,s){return this.findDeletedItems(s,t).map(e=>e.id)}static findDeletedItems(t,s){const e=[];return t.forEach(i=>{s.some(r=>r.id===i.id)||e.push(i)}),e}static getStepKeys(t){return Object.keys(t).map(s=>parseInt(s.replace("step_",""),10)).filter(s=>!isNaN(s))}static deleteRes(t,s,e,i){i.forEach(n=>{if(n>s){const r=t[`step_${n}`];if([I.FolderTag,I.Segmentation].includes(r.tool))return;if(r.dataSourceStep===s){const a=[];r.result=r.result.filter(o=>e.includes(o.sourceID)?(a.push(o.id),!1):!0),this.deleteRes(t,n,a,i)}else r.result=r.result.filter(a=>!e.includes(a.sourceID))}})}}export{M as default};
@@ -0,0 +1 @@
1
+ import{getCuboidFromPointCloudBox as l}from"@labelbee/lb-annotation";var i;(function(t){t.Default="Default",t.UndoRedo="UndoRedo",t.ClearAll="ClearAll",t.Single="Single",t.SingleDelete="SingleDelete",t.SingleToggleValid="SingleToggleValid",t.SingleRotate="SingleRotate",t.MultiPaste="MultiPaste",t.MultiMove="MultiMove"})(i||(i={}));var d;(function(t){t.ChangeAttribute="ChangeAttribute",t.Move="Move",t.ChangeDepth="ChangeDepth",t.ChangeSize="ChangeSize",t.ToggleValid="ToggleValid"})(d||(d={}));const p=(t,o)=>{const s=g(t).concat(g(o));for(const e of s){const n=h(t,e),r=h(o,e);if(!A(n,r))return!1}return!0},g=t=>{const o=[];for(let s=0;s<t.length;s++){const e=t[s],n=t[(s+1)%t.length],r={x:n.x-e.x,y:n.y-e.y},c={x:-r.y,y:r.x};o.push(c)}return o},h=(t,o)=>{let s=u(t[0],o),e=s;for(const n of t){const r=u(n,o);r<s&&(s=r),r>e&&(e=r)}return{min:s,max:e}},A=(t,o)=>!(t.max<o.min||o.max<t.min),u=(t,o)=>t.x*o.x+t.y*o.y,y=(t,o)=>{const s=[];return o.forEach(e=>{const{polygonPointList:n}=l(e);p(t,n)&&s.push(e.id)}),s},v=(t,o)=>{const s=t.map(n=>n.id),e=o.map(n=>n.id);return s.find(n=>!e.includes(n))||""},S=(t,o)=>{const s=t.map(e=>e.id);return o.find(e=>!s.includes(e.id))},x=(t,o)=>t.find(e=>{const n=o.find(r=>r.id===e.id);return n&&n.valid!==e.valid}),B=(t,o)=>t.find(e=>{const n=o.find(r=>r.id===e.id);return n&&n.rotation!==e.rotation}),f=(t,o)=>{const{polygonPointList:s}=l(t);return{ids:y(s,o.filter(n=>n.id!==t.id)),rect:s}},M=(t,o)=>{const s=(e,n)=>e.attribute===n.attribute&&e.center.x===n.center.x&&e.center.y===n.center.y&&e.depth===n.depth&&e.width===n.width&&e.height===n.height;for(const e of t){const n=o.find(r=>r.id===e.id);if(n&&!s(e,n)){let r;if(n.attribute!==e.attribute?r=d.ChangeAttribute:n.center.x!==e.center.x||n.center.y!==e.center.y?r=d.Move:n.depth!==e.depth?r=d.ChangeDepth:(n.width!==e.width||n.height!==e.height)&&(r=d.ChangeSize),r!==void 0)return{modifiedType:r,box:e}}}},D=(t,o,s)=>{try{switch(t){case i.Single:if(o.length>s.length){const e=v(o,s);return e?{modifiedBoxIds:[e],resetAreas:[]}:{modifiedBoxIds:[],resetAreas:[]}}else{const e=[],n=[],r=M(o,s);if(r&&(e.push(r.box.id),r.modifiedType===d.ChangeSize||r.modifiedType===d.Move)){const c=s.find(m=>m.id===r.box.id),{ids:a,rect:I}=f(c,o);e.push(...a),n.push(I)}return{modifiedBoxIds:e,resetAreas:n}}case i.SingleDelete:if(o.length<s.length){const e=S(o,s);if(e){const r=[l(e).polygonPointList],c=[];if(o.length>1){const{ids:a}=f(e,o);a.length&&c.push(...a)}return{modifiedBoxIds:c,resetAreas:r}}return{modifiedBoxIds:[],resetAreas:[]}}return{modifiedBoxIds:[],resetAreas:[]};case i.SingleRotate:if(B(o,s)){const e=B(o,s);if(e){const n=s.find(a=>a.id===e.id),{ids:r,rect:c}=f(n,o);return{modifiedBoxIds:[e.id,...r],resetAreas:[c]}}}return{modifiedBoxIds:[],resetAreas:[]};case i.SingleToggleValid:if(x(o,s)){const e=x(o,s);return e?{modifiedBoxIds:[e.id],resetAreas:[]}:{modifiedBoxIds:[],resetAreas:[]}}return{modifiedBoxIds:[],resetAreas:[]};case i.MultiPaste:case i.MultiMove:case i.Default:case i.UndoRedo:case i.ClearAll:default:return{modifiedBoxIds:[],resetAreas:[]}}}catch(e){return console.error("calcResetAreasAndBoxIds error:",e),{modifiedBoxIds:[],resetAreas:[]}}};export{i as EPointCloudBoxRenderTrigger,d as EPointCloudBoxSingleModifiedType,D as calcResetAreasAndBoxIds};
package/es/utils/index.js CHANGED
@@ -1 +1 @@
1
- import f from"lodash";import{pointCloudLidar2image as l}from"@labelbee/lb-annotation";var y=Object.defineProperty,d=Object.defineProperties,_=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,m=(r,t,n)=>t in r?y(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,P=(r,t)=>{for(var n in t||(t={}))x.call(t,n)&&m(r,n,t[n]);if(u)for(var n of u(t))O.call(t,n)&&m(r,n,t[n]);return r},w=(r,t)=>d(r,_(t));const b=(r,t={})=>{try{return typeof r=="string"?JSON.parse(r):f.isObject(r)?r:t}catch(n){return t}},I=r=>{if(Array.isArray(r))return r.filter(t=>t).join(" ");if(f.isObject(r)){const t=[];return Object.keys(r).forEach(n=>{r[n]&&t.push(n)}),t.join(" ")}return""},g=r=>{let t=Infinity,n=Infinity,e=-Infinity,o=-Infinity;for(const i of r)t=Math.min(t,i.x),n=Math.min(n,i.y),e=Math.max(e,i.x),o=Math.max(o,i.y);return{x:t,y:n,width:e-t,height:o-n}},v=(()=>{const r=(t,n)=>{const e=Math.max(t.x,n.x),o=Math.max(t.y,n.y),i=Math.min(t.x+t.width,n.x+n.width),a=Math.min(t.y+t.height,n.y+n.height),s=i-e,c=a-o;return s>=0&&c>=0?{x:e,y:o,width:s,height:c}:null};return(t,n,e)=>{if(e[n]){const o=e[n].width,i=e[n].height;return r(t,{x:0,y:0,width:o,height:i})!==null}return!1}})(),j=r=>{var t;const{pointCloudBox:n,mappingData:e,imageSizes:o}=r,{transferViewData:i}=(t=l(n,e.calib))!=null?t:{};if(!i)return;const a=i.reduce((p,h)=>h.type==="line"?[...p,...h.pointList]:p,[]),s=w(P({},g(a)),{imageName:e.path});if(v(s,e.path,o))return s};export{I as classnames,g as getBoundingRect,j as getRectPointCloudBox,b as jsonParser};
1
+ import g from"lodash";import{pointCloudLidar2image as y}from"@labelbee/lb-annotation";var x=Object.defineProperty,_=Object.defineProperties,O=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,m=(e,t,n)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))P.call(t,n)&&m(e,n,t[n]);if(h)for(var n of h(t))w.call(t,n)&&m(e,n,t[n]);return e},I=(e,t)=>_(e,O(t));const v=(e,t={})=>{try{return typeof e=="string"?JSON.parse(e):g.isObject(e)?e:t}catch(n){return t}},j=e=>{if(Array.isArray(e))return e.filter(t=>t).join(" ");if(g.isObject(e)){const t=[];return Object.keys(e).forEach(n=>{e[n]&&t.push(n)}),t.join(" ")}return""},l=e=>{let t=Infinity,n=Infinity,r=-Infinity,o=-Infinity;for(const i of e)t=Math.min(t,i.x),n=Math.min(n,i.y),r=Math.max(r,i.x),o=Math.max(o,i.y);return{x:t,y:n,width:r-t,height:o-n}},u=(()=>{const e=(t,n)=>{const r=Math.max(t.x,n.x),o=Math.max(t.y,n.y),i=Math.min(t.x+t.width,n.x+n.width),s=Math.min(t.y+t.height,n.y+n.height),a=i-r,c=s-o;return a>=0&&c>=0?{x:r,y:o,width:a,height:c}:null};return(t,n,r)=>{if(r[n]){const o=r[n].width,i=r[n].height;return e(t,{x:0,y:0,width:o,height:i})!==null}return!1}})(),d=e=>{var t;const{pointCloudBox:n,mappingData:r,imageSizes:o}=e,{transferViewData:i}=(t=y(n,r.calib))!=null?t:{};if(!i)return;const s=i.reduce((p,f)=>f.type==="line"?[...p,...f.pointList]:p,[]),a=I(b({},l(s)),{imageName:r.path});if(u(a,r.path,o))return a},R=e=>{const{pointCloudBox:t,mappingImgList:n,imageSizes:r}=e,i=n.map(s=>d({pointCloudBox:t,mappingData:s,imageSizes:r})).filter(s=>s!==void 0);i.length>0&&Object.assign(t,{rects:i})};export{j as classnames,R as generatePointCloudBoxRects,l as getBoundingRect,d as getRectPointCloudBox,u as isBoundingRectInImage,v as jsonParser};
@@ -1 +1 @@
1
- import{ViewportProvider as b}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as A}from"antd";import{Layout as y}from"antd/es";import t,{useState as O}from"react";import V from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import k from"./sidebar/index.js";import h from"./toolFooter/index.js";import F from"./toolHeader/index.js";import{getStepConfig as E}from"../../store/annotation/reducer.js";import I from"../../components/videoAnnotate/index.js";import{connect as $}from"react-redux";import g from"../../utils/ToolUtils.js";import H from"../../components/pointCloudView/index.js";import{getClassName as R}from"../../utils/dom.js";import{classnames as W}from"../../utils/index.js";import B from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as D}from"../../store/ctx.js";import{EToolName as c}from"../../data/enums/ToolType.js";import U from"./LLMLayout/index.js";import z from"./NLPLayout/index.js";import q from"../../components/audioAnnotate/index.js";import{LoadingOutlined as G}from"@ant-design/icons";import{useTranslation as J}from"react-i18next";import{EPointCloudName as K}from"@labelbee/lb-annotation";var Q=Object.defineProperty,T=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,P=(e,o,n)=>o in e?Q(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,i=(e,o)=>{for(var n in o||(o={}))X.call(o,n)&&P(e,n,o[n]);if(T)for(var n of T(o))Y.call(o,n)&&P(e,n,o[n]);return e};const{Sider:Z,Content:p}=y,u=`${C}-layout`,ee=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(V,i({},e)),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},te=e=>{var o;return t.createElement(t.Fragment,null,t.createElement(H,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},oe=e=>{var o;const{stepList:n,step:r}=e,a=(o=E(n,r))==null?void 0:o.tool,m=g.isPointCloudTool(a),l=g.isVideoTool(a);return m?t.createElement(te,i({},e)):l?t.createElement(I,{drawLayerSlot:e.drawLayerSlot,footer:e.footer}):t.createElement(ee,i({},e))},f=e=>{var o,n,r;const{t:a}=J(),{stepList:m,step:l}=e,d=(o=E(m,l))==null?void 0:o.tool,s=![c.LLM,c.NLP].includes(d),v=![c.LLM,c.NLP].includes(d),L=[K.PointCloud].includes(d);return t.createElement(b,null,t.createElement(A,{spinning:e.loading,indicator:t.createElement(G,null),tip:t.createElement("span",{style:{marginTop:200}},a("LoadingTips")),delay:500},t.createElement(y,{className:W([u,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${u}__header`,style:(r=e.style)==null?void 0:r.header},t.createElement(F,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:s,hasHeaderOption:v,hasPredictTrackingIcon:L})),e.children)))},ne=e=>{var o,n,r,a,m,l,d;const[s,v]=O(void 0),L=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:x,step:N}=e,_=(r=E(x,N))==null?void 0:r.tool,j=c.LLM===_,w=c.NLP===_,S=g.isAudioTool(_);return j?t.createElement(f,i({},e),t.createElement(U,i({},e))):w?t.createElement(f,i({},e),t.createElement(z,i({},e))):S?t.createElement(f,i({},e),t.createElement(q,i({},e))):t.createElement(f,i({},e),t.createElement(y,{className:R("layout","container")},e==null?void 0:e.leftSider,t.createElement(p,{className:`${u}__content`},t.createElement(oe,i({},e)),t.createElement(B,null)),t.createElement(Z,{className:`${u}__side`,width:(a=s!=null?s:L)!=null?a:240,style:(m=e.style)==null?void 0:m.sider},t.createElement(k,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:v,propsSiderWidth:(d=(l=e.style)==null?void 0:l.sider)==null?void 0:d.width}))))},le=({annotation:e})=>{var o,n,r;const{imgList:a,loading:m}=e,l=(o=a[e.imgIndex])!=null?o:{};return{path:(r=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?r:"",loading:m}};var ie=$(le,null,null,{context:D})(ne);export{ie as default};
1
+ import{ViewportProvider as b}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as A}from"antd";import{Layout as y}from"antd/es";import t,{useState as O}from"react";import V from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import k from"./sidebar/index.js";import h from"./toolFooter/index.js";import F from"./toolHeader/index.js";import{getStepConfig as E}from"../../store/annotation/reducer.js";import I from"../../components/videoAnnotate/index.js";import{connect as B}from"react-redux";import g 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 D}from"../../store/ctx.js";import{EToolName as c}from"../../data/enums/ToolType.js";import U from"./LLMLayout/index.js";import z from"./NLPLayout/index.js";import q from"../../components/audioAnnotate/index.js";import{LoadingOutlined as G}from"@ant-design/icons";import{useTranslation as J}from"react-i18next";import{EPointCloudName as K}from"@labelbee/lb-annotation";var Q=Object.defineProperty,T=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,P=(e,o,n)=>o in e?Q(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,i=(e,o)=>{for(var n in o||(o={}))X.call(o,n)&&P(e,n,o[n]);if(T)for(var n of T(o))Y.call(o,n)&&P(e,n,o[n]);return e};const{Sider:Z,Content:p}=y,u=`${C}-layout`,ee=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(V,i({},e)),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},te=e=>{var o;return t.createElement(t.Fragment,null,t.createElement($,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},oe=e=>{var o;const{stepList:n,step:r}=e,a=(o=E(n,r))==null?void 0:o.tool,m=g.isPointCloudTool(a),l=g.isVideoTool(a);return m?t.createElement(te,i({},e)):l?t.createElement(I,{drawLayerSlot:e.drawLayerSlot,footer:e.footer,annotationBefore:e==null?void 0:e.annotationBefore}):t.createElement(ee,i({},e))},f=e=>{var o,n,r;const{t:a}=J(),{stepList:m,step:l}=e,d=(o=E(m,l))==null?void 0:o.tool,s=![c.LLM,c.NLP].includes(d),v=![c.LLM,c.NLP].includes(d),L=[K.PointCloud].includes(d);return t.createElement(b,null,t.createElement(A,{spinning:e.loading,indicator:t.createElement(G,null),tip:t.createElement("span",{style:{marginTop:200}},a("LoadingTips")),delay:500},t.createElement(y,{className:R([u,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${u}__header`,style:(r=e.style)==null?void 0:r.header},t.createElement(F,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:s,hasHeaderOption:v,hasPredictTrackingIcon:L})),e.children)))},ne=e=>{var o,n,r,a,m,l,d;const[s,v]=O(void 0),L=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:x,step:N}=e,_=(r=E(x,N))==null?void 0:r.tool,j=c.LLM===_,w=c.NLP===_,S=g.isAudioTool(_);return j?t.createElement(f,i({},e),t.createElement(U,i({},e))):w?t.createElement(f,i({},e),t.createElement(z,i({},e))):S?t.createElement(f,i({},e),t.createElement(q,i({},e))):t.createElement(f,i({},e),t.createElement(y,{className:H("layout","container")},e==null?void 0:e.leftSider,t.createElement(p,{className:`${u}__content`},t.createElement(oe,i({},e)),t.createElement(W,null)),t.createElement(Z,{className:`${u}__side`,width:(a=s!=null?s:L)!=null?a:240,style:(m=e.style)==null?void 0:m.sider},t.createElement(k,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:v,propsSiderWidth:(d=(l=e.style)==null?void 0:l.sider)==null?void 0:d.width}))))},le=({annotation:e})=>{var o,n,r;const{imgList:a,loading:m}=e,l=(o=a[e.imgIndex])!=null?o:{};return{path:(r=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?r:"",loading:m}};var ie=B(le,null,null,{context:D})(ne);export{ie as default};