@labelbee/lb-components 1.23.0-alpha.5 → 1.23.0-alpha.51

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 (167) 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/leftArrow.svg.js +1 -1
  5. package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  6. package/dist/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  7. package/dist/assets/icons/ad33251.svg +26 -0
  8. package/dist/components/AnnotationView/index.js +1 -1
  9. package/dist/components/LLMToolView/index.js +1 -1
  10. package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  11. package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
  12. package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  13. package/dist/components/LLMToolView/sidebar/index.js +1 -1
  14. package/dist/components/LLMToolView/utils/data.js +1 -1
  15. package/dist/components/NLPToolView/index.js +1 -1
  16. package/dist/components/NLPToolView/textContent/index.js +1 -1
  17. package/dist/components/audioAnnotate/audioContext/index.js +1 -1
  18. package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
  19. package/dist/components/audioAnnotate/index.js +1 -1
  20. package/dist/components/audioAnnotate/textInput/index.js +1 -1
  21. package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  22. package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
  23. package/dist/components/audioPlayer/clipRegion/index.js +1 -1
  24. package/dist/components/audioPlayer/index.js +1 -1
  25. package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
  26. package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
  27. package/dist/components/longText/index.js +1 -1
  28. package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
  29. package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  30. package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
  31. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  32. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  33. package/dist/components/pointCloudView/PointCloudListener.js +1 -1
  34. package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  35. package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
  36. package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  37. package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
  38. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  39. package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  40. package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
  41. package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
  42. package/dist/components/pointCloudView/index.js +1 -1
  43. package/dist/components/pointCloudView/utils/map.js +1 -0
  44. package/dist/components/subAttributeList/index.js +1 -0
  45. package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
  46. package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  47. package/dist/index.css +64 -19
  48. package/dist/index.js +1 -1
  49. package/dist/store/Actions.js +1 -1
  50. package/dist/store/annotatedBox/index.js +1 -1
  51. package/dist/store/annotation/actionCreators.js +1 -1
  52. package/dist/store/annotation/reducer.js +1 -1
  53. package/dist/types/App.d.ts +3 -1
  54. package/dist/types/components/AnnotationView/index.d.ts +1 -0
  55. package/dist/types/components/LLMToolView/utils/data.d.ts +1 -1
  56. package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
  57. package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
  58. package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
  59. package/dist/types/components/audioPlayer/index.d.ts +28 -21
  60. package/dist/types/components/longText/index.d.ts +1 -0
  61. package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
  62. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +2 -1
  63. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +19 -3
  64. package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +21 -0
  65. package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
  66. package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +5 -0
  67. package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
  68. package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +2 -1
  69. package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
  70. package/dist/types/components/subAttributeList/index.d.ts +10 -0
  71. package/dist/types/components/videoAnnotate/index.d.ts +2 -1
  72. package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
  73. package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
  74. package/dist/types/index.d.ts +6 -1
  75. package/dist/types/store/Actions.d.ts +1 -0
  76. package/dist/types/store/annotatedBox/index.d.ts +2 -0
  77. package/dist/types/store/annotation/actionCreators.d.ts +3 -2
  78. package/dist/types/store/annotation/reducer.d.ts +1 -0
  79. package/dist/types/store/annotation/types.d.ts +9 -2
  80. package/dist/types/utils/AnnotationDataUtils.d.ts +57 -1
  81. package/dist/types/utils/index.d.ts +25 -1
  82. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
  83. package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
  84. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
  85. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
  86. package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
  87. package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
  88. package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
  89. package/dist/utils/AnnotationDataUtils.js +1 -1
  90. package/dist/utils/index.js +1 -1
  91. package/dist/views/MainView/index.js +1 -1
  92. package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
  93. package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
  94. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  95. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  96. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  97. package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
  98. package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  99. package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  100. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  101. package/es/App.js +1 -1
  102. package/es/assets/annotation/icon_link.svg.js +1 -0
  103. package/es/assets/annotation/icon_unlink.svg.js +1 -0
  104. package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
  105. package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  106. package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  107. package/es/components/AnnotationView/index.js +1 -1
  108. package/es/components/LLMToolView/index.js +1 -1
  109. package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  110. package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
  111. package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  112. package/es/components/LLMToolView/sidebar/index.js +1 -1
  113. package/es/components/LLMToolView/utils/data.js +1 -1
  114. package/es/components/NLPToolView/index.js +1 -1
  115. package/es/components/NLPToolView/textContent/index.js +1 -1
  116. package/es/components/audioAnnotate/audioContext/index.js +1 -1
  117. package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
  118. package/es/components/audioAnnotate/index.js +1 -1
  119. package/es/components/audioAnnotate/textInput/index.js +1 -1
  120. package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  121. package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
  122. package/es/components/audioPlayer/clipRegion/index.js +1 -1
  123. package/es/components/audioPlayer/index.js +1 -1
  124. package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
  125. package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
  126. package/es/components/longText/index.js +1 -1
  127. package/es/components/pointCloud2DRectOperationView/index.js +1 -1
  128. package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  129. package/es/components/pointCloudView/PointCloud2DView.js +1 -1
  130. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  131. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  132. package/es/components/pointCloudView/PointCloudListener.js +1 -1
  133. package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  134. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  135. package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  136. package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
  137. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  138. package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  139. package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
  140. package/es/components/pointCloudView/hooks/useStatus.js +1 -1
  141. package/es/components/pointCloudView/index.js +1 -1
  142. package/es/components/pointCloudView/utils/map.js +1 -0
  143. package/es/components/subAttributeList/index.js +1 -0
  144. package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
  145. package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  146. package/es/index.css +64 -19
  147. package/es/index.js +1 -1
  148. package/es/store/Actions.js +1 -1
  149. package/es/store/annotatedBox/index.js +1 -1
  150. package/es/store/annotation/actionCreators.js +1 -1
  151. package/es/store/annotation/reducer.js +1 -1
  152. package/es/utils/AnnotationDataUtils.js +1 -1
  153. package/es/utils/index.js +1 -1
  154. package/es/views/MainView/index.js +1 -1
  155. package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
  156. package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
  157. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  158. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  159. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  160. package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
  161. package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  162. package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  163. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  164. package/package.json +3 -3
  165. package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
  166. package/dist/assets/icons/9d70807.svg +0 -5
  167. package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
@@ -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 {
@@ -1870,11 +1915,14 @@
1870
1915
  -ms-user-select: none;
1871
1916
  user-select: none;
1872
1917
  }
1918
+ .generalOperation .generalOperation-col {
1919
+ display: flex;
1920
+ justify-content: center;
1921
+ }
1873
1922
  .generalOperation .item {
1874
1923
  text-align: center;
1875
- flex: 1;
1876
1924
  box-sizing: border-box;
1877
- width: 100%;
1925
+ width: 100px;
1878
1926
  height: 100%;
1879
1927
  display: flex;
1880
1928
  flex-direction: column;
@@ -2491,14 +2539,14 @@
2491
2539
  margin-right: 16px;
2492
2540
  background-image: url("../dist/assets/icons/7eadb9c4.svg");
2493
2541
  }
2494
- .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 {
2495
2543
  display: inline-block;
2496
2544
  height: 24px;
2497
2545
  width: 24px;
2498
2546
  background-repeat: no-repeat;
2499
2547
  cursor: pointer;
2500
2548
  flex: none;
2501
- background-image: url("../dist/assets/icons/9d70807.svg");
2549
+ background-image: url("../dist/assets/icons/ad33251.svg");
2502
2550
  }
2503
2551
  .bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__next {
2504
2552
  font-size: 24px;
@@ -3077,15 +3125,12 @@
3077
3125
  display: block;
3078
3126
  }
3079
3127
  .bee-sidebar__content__NLPList__item__text {
3080
- flex: 1 1;
3081
- padding: 16px;
3082
3128
  font-weight: 400;
3083
3129
  font-size: 12px;
3084
3130
  line-height: 20px;
3085
3131
  color: #666666;
3086
- overflow: hidden;
3087
- text-overflow: ellipsis;
3088
- white-space: nowrap;
3132
+ padding: 16px;
3133
+ width: 100%;
3089
3134
  }
3090
3135
  .bee-sidebar__content__NLPList__item__active {
3091
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 yt}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Rt 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 Pt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as dt,composeResult as Y}from"../../utils/data.js";import O from"../../utils/StepUtils.js";import J from"../../utils/ToolUtils.js";import{MathUtils as pt,CommonToolUtils as Ct,AnnotationEngine as Ot,ImgUtils as ht}from"@labelbee/lb-annotation";import{PointCloudUtils as gt,i18n as G}from"@labelbee/lb-utils";import{Modal as _t}from"antd";import{message as It}from"antd/es";import mt from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as W}from"../../data/enums/ToolType.js";var bt=Object.defineProperty,Nt=Object.defineProperties,Ut=Object.getOwnPropertyDescriptors,ft=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable,Tt=(t,e,u)=>e in t?bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,o=(t,e)=>{for(var u in e||(e={}))Bt.call(e,u)&&Tt(t,u,e[u]);if(ft)for(var u of ft(e))xt.call(e,u)&&Tt(t,u,e[u]);return t},l=(t,e)=>Nt(t,Ut(e)),Lt=(t,e,u)=>new Promise((S,d)=>{var A=f=>{try{E(u.next(f))}catch(y){d(y)}},L=f=>{try{E(u.throw(f))}catch(y){d(y)}},E=f=>f.done?S(f.value):Promise.resolve(f.value).then(A,L);E((u=u.apply(t,e)).next())});const w=(t,e)=>t.find(u=>u.step===e),Et={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:""},wt=t=>{const{imgList:e,imgPageSize:u}=t;return Math.ceil(e.length/u)},St=(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,Ft=(t,e)=>{const{step:u,stepList:S}=t,d=O.getCurrentStepInfo(u,S),A=Pt.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=yt({width:window.innerWidth,height:window.innerHeight}),f=new Ot({container:L,toolName:d.tool,size:E,imgNode:e,config:A,style:JSON.parse(Rt)});return{toolInstance:f==null?void 0:f.toolInstance,annotationEngine:f}},jt=(t,e)=>(u,S)=>Lt(void 0,null,function*(){var d,A;const{stepList:L,step:E}=S().annotation,f=O.currentToolIsVideo(E,L),y=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(Gt(t)),f){u(Vt(t));return}if(y||h||N||b){u(Mt(t));return}u(kt(t,e))}),Gt=t=>(e,u)=>Lt(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}})}}),Vt=t=>e=>{e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},Mt=t=>e=>{$(e,!1),e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},kt=(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;ht.load(E).then(f=>{$(u,!1),u({type:i.LOAD_FILE_DATA,payload:{imgNode:f,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(u,!1),A==null||A.setErrorImg(),u({type:i.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Ht=({toolInstance:t,imgList:e,imgIndex:u,stepList:S,step:d=1})=>{var A,L,E,f;const y=((A=e[u])==null?void 0:A.result)||"",[h,b,N]=(L=t==null?void 0:t.exportData())!=null?L:[],V=(f=(E=t==null?void 0:t.exportCustomData)==null?void 0:E.call(t))!=null?f:{},M=dt(y,b),k=Y(M,{step:d,stepList:S},{rect:h},V);return e.map((F,H)=>H===u?o(l(o({},F),{result:k}),N):o({},F))},zt=(t=o({},Et),e)=>{var u,S,d,A,L,E,f,y,h,b,N,V,M,k,F,H,q,Z,Q,tt,et,nt,ot,st,lt,it,rt,ut;switch(e.type){case i.INIT_ALL_STATE:return o(o({},t),Et);case i.UPDATE_TOOL_INSTANCE:return l(o({},t),{toolInstance:e.payload.toolInstance});case i.UPDATE_IMG_LIST:return l(o({},t),{imgList:e.payload.imgList});case i.CALC_STEP_PROGRESS:{const{imgList:n,step:s}=t,r=St(n,s);return l(o({},t),{stepProgress:r})}case i.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:s,step:r,stepList:a,toolInstance:p,onSubmit:c,resultList:T}=t;if(!p||!n[s])return t;const I=((u=n[s])==null?void 0:u.result)||"",[,g,_]=(S=p==null?void 0:p.exportData())!=null?S:[],m=(A=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?A:{},D=dt(I,g),R=Y(D,{step:r,stepList:a},{rect:T},m),v=t.imgList.map((C,P)=>{if(P===s){const j=X.dataCorrection(R,I,r,a);return o(l(o({},C),{result:j}),_)}return C});if(((L=e.payload)==null?void 0:L.submitType)===K.SyncImgList)return l(o({},t),{imgList:v});c&&c([v[s]],(E=e.payload)==null?void 0:E.submitType,s,v);const U=St(v,r);return l(o({},t),{stepProgress:U,imgList:v})}case i.SAVE_RESULT:{const{imgList:n,imgIndex:s,onSave:r}=t;return r==null||r(n[s],s,n),o({},t)}case i.SUBMIT_RESULT:{const{imgList:n,basicIndex:s,resultList:r,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(f=a==null?void 0:a.exportData())!=null?f:[];let T=c;if((p==null?void 0:p.length)>0){const I=(y=p[s])==null?void 0:y.id,g=c.map(_=>l(o({},_),{sourceID:I}));T=mt.cloneDeep(r).filter(_=>_.sourceID!==I),T.push(...g)}return l(o({},t),{resultList:T,imgList:n})}case i.SET_BASIC_INDEX:{const{toolInstance:n,step:s,imgList:r,imgIndex:a,stepList:p,annotationEngine:c,resultList:T,basicResultList:I}=t;if(!n||!c)return t;const g=e.payload.basicIndex,_=(h=I[g])==null?void 0:h.id,m=x((b=r[a])==null?void 0:b.result),D=(T||[]).filter(j=>j.sourceID===_),R=w(p,s),{dataSourceStep:v,tool:U}=R,C=w(p,v);let P=[];return v&&U&&(P=(N=m[`step_${v}`])==null?void 0:N.result,(P==null?void 0:P.length)>0?(c==null||c.setBasicInfo(C.tool,P[g]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),It.info(G.t("NoDependency")))),n==null||n.setResult(D),n==null||n.history.initRecord(D,!0),l(o({},t),{basicIndex:g})}case i.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=e.payload;return l(o({},t),{triggerEventAfterIndexChanged:!!n})}case i.LOAD_FILE_DATA:{const{imgList:n,step:s,toolInstance:r,annotationEngine:a,stepList:p}=t;if(!r)return l(o({},t),{imgIndex:e.payload.nextIndex});const c=O.getCurrentStepInfo(s,p),{nextIndex:T,imgNode:I,nextBasicIndex:g,imgError:_}=e.payload,m=g!=null?g:0,D=x((V=n[T])==null?void 0:V.result),R=D[`step_${c.step}`],v=!R,U={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};I&&_!==!0?a==null||a.setImgNode(I,U):r==null||r.setValid(U.valid);const C=w(p,c.step),{dataSourceStep:P,tool:j}=C,at=w(p,P),ct=P&&j,B=(H=(F=D[`step_${P}`])==null?void 0:F.result)!=null?H:[],z=X.getInitialResultList(R==null?void 0:R.result,r,C,B,v);if(a==null||a.launchOperation(),ct&&((B==null?void 0:B.length)>0?a==null||a.setBasicInfo(at.tool,B[m]):(a==null||a.setBasicInfo(at.tool),a==null||a.forbidOperation(),It.info(G.t("NoDependency")))),c.tool!=="check"){const At=(Z=(q=B[m])==null?void 0:q.id)!=null?Z:"",Dt=ct?z.filter(vt=>Ct.isSameSourceID(vt.sourceID,At)):z;(Q=r==null?void 0:r.history)==null||Q.initRecord(z,!0),r==null||r.setResult(Dt)}return l(o({},t),{imgIndex:T,basicIndex:m,basicResultList:B,resultList:z})}case i.UPDATE_ANNOTATION_CONFIG:return l(o({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case i.SET_TASK_STEP_LIST:{const{stepList:n}=e.payload;return l(o({},t),{stepList:n})}case i.SET_TASK_CONFIG:{const{stepList:n,step:s}=e.payload;return l(o({},t),{stepList:n,step:s})}case i.INIT_TOOL:{const{imgNode:n}=t,s=Ft(t,n);if(s){const{toolInstance:r,annotationEngine:a}=s;return l(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?l(o({},t),{toolInstance:n}):o({},t)}case i.UPDATE_ON_SUBMIT:return l(o({},t),{onSubmit:e.payload.onSubmit});case i.UPDATE_ON_SAVE:return l(o({},t),{onSave:e.payload.onSave});case i.UPDATE_ON_PAGE_CHANGE:return l(o({},t),{onPageChange:e.payload.onPageChange});case i.SET_PREDICT_RESULT:return l(o({},t),{predictionResult:e.payload.result});case i.SET_PREDICT_RESULT_VISIBLE:return l(o({},t),{predictionResultVisible:e.payload.visible});case i.UPDATE_ON_STEP_CHANGE:return l(o({},t),{onStepChange:e.payload.onStepChange});case i.UPDATE_GET_FILE_DATA:return l(o({},t),{getFileData:e.payload.getFileData});case i.UPDATE_PAGE_SIZE:return l(o({},t),{pageSize:e.payload.pageSize});case i.UPDATE_LOAD_FILE_LIST:return l(o({},t),{loadFileList:e.payload.loadFileList});case i.UPDATE_BEFORE_ROTATE:return l(o({},t),{beforeRotate:e.payload.beforeRotate});case i.UPDATE_PRE_DATA_PROCESS:return l(o({},t),{preDataProcess:e.payload.preDataProcess});case i.UPDATE_IMG_INDEX_BY_EXTERNAL:return l(o({},t),{getImgIndexByExternal:e.payload.getImgIndexByExternal});case i.SKIP_BEFORE_PAGE_TURNING:return l(o({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case i.SET_FILE_DATA:{const{fileData:n,index:s}=e.payload,{imgList:r}=t,a=[...r];return a[s]=o(o({},a[s]),n),l(o({},t),{imgList:a})}case i.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:s}=t;return s&&s()===!1||(nt=n==null?void 0:n.updateRotate)==null||nt.call(n),t}case i.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=t,s=(ot=n==null?void 0:n.valid)!=null?ot:!0;return _t.destroyAll(),_t.confirm({content:G.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!s)},okText:G.t("Confirm"),cancelText:G.t("Cancel")}),t}case i.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:s,imgList:r,step:a,stepList:p}=t;if(!n)return t;if(s===0||s>=r.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const c=r[s-1].result;if(!c)return t;const T=O.getCurrentStepInfo(a,p),I=(st=T==null?void 0:T.step)!=null?st:a,g=X.copyResultChange({copyResult:c,step:I,currentResult:(lt=r[s].result)!=null?lt:"",preMappingImgList:(it=r[s-1].mappingImgList)!=null?it:[],mappingImgList:(rt=r[s].mappingImgList)!=null?rt:[]});r[s]=l(o({},r[s]),{result:g});const m=x(g)[`step_${a}`],D=(m==null?void 0:m.result)||[];return n==null||n.setResult(D),n==null||n.history.pushHistory(D),(ut=n==null?void 0:n.asyncData)==null||ut.call(n,r[s]),l(o({},t),{imgList:[...r]})}case i.SET_STEP:{const{stepList:n,annotationEngine:s}=t,{toStep:r}=e.payload;if(s){const a=w(n,r);return s==null||s.setToolName(a.tool,a.config),l(o({},t),{step:r,toolInstance:s==null?void 0:s.toolInstance})}return l(o({},t),{step:r})}case i.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=e.payload;return l(o({},t),{loadPCDFileLoading:!!n})}case i.SET_LOADING:{const{loading:n}=e.payload;return l(o({},t),{loading:!!n})}case i.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=e.payload;return l(o({},t),{pointCloudLoading:!!n})}case i.SET_CHECK_MODE:{const{checkMode:n}=e.payload;return l(o({},t),{checkMode:!!n})}case i.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=e.payload;return l(o({},t),{highlightAttribute:n})}case i.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:s,rangeIndex:r,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,T=[],I=a.map((g,_)=>{if(pt.isInRange(_,r)){const m=l(o({},g),{result:gt.batchUpdateTrackID({id:n,newID:s,result:g.result})});return T.push({imgIndex:_,newInfo:m}),m}return g});return c&&c([I[p]],K.BatchUpdateTrackID,p,I,{updateImgList:T}),l(o({},t),{imgList:I})}case i.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:s,rangeIndex:r}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,T=[],I=a.map((g,_)=>{if(pt.isInRange(_,r)){const m=l(o({},g),{result:gt.batchUpdateResultByTrackID({id:n,newData:s,result:g.result})});return T.push({imgIndex:_,newInfo:m}),m}return g});return c&&c([I[p]],K.BatchUpdateTrackID,p,I,{updateImgList:T}),l(o({},t),{imgList:I})}case i.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:s,stepList:r,step:a,predictionResult:p}=t,c={};p.forEach(_=>{const{index:m}=_;c[m]=mt.pick(_,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const T=`step_${a}`,I=[],g=s.map((_,m)=>{if(c[m]){const D=_.result==="{}"?x(Y("",{step:a,stepList:r},{rect:[]},{})):x(_.result);D[T].result.push(c[m]);const R=l(o({},_),{result:JSON.stringify(D)});return I.push({imgIndex:m,newInfo:R}),R}return _});return n==null||n(g,K.BatchUpdateImgList,-1,g,{updateImgList:I}),l(o({},t),{imgList:g})}default:return t}};export{jt as LoadFileAndFileData,zt as annotationReducer,Ht as composeResultByToolInstance,w as getStepConfig,wt 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 E}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 L from"./StepUtils.js";import{message as N}from"antd";import{i18n as F}from"@labelbee/lb-utils";class _{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:o}=t,a=(e=(s=r==null?void 0:r.find(c=>c.path===n))==null?void 0:s.calib)==null?void 0:e.calName;return(i=o.find(c=>{var f;return((f=c.calib)==null?void 0:f.calName)===a}))==null?void 0:i.path}static copyResultItemHandler(t){const{item:s,key:e,parent:i,mappingImgList:n,preMappingImgList:r}=t,o=e===void 0?void 0:i[e];return e==="id"&&(i.id=E(8,62)),e==="imageName"&&(i.imageName=this.getNextPath({prePath:s,preMappingImgList:r,nextMappingImgList:n})),{value:e===void 0?void 0:i[e],oldValue:o}}static copyResultChange(t){const{copyResult:s,step:e,currentResult:i,mappingImgList:n,preMappingImgList:r}=t;try{const o=v(s),a=v(i),d=`step_${e}`;if(o[d]){const c=o[d],f=["result","resultRect"],p=new Map,R=(l,u)=>{if(l===void 0||u===void 0){console.warn("invalid id");return}p.set(u,l)};if(f.forEach(l=>{c[l]&&this.traverseDF(c[l],(u,m,h)=>{const{value:y,oldValue:x}=this.copyResultItemHandler({item:u,key:m,parent:h,mappingImgList:n,preMappingImgList:r});l==="result"&&m==="id"&&y!==void 0&&x!==void 0&&p.set(x,y)})}),p.size){const l=c.resultRect;Array.isArray(l)&&l.forEach(u=>{const m=u.extId,h=p.get(m);m!==void 0&&h!==void 0&&(u.extId=h)})}const D=["resultRect","rects"],g=[];return this.traverseDF(c,(l,u,m)=>{S.isString(u)&&D.includes(u)&&Array.isArray(l)&&(m[u]=l.filter(h=>h.imageName?!0:(g.push(h),!1)))}),g.length&&(console.log(g),N.info(F.t("PartialResultsReplicationFailure"))),a[d]=c,JSON.stringify(a)}return s}catch(o){N.info(F.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 o=this.deltaUpdateBasicResultList(r,i);if(o.length>0)return r.concat(s.getInitResultList(e.dataSourceStep,o))}return n!==!0?r:s.getInitResultList(e.dataSourceStep,i)}default:return r}}static dataCorrection(t,s,e,i){var n,r;try{const a=`step_${L.getStepInfo(e,i).step}`,d=v(t),c=v(s),f=(n=d[a])==null?void 0:n.result,p=(r=c[a])==null?void 0:r.result;if(!p||S.isEqual(f.sort(this.idCmp),p.sort(this.idCmp)))return t;const R=this.findDeletedIds(f,p);if(R.length===0)return t;const D=e,g=this.getStepKeys(d).sort();return this.deleteRes(d,D,R,g),JSON.stringify(d)}catch(o){return console.error(o),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 o=[];r.result=r.result.filter(a=>e.includes(a.sourceID)?(o.push(a.id),!1):!0),this.deleteRes(t,n,o,i)}else r.result=r.result.filter(o=>!e.includes(o.sourceID))}})}}export{_ as default};
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};
@@ -1 +1 @@
1
- import t,{useRef as d,useState as v}from"react";import{Col as p,Popconfirm as C}from"antd";import{useTranslation as s}from"react-i18next";import{prefix as E}from"../../../../constant/index.js";const y={color:"#CCCCCC"},f=({info:r})=>{const{t:e}=s();return r.key.startsWith("sure")?t.createElement("div",{key:r.key},`${e("ConfirmTo")}${r.name.slice(0)}\uFF1F`):t.createElement("span",null,r.name)},k=({icon:r})=>typeof r=="string"?t.createElement("img",{width:23,height:25,src:r}):r,i=({isHover:r,info:e})=>{const n=!!e.forbidOperation,o=e.key===r&&!n;let a={color:o?"#666fff":""};return n&&(a=y),t.createElement("div",{style:{cursor:n?"not-allowed":"default"},onClick:()=>{var c;return(e==null?void 0:e.forbidConfirm)&&!n&&((c=e==null?void 0:e.onClick)==null?void 0:c.call(e))}},t.createElement("div",{className:"icon"},t.createElement(k,{icon:o?e.hoverSvg:e.imgSvg})),t.createElement("div",{className:"toolName",style:a},e.name))},g=({allOperation:r})=>{const e=d(null),[n,o]=v(null),{t:a}=s(),c=Math.floor(24/r.length);return t.createElement("div",{className:"generalOperation",ref:e},r.map((l,u)=>t.createElement(p,{span:c,key:u},t.createElement("div",{key:l.key,className:"item",onMouseEnter:()=>{o(l.key)},onMouseLeave:()=>{o(null)}},l.forbidConfirm?t.createElement(i,{info:l,isHover:n}):t.createElement(C,{title:t.createElement(f,{info:l}),placement:"topRight",okText:a("Confirm"),cancelText:a("Cancel"),getPopupContainer:()=>{var m;return(m=e.current)!=null?m:document.body},onConfirm:l.onClick,overlayClassName:`${E}-pop-confirm`},t.createElement("div",null,t.createElement(i,{info:l,isHover:n})))))))};export{g as default};
1
+ import t,{useRef as d,useState as p}from"react";import{Col as v,Popconfirm as C}from"antd";import{useTranslation as m}from"react-i18next";import{prefix as E}from"../../../../constant/index.js";const y={color:"#CCCCCC"},f=({info:r})=>{const{t:e}=m();return r.key.startsWith("sure")?t.createElement("div",{key:r.key},`${e("ConfirmTo")}${r.name.slice(0)}\uFF1F`):t.createElement("span",null,r.name)},g=({icon:r})=>typeof r=="string"?t.createElement("img",{width:23,height:25,src:r}):r,i=({isHover:r,info:e})=>{const n=!!e.forbidOperation,o=e.key===r&&!n;let a={color:o?"#666fff":""};return n&&(a=y),t.createElement("div",{style:{cursor:n?"not-allowed":"default"},onClick:()=>{var c;return(e==null?void 0:e.forbidConfirm)&&!n&&((c=e==null?void 0:e.onClick)==null?void 0:c.call(e))}},t.createElement("div",{className:"icon"},t.createElement(g,{icon:o?e.hoverSvg:e.imgSvg})),t.createElement("div",{className:"toolName",style:a},e.name))},k=({allOperation:r})=>{const e=d(null),[n,o]=p(null),{t:a}=m(),c=Math.floor(24/r.length);return t.createElement("div",{className:"generalOperation",ref:e},r.map((l,u)=>t.createElement(v,{span:c,key:u,className:"generalOperation-col"},t.createElement("div",{key:l.key,className:"item",onMouseEnter:()=>{o(l.key)},onMouseLeave:()=>{o(null)}},l.forbidConfirm?t.createElement(i,{info:l,isHover:n}):t.createElement(C,{title:t.createElement(f,{info:l}),placement:"topRight",okText:a("Confirm"),cancelText:a("Cancel"),getPopupContainer:()=>{var s;return(s=e.current)!=null?s:document.body},onConfirm:l.onClick,overlayClassName:`${E}-pop-confirm`},t.createElement("div",null,t.createElement(i,{info:l,isHover:n})))))))};export{k as default};
@@ -1 +1 @@
1
- import a,{useState as g,useRef as E,useEffect as $}from"react";import{connect as S}from"react-redux";import j from"../../../../utils/StepUtils.js";import{useTranslation as I}from"react-i18next";import{LabelBeeContext as w}from"../../../../store/ctx.js";import{prefix as P}from"../../../../constant/index.js";import{jsonParser as T,classnames as D}from"../../../../utils/index.js";import{Tooltip as R,Popconfirm as F}from"antd";import{CloseOutlined as H}from"@ant-design/icons";var k=Object.defineProperty,K=Object.defineProperties,U=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,b=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t)=>{for(var n in t||(t={}))B.call(t,n)&&b(e,n,t[n]);if(x)for(var n of x(t))M.call(t,n)&&b(e,n,t[n]);return e},q=(e,t)=>K(e,U(t));const l=`${P}-sidebar`,z=(e,t)=>{const n=(e==null?void 0:e.attributeList)||[];return t.map(s=>{var p,u;const o=((u=(p=n.filter(m=>m.value===s.attribute))==null?void 0:p[0])==null?void 0:u.key)||"";return q(V({},s),{label:o})})},G=e=>{var t,n;const[s,p]=g(0),u=E(null),{toolInstance:o,checkMode:m,stepInfo:h}=e,{t:c}=I(),L=T(h.config),[f,y]=g("");$(()=>(o&&o.on("changeAttributeSidebar",r=>{p(i=>i+1)}),()=>{o==null||o.unbindAll("changeAttributeSidebar")}),[o,u]);const[v]=o.exportData(),C=(n=(t=v==null?void 0:v[0])==null?void 0:t.textAnnotation)!=null?n:[],_=z(L,C),N=r=>{let i=r===f?"":r;o==null||o.setHighlightKey(i),y(i)},O=r=>{o==null||o.deleteTextAnnotation(r.id)};return(_==null?void 0:_.length)===0?null:a.createElement("div",{className:`${l}__content__NLPList`},_.map((r,i)=>{const A=f===r.id;return a.createElement("div",{key:i,className:D({[`${l}__content__NLPList__item`]:!0,[`${l}__content__NLPList__item__active`]:A}),onClick:()=>N(r.id)},a.createElement("span",{className:`${l}__content__NLPList__item__text`},a.createElement(R,{title:r.text,overlayInnerStyle:{maxHeight:"400px",overflow:"auto"}},a.createElement("span",null,`${r.label||c("NoAttribute")}\uFF0C${c("textTool")}\uFF1A${r.text}`))),!m&&a.createElement(F,{title:c("DeleteCommentConfirm"),placement:"topRight",okText:c("Confirm"),cancelText:c("Cancel"),getPopupContainer:d=>d.parentElement,onConfirm:()=>O(r),overlayClassName:`${P}-pop-confirm`},a.createElement(H,{className:`${l}-pop-remove`,onClick:d=>{d.stopPropagation()}})))}))},J=e=>{var t,n;const s=j.getCurrentStepInfo((t=e.annotation)==null?void 0:t.step,(n=e.annotation)==null?void 0:n.stepList);return{toolInstance:e.annotation.toolInstance,stepInfo:s}};var Q=S(J,null,null,{context:w})(G);export{Q as default,l as sidebarCls};
1
+ import i,{useState as P,useRef as A,useEffect as S}from"react";import{connect as w}from"react-redux";import I from"../../../../utils/StepUtils.js";import{useTranslation as R}from"react-i18next";import{LabelBeeContext as D}from"../../../../store/ctx.js";import{prefix as b}from"../../../../constant/index.js";import{jsonParser as B,classnames as H}from"../../../../utils/index.js";import{Row as K,Col as h,Popconfirm as k}from"antd";import{CloseOutlined as F}from"@ant-design/icons";import L from"../../../../components/longText/index.js";var U=Object.defineProperty,M=Object.defineProperties,V=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,T=(n,t,e)=>t in n?U(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,G=(n,t)=>{for(var e in t||(t={}))q.call(t,e)&&T(n,e,t[e]);if(C)for(var e of C(t))z.call(t,e)&&T(n,e,t[e]);return n},J=(n,t)=>M(n,V(t));const c=`${b}-sidebar`,Q=(n,t,e)=>{const l=(n==null?void 0:n.attributeList)||[],m=t.map(a=>{var p,o;const _=((o=(p=l.filter(d=>d.value===a.attribute))==null?void 0:p[0])==null?void 0:o.key)||"";return J(G({},a),{label:_})});return(e==null?void 0:e.length)>0?m.filter(a=>e.includes(a.attribute)):m},W=n=>{var t,e,l;const[m,a]=P(0),p=A(null),{toolInstance:o,checkMode:_,stepInfo:d}=n,{t:u}=R(),y=B(d.config),[g,E]=P("");S(()=>(o&&o.on("changeAttributeSidebar",r=>{a(s=>s+1)}),()=>{o==null||o.unbindAll("changeAttributeSidebar")}),[o,p]);const[x]=o.exportData(),O=(e=(t=x==null?void 0:x[0])==null?void 0:t.textAnnotation)!=null?e:[],f=Q(y,O,(l=o==null?void 0:o.attributeLockList)!=null?l:[]),N=r=>{let s=r===g?"":r;o==null||o.setHighlightKey(s),E(s)},j=r=>{o==null||o.deleteTextAnnotation(r.id)};return(f==null?void 0:f.length)===0?null:i.createElement("div",{className:`${c}__content__NLPList`},f.map((r,s)=>{const $=g===r.id;return i.createElement("div",{key:s,className:H({[`${c}__content__NLPList__item`]:!0,[`${c}__content__NLPList__item__active`]:$}),onClick:()=>N(r.id)},i.createElement(K,{className:`${c}__content__NLPList__item__text`},i.createElement(h,{span:7},i.createElement(L,{text:`${r.label}\uFF0C${u("textTool")}: `,openByText:!0,isToolTips:!0})),i.createElement(h,{span:16,offset:1},i.createElement(L,{text:r.text,openByText:!0,isToolTips:!0}))),!_&&i.createElement(k,{title:u("DeleteCommentConfirm"),placement:"topRight",okText:u("Confirm"),cancelText:u("Cancel"),getPopupContainer:v=>v.parentElement,onConfirm:()=>j(r),overlayClassName:`${b}-pop-confirm`},i.createElement(F,{className:`${c}-pop-remove`,onClick:v=>{v.stopPropagation()}})))}))},X=n=>{var t,e;const l=I.getCurrentStepInfo((t=n.annotation)==null?void 0:t.step,(e=n.annotation)==null?void 0:e.stepList);return{toolInstance:n.annotation.toolInstance,stepInfo:l}};var Y=w(X,null,null,{context:D})(W);export{Y as default,c as sidebarCls};
@@ -0,0 +1 @@
1
+ import t from"react";import{Slider as l}from"antd";import{PointCloudContext as s}from"../../../../../../components/pointCloudView/PointCloudContext.js";import{i18n as a}from"@labelbee/lb-utils";import i from"./index.module.scss.js";const r={.5:.5,1:1,2:2,3:3,4:4},m=()=>{const e=t.useContext(s),o=n=>{e.setRectRotateSensitivity(n)};return t.createElement("div",{className:i.rectRotateSensitivitySlider},t.createElement("div",{className:i.title},a.t("RotationAngleSensitivity")),t.createElement("div",{className:"toolStyle"},t.createElement("div",{id:"style-rectRotateSensitivity"},t.createElement(l,{min:.5,max:4,step:null,value:e.rectRotateSensitivity,onChange:o,marks:r}))))};export{m as default};
@@ -0,0 +1 @@
1
+ var t={rectRotateSensitivitySlider:"index-module_rectRotateSensitivitySlider__tGjUn",title:"index-module_title__aAJW6"};export{t as default};