@labelbee/lb-components 1.16.0-alpha.1 → 1.16.0-alpha.2

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 (174) hide show
  1. package/dist/assets/annotation/audio/clip.svg.js +1 -0
  2. package/dist/assets/annotation/audio/clipA.svg.js +1 -0
  3. package/dist/assets/annotation/audio/clipASmall.svg.js +1 -0
  4. package/dist/assets/annotation/audio/clipSmall.svg.js +1 -0
  5. package/dist/assets/annotation/audio/delete.svg.js +1 -0
  6. package/dist/assets/annotation/audio/loop.svg.js +1 -0
  7. package/dist/assets/annotation/audio/loopA.svg.js +1 -0
  8. package/dist/assets/annotation/audio/progressDot.svg.js +1 -0
  9. package/dist/assets/annotation/audio/progressDotA.svg.js +1 -0
  10. package/dist/assets/annotation/audio/tag.svg.js +1 -0
  11. package/dist/assets/annotation/audio/tagA.svg.js +1 -0
  12. package/dist/assets/annotation/toolHotKeyIcon/deleteRemark.svg.js +1 -0
  13. package/dist/assets/annotation/toolHotKeyIcon/icon_down.svg.js +1 -0
  14. package/dist/assets/annotation/toolHotKeyIcon/icon_eyeLock_kj.svg.js +1 -0
  15. package/dist/assets/annotation/toolHotKeyIcon/icon_polygonCut_kj.svg.js +1 -0
  16. package/dist/assets/annotation/toolHotKeyIcon/icon_up.svg.js +1 -0
  17. package/dist/assets/annotation/toolHotKeyIcon/nextRemark.svg.js +1 -0
  18. package/dist/assets/annotation/toolHotKeyIcon/preRemark.svg.js +1 -0
  19. package/dist/assets/annotation/video/icon_clip.svg.js +1 -0
  20. package/dist/components/audioAnnotate/audioContext/index.js +1 -0
  21. package/dist/components/audioAnnotate/audioContext/index.module.scss.js +1 -0
  22. package/dist/components/audioAnnotate/audioSide/LabelDetailPopover/index.js +1 -0
  23. package/dist/components/audioAnnotate/audioSide/LabelDetailPopover/index.module.scss.js +1 -0
  24. package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -0
  25. package/dist/components/audioAnnotate/audioSide/clipSidebar/index.module.scss.js +1 -0
  26. package/dist/components/audioAnnotate/audioSide/labelFilterInput/index.js +1 -0
  27. package/dist/components/audioAnnotate/audioSide/labelFilterInput/index.module.scss.js +1 -0
  28. package/dist/components/audioAnnotate/audioSide/labelSidebar/index.js +1 -0
  29. package/dist/components/audioAnnotate/audioSide/labelSidebar/index.module.scss.js +1 -0
  30. package/dist/components/audioAnnotate/index.js +1 -0
  31. package/dist/components/audioAnnotate/index.module.scss.js +1 -0
  32. package/dist/components/audioAnnotate/tagResultShow/index.js +1 -0
  33. package/dist/components/audioAnnotate/tagResultShow/index.module.scss.js +1 -0
  34. package/dist/components/audioAnnotate/textInput/index.js +1 -0
  35. package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -0
  36. package/dist/components/audioAnnotate/utils/getWebPcm2Wac.js +1 -0
  37. package/dist/components/audioPlayer/clipRegion/index.js +1 -0
  38. package/dist/components/audioPlayer/clipRegion/index.module.scss.js +1 -0
  39. package/dist/components/audioPlayer/clipTip/index.js +1 -0
  40. package/dist/components/audioPlayer/combineTip/index.js +1 -0
  41. package/dist/components/audioPlayer/index.js +1 -0
  42. package/dist/components/audioPlayer/index.module.scss.js +1 -0
  43. package/dist/components/audioPlayer/labelDisplayToggle/index.js +1 -0
  44. package/dist/components/audioPlayer/labelDisplayToggle/index.module.scss.js +1 -0
  45. package/dist/components/audioPlayer/progressDot/index.js +1 -0
  46. package/dist/components/audioPlayer/progressDot/index.module.scss.js +1 -0
  47. package/dist/components/audioPlayer/segmentTip/index.js +1 -0
  48. package/dist/components/audioPlayer/useAudioCombine/index.js +2 -0
  49. package/dist/components/audioPlayer/useAudioScroll/index.js +1 -0
  50. package/dist/components/audioPlayer/useAudioSegment/index.js +1 -0
  51. package/dist/components/audioPlayer/useSwitchHotkey/index.js +1 -0
  52. package/dist/components/audioPlayer/zoomSlider/index.js +1 -0
  53. package/dist/components/audioPlayer/zoomSlider/index.module.scss.js +1 -0
  54. package/dist/components/imageError/index.js +1 -0
  55. package/dist/components/invalidPage/index.js +1 -0
  56. package/dist/components/videoPlayer/components/SpeedController/index.js +1 -0
  57. package/dist/components/videoPlayer/components/SpeedController/index.module.scss.js +1 -0
  58. package/dist/components/videoPlayer/components/controller/index.js +1 -1
  59. package/dist/components/videoPlayer/index.js +1 -1
  60. package/dist/index.css +721 -0
  61. package/dist/store/annotation/reducer.js +1 -1
  62. package/dist/types/App.d.ts +1 -0
  63. package/dist/types/components/attributeList/index.d.ts +1 -0
  64. package/dist/types/components/audioAnnotate/audioContext/index.d.ts +40 -0
  65. package/dist/types/components/audioAnnotate/audioSide/LabelDetailPopover/index.d.ts +9 -0
  66. package/dist/types/components/audioAnnotate/audioSide/clipSidebar/index.d.ts +11 -0
  67. package/dist/types/components/audioAnnotate/audioSide/labelFilterInput/index.d.ts +7 -0
  68. package/dist/types/components/audioAnnotate/audioSide/labelSidebar/index.d.ts +49 -0
  69. package/dist/types/components/audioAnnotate/index.d.ts +12 -0
  70. package/dist/types/components/audioAnnotate/tagResultShow/index.d.ts +3 -0
  71. package/dist/types/components/audioAnnotate/textInput/index.d.ts +52 -0
  72. package/dist/types/components/audioAnnotate/utils/getWebPcm2Wac.d.ts +1 -0
  73. package/dist/types/components/audioPlayer/clipRegion/index.d.ts +22 -0
  74. package/dist/types/components/audioPlayer/clipTip/index.d.ts +15 -0
  75. package/dist/types/components/audioPlayer/combineTip/index.d.ts +12 -0
  76. package/dist/types/components/audioPlayer/index.d.ts +43 -0
  77. package/dist/types/components/audioPlayer/labelDisplayToggle/index.d.ts +6 -0
  78. package/dist/types/components/audioPlayer/progressDot/index.d.ts +6 -0
  79. package/dist/types/components/audioPlayer/segmentTip/index.d.ts +12 -0
  80. package/dist/types/components/audioPlayer/useAudioCombine/index.d.ts +30 -0
  81. package/dist/types/components/audioPlayer/useAudioScroll/index.d.ts +17 -0
  82. package/dist/types/components/audioPlayer/useAudioSegment/index.d.ts +31 -0
  83. package/dist/types/components/audioPlayer/useSwitchHotkey/index.d.ts +12 -0
  84. package/dist/types/components/audioPlayer/zoomSlider/index.d.ts +13 -0
  85. package/dist/types/components/imageError/index.d.ts +14 -0
  86. package/dist/types/components/invalidPage/index.d.ts +9 -0
  87. package/dist/types/components/videoPlayer/components/SpeedController/index.d.ts +16 -0
  88. package/dist/types/components/videoPlayer/components/controller/index.d.ts +11 -0
  89. package/dist/types/utils/StepUtils.d.ts +7 -0
  90. package/dist/types/utils/ToolUtils.d.ts +1 -0
  91. package/dist/types/utils/audio.d.ts +132 -0
  92. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.d.ts +18 -0
  93. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.d.ts +39 -0
  94. package/dist/utils/StepUtils.js +1 -1
  95. package/dist/utils/ToolUtils.js +1 -1
  96. package/dist/utils/audio.js +1 -0
  97. package/dist/views/MainView/index.js +1 -1
  98. package/dist/views/MainView/sidebar/ToolStyle/index.js +1 -1
  99. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.js +1 -0
  100. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
  101. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  102. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/line/index.js +1 -1
  103. package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
  104. package/es/assets/annotation/audio/clip.svg.js +1 -0
  105. package/es/assets/annotation/audio/clipA.svg.js +1 -0
  106. package/es/assets/annotation/audio/clipASmall.svg.js +1 -0
  107. package/es/assets/annotation/audio/clipSmall.svg.js +1 -0
  108. package/es/assets/annotation/audio/delete.svg.js +1 -0
  109. package/es/assets/annotation/audio/loop.svg.js +1 -0
  110. package/es/assets/annotation/audio/loopA.svg.js +1 -0
  111. package/es/assets/annotation/audio/progressDot.svg.js +1 -0
  112. package/es/assets/annotation/audio/progressDotA.svg.js +1 -0
  113. package/es/assets/annotation/audio/tag.svg.js +1 -0
  114. package/es/assets/annotation/audio/tagA.svg.js +1 -0
  115. package/es/assets/annotation/toolHotKeyIcon/deleteRemark.svg.js +1 -0
  116. package/es/assets/annotation/toolHotKeyIcon/icon_down.svg.js +1 -0
  117. package/es/assets/annotation/toolHotKeyIcon/icon_eyeLock_kj.svg.js +1 -0
  118. package/es/assets/annotation/toolHotKeyIcon/icon_polygonCut_kj.svg.js +1 -0
  119. package/es/assets/annotation/toolHotKeyIcon/icon_up.svg.js +1 -0
  120. package/es/assets/annotation/toolHotKeyIcon/nextRemark.svg.js +1 -0
  121. package/es/assets/annotation/toolHotKeyIcon/preRemark.svg.js +1 -0
  122. package/es/assets/annotation/video/icon_clip.svg.js +1 -0
  123. package/es/components/audioAnnotate/audioContext/index.js +1 -0
  124. package/es/components/audioAnnotate/audioContext/index.module.scss.js +1 -0
  125. package/es/components/audioAnnotate/audioSide/LabelDetailPopover/index.js +1 -0
  126. package/es/components/audioAnnotate/audioSide/LabelDetailPopover/index.module.scss.js +1 -0
  127. package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -0
  128. package/es/components/audioAnnotate/audioSide/clipSidebar/index.module.scss.js +1 -0
  129. package/es/components/audioAnnotate/audioSide/labelFilterInput/index.js +1 -0
  130. package/es/components/audioAnnotate/audioSide/labelFilterInput/index.module.scss.js +1 -0
  131. package/es/components/audioAnnotate/audioSide/labelSidebar/index.js +1 -0
  132. package/es/components/audioAnnotate/audioSide/labelSidebar/index.module.scss.js +1 -0
  133. package/es/components/audioAnnotate/index.js +1 -0
  134. package/es/components/audioAnnotate/index.module.scss.js +1 -0
  135. package/es/components/audioAnnotate/tagResultShow/index.js +1 -0
  136. package/es/components/audioAnnotate/tagResultShow/index.module.scss.js +1 -0
  137. package/es/components/audioAnnotate/textInput/index.js +1 -0
  138. package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -0
  139. package/es/components/audioAnnotate/utils/getWebPcm2Wac.js +1 -0
  140. package/es/components/audioPlayer/clipRegion/index.js +1 -0
  141. package/es/components/audioPlayer/clipRegion/index.module.scss.js +1 -0
  142. package/es/components/audioPlayer/clipTip/index.js +1 -0
  143. package/es/components/audioPlayer/combineTip/index.js +1 -0
  144. package/es/components/audioPlayer/index.js +1 -0
  145. package/es/components/audioPlayer/index.module.scss.js +1 -0
  146. package/es/components/audioPlayer/labelDisplayToggle/index.js +1 -0
  147. package/es/components/audioPlayer/labelDisplayToggle/index.module.scss.js +1 -0
  148. package/es/components/audioPlayer/progressDot/index.js +1 -0
  149. package/es/components/audioPlayer/progressDot/index.module.scss.js +1 -0
  150. package/es/components/audioPlayer/segmentTip/index.js +1 -0
  151. package/es/components/audioPlayer/useAudioCombine/index.js +2 -0
  152. package/es/components/audioPlayer/useAudioScroll/index.js +1 -0
  153. package/es/components/audioPlayer/useAudioSegment/index.js +1 -0
  154. package/es/components/audioPlayer/useSwitchHotkey/index.js +1 -0
  155. package/es/components/audioPlayer/zoomSlider/index.js +1 -0
  156. package/es/components/audioPlayer/zoomSlider/index.module.scss.js +1 -0
  157. package/es/components/imageError/index.js +1 -0
  158. package/es/components/invalidPage/index.js +1 -0
  159. package/es/components/videoPlayer/components/SpeedController/index.js +1 -0
  160. package/es/components/videoPlayer/components/SpeedController/index.module.scss.js +1 -0
  161. package/es/components/videoPlayer/components/controller/index.js +1 -1
  162. package/es/index.css +721 -0
  163. package/es/store/annotation/reducer.js +1 -1
  164. package/es/utils/StepUtils.js +1 -1
  165. package/es/utils/ToolUtils.js +1 -1
  166. package/es/utils/audio.js +1 -0
  167. package/es/views/MainView/index.js +1 -1
  168. package/es/views/MainView/sidebar/ToolStyle/index.js +1 -1
  169. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.js +1 -0
  170. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
  171. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  172. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/line/index.js +1 -1
  173. package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
  174. package/package.json +9 -5
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,s)=>new Promise((O,u)=>{var A=I=>{try{S(s.next(I))}catch(m){u(m)}},g=I=>{try{S(s.throw(I))}catch(m){u(m)}},S=I=>I.done?O(I.value):Promise.resolve(I.value).then(A,g);S((s=s.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(s=>s.step===t),initialState={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:""},getTotalPage=e=>{const{imgList:t,imgPageSize:s}=e;return Math.ceil(t.length/s)},calcStepProgress=(e,t)=>e.reduce((s,O)=>{if(O){const u=O.result;if(index.jsonParser(u)[`step_${t}`])return s+1}return s},0)/e.length,updateToolInstance=(e,t)=>{const{step:s,stepList:O}=e,u=StepUtils.getCurrentStepInfo(s,O),A=ConfigUtils.ConfigUtils.jsonParser(u.config);if(ToolUtils.isVideoTool(u==null?void 0:u.tool)||ToolUtils.isPointCloudTool(u==null?void 0:u.tool)||ToolType.EToolName.LLM===(u==null?void 0:u.tool))return;const g=document.getElementById("toolContainer");if(!g)throw"Not exist dom named id-toolContainer";const S=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:g,toolName:u.tool,size:S,imgNode:t,config:A,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(s,O)=>__async(void 0,null,function*(){var u;const{stepList:A,step:g}=O().annotation,S=StepUtils.currentToolIsVideo(g,A),I=StepUtils.currentToolIsPointCloud(g,A),m=((u=StepUtils.getCurrentStepInfo(g,A))==null?void 0:u.tool)===ToolType.EToolName.LLM;if(actionCreators.SetAnnotationLoading(s,!0),yield s(TryGetFileDataByAPI(e)),S||I||m){s(AfterVideoLoaded(e));return}s(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,s)=>__async(void 0,null,function*(){const{getFileData:O,imgList:u}=s().annotation;if(O){const A=yield O(u[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:A,index:e}})}}),AfterVideoLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(s,O)=>{var u;const{toolInstance:A,imgList:g}=O().annotation,S=(u=g==null?void 0:g[e])==null?void 0:u.url;lbAnnotation.ImgUtils.load(S).then(I=>{actionCreators.SetAnnotationLoading(s,!1),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(s,!1),A==null||A.setErrorImg(),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:s,stepList:O,step:u=1})=>{var A,g,S,I;const m=((A=t[s])==null?void 0:A.result)||"",[h,b,U]=(g=e==null?void 0:e.exportData())!=null?g:[],x=(I=(S=e==null?void 0:e.exportCustomData)==null?void 0:S.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(m,b),w=data.composeResult(B,{step:u,stepList:O},{rect:h},x);return t.map((P,F)=>F===s?__spreadValues(__spreadProps(__spreadValues({},P),{result:w}),U):__spreadValues({},P))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var s,O,u,A,g,S,I,m,h,b,U,x,B,w,P,F,G,V,M,q,k,H,z;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,i=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:i})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:i,stepList:r,toolInstance:a,onSubmit:l,resultList:N}=e;if(!a||!n[o])return e;const d=((s=n[o])==null?void 0:s.result)||"",[,c,T]=(O=a==null?void 0:a.exportData())!=null?O:[],p=(A=(u=a==null?void 0:a.exportCustomData)==null?void 0:u.call(a))!=null?A:{},f=data.composeResultWithBasicImgInfo(d,c),C=data.composeResult(f,{step:i,stepList:r},{rect:N},p),L=e.imgList.map((v,E)=>{if(E===o){const R=AnnotationDataUtils.dataCorrection(C,d,i,r);return __spreadValues(__spreadProps(__spreadValues({},v),{result:R}),T)}return v});if(((g=t.payload)==null?void 0:g.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:L});l&&l([L[o]],(S=t.payload)==null?void 0:S.submitType,o,L);const D=calcStepProgress(L,i);return __spreadProps(__spreadValues({},e),{stepProgress:D,imgList:L})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:i}=e;return i==null||i(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:i,toolInstance:r,basicResultList:a}=e;if(!r)return e;const[l]=(I=r==null?void 0:r.exportData())!=null?I:[];let N=l;if((a==null?void 0:a.length)>0){const d=(m=a[o])==null?void 0:m.id,c=l.map(T=>__spreadProps(__spreadValues({},T),{sourceID:d}));N=___default.default.cloneDeep(i).filter(T=>T.sourceID!==d),N.push(...c)}return __spreadProps(__spreadValues({},e),{resultList:N,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:i,imgIndex:r,stepList:a,annotationEngine:l,resultList:N,basicResultList:d}=e;if(!n||!l)return e;const c=t.payload.basicIndex,T=(h=d[c])==null?void 0:h.id,p=index.jsonParser((b=i[r])==null?void 0:b.result),f=(N||[]).filter(R=>R.sourceID===T),C=getStepConfig(a,o),{dataSourceStep:L,tool:D}=C,v=getStepConfig(a,L);let E=[];return L&&D&&(E=(U=p[`step_${L}`])==null?void 0:U.result,(E==null?void 0:E.length)>0?(l==null||l.setBasicInfo(v.tool,E[c]),l==null||l.launchOperation()):(l==null||l.setBasicInfo(v.tool),l==null||l.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:c})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:i,annotationEngine:r,stepList:a}=e;if(!i)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const l=StepUtils.getCurrentStepInfo(o,a),{nextIndex:N,imgNode:d,nextBasicIndex:c,imgError:T}=t.payload,p=c!=null?c:0,f=index.jsonParser((x=n[N])==null?void 0:x.result),C=f[`step_${l.step}`],L=!C,D={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!0};d&&T!==!0?r==null||r.setImgNode(d,D):i==null||i.setValid(D.valid);const v=getStepConfig(a,l.step),{dataSourceStep:E,tool:R}=v,K=getStepConfig(a,E),W=E&&R,y=(F=(P=f[`step_${E}`])==null?void 0:P.result)!=null?F:[],j=AnnotationDataUtils.getInitialResultList(C==null?void 0:C.result,i,v,y,L);if(r==null||r.launchOperation(),W&&((y==null?void 0:y.length)>0?r==null||r.setBasicInfo(K.tool,y[p]):(r==null||r.setBasicInfo(K.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),l.tool!=="check"){const $=(V=(G=y[p])==null?void 0:G.id)!=null?V:"",Y=W?j.filter(J=>lbAnnotation.CommonToolUtils.isSameSourceID(J.sourceID,$)):j;i==null||i.history.initRecord(j,!0),i==null||i.setResult(Y)}return __spreadProps(__spreadValues({},e),{imgIndex:N,basicIndex:p,basicResultList:y,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(M=t.payload.config)!=null?M:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:i,annotationEngine:r}=o;return __spreadProps(__spreadValues({},e),{toolInstance:i,annotationEngine:r})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(q=t.payload)==null?void 0:q.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS:return __spreadProps(__spreadValues({},e),{preDataProcess:t.payload.preDataProcess});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:i}=e,r=[...i];return r[o]=__spreadValues(__spreadValues({},r[o]),n),__spreadProps(__spreadValues({},e),{imgList:r})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||n==null||n.updateRotate(),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(k=n==null?void 0:n.valid)!=null?k:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:i,step:r}=e;if(!n)return e;if(o===0||o>=i.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const a=i[o-1].result;if(!a)return e;const l=AnnotationDataUtils.copyResultChange(a,r,(H=i[o].result)!=null?H:"");i[o]=__spreadProps(__spreadValues({},i[o]),{result:l});const d=index.jsonParser(l)[`step_${r}`],c=(d==null?void 0:d.result)||[];return n==null||n.setResult(c),n==null||n.history.pushHistory(c),(z=n==null?void 0:n.asyncData)==null||z.call(n,i[o]),__spreadProps(__spreadValues({},e),{imgList:[...i]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:i}=t.payload;if(!o)return e;const r=getStepConfig(n,i);return o==null||o.setToolName(r.tool,r.config),__spreadProps(__spreadValues({},e),{step:i,toolInstance:o==null?void 0:o.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loadPCDFileLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:i,imgList:r}=t.payload,{imgIndex:a,onSubmit:l}=e,N=[],d=r.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const p=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:c.result})});return N.push({imgIndex:T,newInfo:p}),p}return c});return l&&l([d[a]],index$1.ESubmitType.BatchUpdateTrackID,a,d,{updateImgList:N}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:i}=t.payload,{imgList:r,imgIndex:a,onSubmit:l}=e,N=[],d=r.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const p=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:c.result})});return N.push({imgIndex:T,newInfo:p}),p}return c});return l&&l([d[a]],index$1.ESubmitType.BatchUpdateTrackID,a,d,{updateImgList:N}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:i,step:r,predictionResult:a}=e,l={};a.forEach(T=>{const{index:p}=T;l[p]=___default.default.pick(T,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const N=`step_${r}`,d=[],c=o.map((T,p)=>{if(l[p]){const f=T.result==="{}"?index.jsonParser(data.composeResult("",{step:r,stepList:i},{rect:[]},{})):index.jsonParser(T.result);f[N].result.push(l[p]);const C=__spreadProps(__spreadValues({},T),{result:JSON.stringify(f)});return d.push({imgIndex:p,newInfo:C}),C}return T});return n==null||n(c,index$1.ESubmitType.BatchUpdateImgList,-1,c,{updateImgList:d}),__spreadProps(__spreadValues({},e),{imgList:c})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,s)=>new Promise((O,a)=>{var A=I=>{try{S(s.next(I))}catch(m){a(m)}},g=I=>{try{S(s.throw(I))}catch(m){a(m)}},S=I=>I.done?O(I.value):Promise.resolve(I.value).then(A,g);S((s=s.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(s=>s.step===t),initialState={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:""},getTotalPage=e=>{const{imgList:t,imgPageSize:s}=e;return Math.ceil(t.length/s)},calcStepProgress=(e,t)=>e.reduce((s,O)=>{if(O){const a=O.result;if(index.jsonParser(a)[`step_${t}`])return s+1}return s},0)/e.length,updateToolInstance=(e,t)=>{const{step:s,stepList:O}=e,a=StepUtils.getCurrentStepInfo(s,O),A=ConfigUtils.ConfigUtils.jsonParser(a.config);if(ToolUtils.isVideoTool(a==null?void 0:a.tool)||ToolUtils.isAudioTool(a==null?void 0:a.tool)||ToolUtils.isPointCloudTool(a==null?void 0:a.tool)||ToolType.EToolName.LLM===(a==null?void 0:a.tool))return;const g=document.getElementById("toolContainer");if(!g)throw"Not exist dom named id-toolContainer";const S=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:g,toolName:a.tool,size:S,imgNode:t,config:A,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(s,O)=>__async(void 0,null,function*(){var a;const{stepList:A,step:g}=O().annotation,S=StepUtils.currentToolIsVideo(g,A),I=StepUtils.currentToolIsPointCloud(g,A),m=((a=StepUtils.getCurrentStepInfo(g,A))==null?void 0:a.tool)===ToolType.EToolName.LLM,D=StepUtils.currentToolIsAudio(g,A);if(actionCreators.SetAnnotationLoading(s,!0),yield s(TryGetFileDataByAPI(e)),S||I||m||D){s(AfterVideoLoaded(e));return}s(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,s)=>__async(void 0,null,function*(){const{getFileData:O,imgList:a}=s().annotation;if(O){const A=yield O(a[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:A,index:e}})}}),AfterVideoLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(s,O)=>{var a;const{toolInstance:A,imgList:g}=O().annotation,S=(a=g==null?void 0:g[e])==null?void 0:a.url;lbAnnotation.ImgUtils.load(S).then(I=>{actionCreators.SetAnnotationLoading(s,!1),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(s,!1),A==null||A.setErrorImg(),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:s,stepList:O,step:a=1})=>{var A,g,S,I;const m=((A=t[s])==null?void 0:A.result)||"",[D,b,U]=(g=e==null?void 0:e.exportData())!=null?g:[],x=(I=(S=e==null?void 0:e.exportCustomData)==null?void 0:S.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(m,b),w=data.composeResult(B,{step:a,stepList:O},{rect:D},x);return t.map((R,F)=>F===s?__spreadValues(__spreadProps(__spreadValues({},R),{result:w}),U):__spreadValues({},R))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var s,O,a,A,g,S,I,m,D,b,U,x,B,w,R,F,G,V,M,q,k,H,z;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,i=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:i})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:i,stepList:r,toolInstance:u,onSubmit:l,resultList:N}=e;if(!u||!n[o])return e;const d=((s=n[o])==null?void 0:s.result)||"",[,c,T]=(O=u==null?void 0:u.exportData())!=null?O:[],p=(A=(a=u==null?void 0:u.exportCustomData)==null?void 0:a.call(u))!=null?A:{},f=data.composeResultWithBasicImgInfo(d,c),C=data.composeResult(f,{step:i,stepList:r},{rect:N},p),L=e.imgList.map((v,E)=>{if(E===o){const h=AnnotationDataUtils.dataCorrection(C,d,i,r);return __spreadValues(__spreadProps(__spreadValues({},v),{result:h}),T)}return v});if(((g=t.payload)==null?void 0:g.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:L});l&&l([L[o]],(S=t.payload)==null?void 0:S.submitType,o,L);const y=calcStepProgress(L,i);return __spreadProps(__spreadValues({},e),{stepProgress:y,imgList:L})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:i}=e;return i==null||i(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:i,toolInstance:r,basicResultList:u}=e;if(!r)return e;const[l]=(I=r==null?void 0:r.exportData())!=null?I:[];let N=l;if((u==null?void 0:u.length)>0){const d=(m=u[o])==null?void 0:m.id,c=l.map(T=>__spreadProps(__spreadValues({},T),{sourceID:d}));N=___default.default.cloneDeep(i).filter(T=>T.sourceID!==d),N.push(...c)}return __spreadProps(__spreadValues({},e),{resultList:N,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:i,imgIndex:r,stepList:u,annotationEngine:l,resultList:N,basicResultList:d}=e;if(!n||!l)return e;const c=t.payload.basicIndex,T=(D=d[c])==null?void 0:D.id,p=index.jsonParser((b=i[r])==null?void 0:b.result),f=(N||[]).filter(h=>h.sourceID===T),C=getStepConfig(u,o),{dataSourceStep:L,tool:y}=C,v=getStepConfig(u,L);let E=[];return L&&y&&(E=(U=p[`step_${L}`])==null?void 0:U.result,(E==null?void 0:E.length)>0?(l==null||l.setBasicInfo(v.tool,E[c]),l==null||l.launchOperation()):(l==null||l.setBasicInfo(v.tool),l==null||l.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:c})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:i,annotationEngine:r,stepList:u}=e;if(!i)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const l=StepUtils.getCurrentStepInfo(o,u),{nextIndex:N,imgNode:d,nextBasicIndex:c,imgError:T}=t.payload,p=c!=null?c:0,f=index.jsonParser((x=n[N])==null?void 0:x.result),C=f[`step_${l.step}`],L=!C,y={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!0};d&&T!==!0?r==null||r.setImgNode(d,y):i==null||i.setValid(y.valid);const v=getStepConfig(u,l.step),{dataSourceStep:E,tool:h}=v,K=getStepConfig(u,E),W=E&&h,P=(F=(R=f[`step_${E}`])==null?void 0:R.result)!=null?F:[],j=AnnotationDataUtils.getInitialResultList(C==null?void 0:C.result,i,v,P,L);if(r==null||r.launchOperation(),W&&((P==null?void 0:P.length)>0?r==null||r.setBasicInfo(K.tool,P[p]):(r==null||r.setBasicInfo(K.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),l.tool!=="check"){const $=(V=(G=P[p])==null?void 0:G.id)!=null?V:"",Y=W?j.filter(J=>lbAnnotation.CommonToolUtils.isSameSourceID(J.sourceID,$)):j;i==null||i.history.initRecord(j,!0),i==null||i.setResult(Y)}return __spreadProps(__spreadValues({},e),{imgIndex:N,basicIndex:p,basicResultList:P,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(M=t.payload.config)!=null?M:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:i,annotationEngine:r}=o;return __spreadProps(__spreadValues({},e),{toolInstance:i,annotationEngine:r})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(q=t.payload)==null?void 0:q.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS:return __spreadProps(__spreadValues({},e),{preDataProcess:t.payload.preDataProcess});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:i}=e,r=[...i];return r[o]=__spreadValues(__spreadValues({},r[o]),n),__spreadProps(__spreadValues({},e),{imgList:r})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||n==null||n.updateRotate(),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(k=n==null?void 0:n.valid)!=null?k:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:i,step:r}=e;if(!n)return e;if(o===0||o>=i.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const u=i[o-1].result;if(!u)return e;const l=AnnotationDataUtils.copyResultChange(u,r,(H=i[o].result)!=null?H:"");i[o]=__spreadProps(__spreadValues({},i[o]),{result:l});const d=index.jsonParser(l)[`step_${r}`],c=(d==null?void 0:d.result)||[];return n==null||n.setResult(c),n==null||n.history.pushHistory(c),(z=n==null?void 0:n.asyncData)==null||z.call(n,i[o]),__spreadProps(__spreadValues({},e),{imgList:[...i]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:i}=t.payload;if(!o)return e;const r=getStepConfig(n,i);return o==null||o.setToolName(r.tool,r.config),__spreadProps(__spreadValues({},e),{step:i,toolInstance:o==null?void 0:o.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loadPCDFileLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:i,imgList:r}=t.payload,{imgIndex:u,onSubmit:l}=e,N=[],d=r.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const p=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:c.result})});return N.push({imgIndex:T,newInfo:p}),p}return c});return l&&l([d[u]],index$1.ESubmitType.BatchUpdateTrackID,u,d,{updateImgList:N}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:i}=t.payload,{imgList:r,imgIndex:u,onSubmit:l}=e,N=[],d=r.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const p=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:c.result})});return N.push({imgIndex:T,newInfo:p}),p}return c});return l&&l([d[u]],index$1.ESubmitType.BatchUpdateTrackID,u,d,{updateImgList:N}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:i,step:r,predictionResult:u}=e,l={};u.forEach(T=>{const{index:p}=T;l[p]=___default.default.pick(T,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const N=`step_${r}`,d=[],c=o.map((T,p)=>{if(l[p]){const f=T.result==="{}"?index.jsonParser(data.composeResult("",{step:r,stepList:i},{rect:[]},{})):index.jsonParser(T.result);f[N].result.push(l[p]);const C=__spreadProps(__spreadValues({},T),{result:JSON.stringify(f)});return d.push({imgIndex:p,newInfo:C}),C}return T});return n==null||n(c,index$1.ESubmitType.BatchUpdateImgList,-1,c,{updateImgList:d}),__spreadProps(__spreadValues({},e),{imgList:c})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
@@ -76,6 +76,7 @@ export interface AppProps {
76
76
  toolInstance: ToolInstance;
77
77
  }) => void;
78
78
  preDataProcess?: (params: IPreDataProcessParams) => IPointCloudBox[];
79
+ auditContext?: any;
79
80
  }
80
81
  declare const _default: import("react-redux").ConnectedComponent<React.FC<AppProps>, import("react-redux").Omit<AppProps & {
81
82
  children?: React.ReactNode;
@@ -18,6 +18,7 @@ interface IProps {
18
18
  enableColorPicker?: boolean;
19
19
  updateColorConfig?: (value: string, color: string) => void;
20
20
  updateSize?: (size: IDefaultSize) => void;
21
+ attributeLockChange?: (list: any) => void;
21
22
  }
22
23
  declare const AttributeList: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
23
24
  export default AttributeList;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { SetState } from 'ahooks/lib/useSetState';
3
+ import { IAudioTextToolConfig } from '@labelbee/lb-utils';
4
+ export declare enum EContextType {
5
+ before = "\u524D\u6587",
6
+ after = "\u540E\u6587"
7
+ }
8
+ interface IAudioContextProps {
9
+ audioContext: {
10
+ visible?: boolean;
11
+ content: string;
12
+ title: string;
13
+ type: keyof typeof EContextType;
14
+ };
15
+ }
16
+ declare const AudioContext: (props: IAudioContextProps) => React.JSX.Element | null;
17
+ export default AudioContext;
18
+ export interface ISelectedRegion {
19
+ id?: string;
20
+ loop?: boolean;
21
+ }
22
+ type IAudioClipConfig = Pick<IAudioTextToolConfig, 'clipConfigurable' | 'clipAttributeConfigurable' | 'clipAttributeList' | 'clipTextConfigurable'>;
23
+ interface IAudioClipState extends IAudioClipConfig {
24
+ /** 选中的截取属性,新建截取片段的默认属性 */
25
+ selectedAttribute: string;
26
+ /** 选中的截取数据的id,loop用于展示是否在循环,空对象表示没有选中的数据 */
27
+ selectedRegion: ISelectedRegion;
28
+ /** 锁定属性的列表 */
29
+ attributeLockList: string[];
30
+ /** 是否按下合并键 */
31
+ combined: boolean;
32
+ /** 是否按下分割键 */
33
+ segment: boolean;
34
+ }
35
+ interface IAudioClipContext {
36
+ audioClipState: IAudioClipState;
37
+ setAudioClipState: SetState<IAudioClipState>;
38
+ }
39
+ export declare const useAudioClipStore: () => IAudioClipContext;
40
+ export declare const AudioClipProvider: React.FC;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { IEntityDetail } from '@/types/tool';
3
+ interface IProps {
4
+ labelDetail?: IEntityDetail;
5
+ visible?: boolean;
6
+ style?: React.CSSProperties;
7
+ }
8
+ declare const LabelDetailPopover: React.FC<IProps>;
9
+ export default LabelDetailPopover;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { IAudioTimeSlice } from '@labelbee/lb-utils';
3
+ interface IClipSidebarProps {
4
+ /** 截取片段数组 */
5
+ regions: IAudioTimeSlice[];
6
+ updateRegion: (region: IAudioTimeSlice) => void;
7
+ useAudioClipStore: any;
8
+ }
9
+ /** 开启音频截取后,标注中展示在右侧,包含已截取片段和调整属性操作 */
10
+ declare const ClipSidebar: (props: IClipSidebarProps) => React.JSX.Element;
11
+ export default ClipSidebar;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /** 标签搜索框 */
3
+ declare const LabelFilterInput: ({ value, onChange, }: {
4
+ value: string;
5
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
6
+ }) => React.JSX.Element;
7
+ export default LabelFilterInput;
@@ -0,0 +1,49 @@
1
+ import React, { Component } from 'react';
2
+ import { IEntityDetail } from '@/types/tool';
3
+ export declare const highlightKeyword: (str: string, keyword: string, color: string) => string | React.JSX.Element;
4
+ interface ILabelInfo {
5
+ key: string;
6
+ value: string;
7
+ subSelected?: IFilteredLabelInfo[];
8
+ hasShow?: boolean;
9
+ isMulti?: boolean;
10
+ show?: boolean;
11
+ showLabel: string | React.ReactElement;
12
+ }
13
+ interface IFilteredLabelInfo extends ILabelInfo {
14
+ show: boolean;
15
+ showLabel: string | React.ReactElement;
16
+ }
17
+ interface IState {
18
+ hoverDeleteIndex: number;
19
+ expandKeyList: string[];
20
+ inputValue: string;
21
+ }
22
+ interface IProps {
23
+ labelInfoSet: ILabelInfo[];
24
+ labelSelectedList: number[];
25
+ setLabel: (i: number, j: number) => void;
26
+ tagResult: {};
27
+ clearResult: (a: string) => void;
28
+ imgIndex?: number;
29
+ graphIndex?: number;
30
+ isEdit: boolean;
31
+ entityMap?: Map<string, IEntityDetail>;
32
+ dynamicTag?: boolean;
33
+ withPanelTab?: boolean;
34
+ }
35
+ export default class LabelSidebar extends Component<IProps, IState> {
36
+ private sideBar;
37
+ constructor(props: IProps);
38
+ updateScrollTop: (childIndex: number) => void;
39
+ shouldComponentUpdate(newProps: any, newState: IState): boolean;
40
+ /**
41
+ * 设置展开操作
42
+ *
43
+ * @memberof LabelSidebar
44
+ */
45
+ setExpendKeyList: (expandKeyList: string[], index: number, value: string, expend?: boolean) => void;
46
+ setInputValue: (e: React.ChangeEvent<HTMLInputElement>) => void;
47
+ render(): React.JSX.Element;
48
+ }
49
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { AppProps } from '@/App';
3
+ import { IA2MapStateProps } from '@/store/annotation/map';
4
+ interface IProps extends IA2MapStateProps {
5
+ path: string;
6
+ loading: boolean;
7
+ audioContext?: any;
8
+ }
9
+ declare const _default: import("react-redux").ConnectedComponent<React.FC<AppProps & IProps>, import("react-redux").Omit<AppProps & IProps & {
10
+ children?: React.ReactNode;
11
+ }, "imgIndex" | "imgList" | "config" | "highlightAttribute" | "loadPCDFileLoading" | "currentData" | "stepInfo" | "configString">>;
12
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const TagResultShow: (props: any) => React.JSX.Element | null;
3
+ export default TagResultShow;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { IAudioTimeSlice, ITextConfigItem } from '@labelbee/lb-utils';
3
+ import { IInputList } from '@/types/main';
4
+ interface IClearIcon {
5
+ onClick: () => void;
6
+ title: string;
7
+ disabled?: boolean;
8
+ }
9
+ export declare const ClearIcon: ({ onClick, title, disabled }: IClearIcon) => React.JSX.Element;
10
+ interface IProps {
11
+ /** 显示的文本 */
12
+ text?: string;
13
+ /** 是否显示文本 */
14
+ showText?: boolean;
15
+ /** 更新文本的方法 */
16
+ updateText?: (text: string, key: string) => void;
17
+ /** 切换文本是否显示 */
18
+ toggleShowText?: (isShow: boolean) => void;
19
+ /** 文本框是否被禁用 */
20
+ textInputDisabled: boolean;
21
+ /** 文本ID */
22
+ textID: boolean;
23
+ /** 是否使用自动聚焦 */
24
+ autofocus: boolean;
25
+ toolName?: string;
26
+ /** 显示OCR开关 */
27
+ showOcrSwitch?: boolean;
28
+ configList: ITextConfigItem[];
29
+ result: any;
30
+ config?: any;
31
+ /** 预标注前后文 */
32
+ preContext: any;
33
+ /** 是否是查看模式 */
34
+ isCheck: boolean;
35
+ /** 是否开启文本标注 除了音频其余工具不会传这个参数 所以默认值是true */
36
+ textConfigurable?: boolean;
37
+ /** 是否开启截取文本标注 */
38
+ clipTextConfigurable?: boolean;
39
+ /** 是否开启截取属性标注 */
40
+ clipAttributeConfigurable?: boolean;
41
+ /** 截取片段 */
42
+ regions?: IAudioTimeSlice[];
43
+ /** 截取属性列表 */
44
+ clipAttributeList?: IInputList[];
45
+ /** 更新截取片段数据 */
46
+ updateRegion?: (region: IAudioTimeSlice) => void;
47
+ isEdit?: boolean;
48
+ }
49
+ export declare const SingleTextInput: (props: any) => React.JSX.Element;
50
+ /** 文本工具的文本框和对照按钮 */
51
+ declare const TextInput: (props: IProps) => React.JSX.Element;
52
+ export default TextInput;
@@ -0,0 +1 @@
1
+ export declare const getWebPcm2WavBase64: (url: string) => Promise<string>;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { IAudioTimeSlice } from '@labelbee/lb-utils';
3
+ interface IProps {
4
+ /** 挂载到目标元素 */
5
+ el: Element;
6
+ /** 截取片段数据 */
7
+ region: IAudioTimeSlice;
8
+ /** 是否正在截取 */
9
+ clipping: boolean;
10
+ /** 边缘吸附对象 */
11
+ edgeAdsorption: {
12
+ start?: number;
13
+ end?: number;
14
+ };
15
+ /** 音频的缩放 */
16
+ zoom: number;
17
+ /** WaveSurfer region 实例 */
18
+ instance?: any;
19
+ }
20
+ /** 展示在音频图上的截取片段 */
21
+ declare const ClipRegion: (props: IProps) => React.JSX.Element;
22
+ export default ClipRegion;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @file 音频截取时,初始点的时间点显示
3
+ * @author lihuaqi <lihuaqi@sensetime.com>
4
+ * @date 2022年11月1日
5
+ */
6
+ import React from 'react';
7
+ import { IAudioTimeSlice } from '@labelbee/lb-utils';
8
+ interface IProps {
9
+ /** 通过id返回region实例、需要注意可以返回undefined */
10
+ getRegionInstanceById: (id: string) => IAudioTimeSlice;
11
+ /** 是否正在截取 */
12
+ clipping: boolean;
13
+ }
14
+ declare const ClipTip: (props: IProps) => React.JSX.Element | null;
15
+ export default ClipTip;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @file 按下合并按钮后出现的提示
3
+ * @author lihuaqi <lihuaqi@sensetime.com>
4
+ * @date 2022年11月1日
5
+ */
6
+ import React from 'react';
7
+ interface IProps {
8
+ /** 展示的容器 */
9
+ container: Element | null;
10
+ }
11
+ declare const CombineTip: (props: IProps) => React.JSX.Element | null;
12
+ export default CombineTip;
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { IAudioTimeSlice } from '@labelbee/lb-utils';
3
+ import { ISelectedRegion } from '@/components/audioAnnotate/audioContext';
4
+ import { IInputList, RenderFooter } from '@/types/main';
5
+ export interface ISetSelectedRegionParams extends ISelectedRegion {
6
+ /** 是否立即播放截取片段 */
7
+ playImmediately?: boolean;
8
+ }
9
+ interface IAudioPlayerContext {
10
+ count?: number;
11
+ isEdit: boolean;
12
+ toolName: string;
13
+ imgIndex: number;
14
+ }
15
+ export declare const AudioPlayerContext: React.Context<IAudioPlayerContext>;
16
+ export declare const AudioPlayer: ({ fileData, onLoaded, context, invalid, height, hideError, onError, updateRegion, removeRegion, regions, activeToolPanel, clipConfigurable, clipTextConfigurable, clipAttributeList, clipAttributeConfigurable, isCheck, hoverRegionId, footer, drawLayerSlot, }: {
17
+ fileData: any;
18
+ height?: number | undefined;
19
+ invalid: boolean;
20
+ onLoaded?: any;
21
+ onError?: (() => void) | undefined;
22
+ context?: IAudioPlayerContext | undefined;
23
+ hideError?: boolean | undefined;
24
+ /** 截取片段数据:regions变化不会触发更新 */
25
+ regions?: IAudioTimeSlice[] | undefined;
26
+ /** 更新截取片段,如果传入的id不存在,会新建一个数据 */
27
+ updateRegion?: ((region: IAudioTimeSlice) => void) | undefined;
28
+ /** 根据id删除截取数据 */
29
+ removeRegion?: ((id: string) => void) | undefined;
30
+ /** 当前使用的工具panel,用于判断是否展示批注层 */
31
+ activeToolPanel?: string | undefined;
32
+ clipConfigurable: boolean;
33
+ clipTextConfigurable: boolean;
34
+ clipAttributeConfigurable: boolean;
35
+ clipAttributeList: IInputList[];
36
+ /** 是否是查看模式:查看模式需要禁用截取的新建、调整功能 */
37
+ isCheck?: boolean | undefined;
38
+ /** 查看模式用到的hoverId */
39
+ hoverRegionId?: string | undefined;
40
+ footer?: RenderFooter | undefined;
41
+ drawLayerSlot?: any;
42
+ }) => React.JSX.Element;
43
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ EventBus: any;
4
+ }
5
+ declare const LabelDisplayToggle: (props: IProps) => React.JSX.Element;
6
+ export default LabelDisplayToggle;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ playPercentage: string;
4
+ }
5
+ declare const ProgressDot: (props: IProps) => React.JSX.Element;
6
+ export default ProgressDot;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @file 音频分割时的时间点显示
3
+ * @author lihuaqi <lihuaqi@sensetime.com>
4
+ * @date 2022年11月1日
5
+ */
6
+ import React from 'react';
7
+ interface IProps {
8
+ /** 分割点时间提示 */
9
+ segmentTimeTip: any;
10
+ }
11
+ declare const SegmentTip: (props: IProps) => React.JSX.Element | null;
12
+ export default SegmentTip;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @file 音频合并功能
3
+ * @author lihuaqi <lihuaqi@sensetime.com>
4
+ * @date 2022年11月16日
5
+ */
6
+ import { IAudioTimeSlice } from '@labelbee/lb-utils';
7
+ import { ISetSelectedRegionParams } from '..';
8
+ interface IProps {
9
+ /** WaveSurfer */
10
+ waveRef: any;
11
+ sortByStartRegions: IAudioTimeSlice[];
12
+ regionMap: {
13
+ [key: string]: IAudioTimeSlice;
14
+ };
15
+ /** 更新截取片段,如果传入的id不存在,会新建一个数据 */
16
+ updateRegion?: (region: IAudioTimeSlice) => void;
17
+ /** 根据id删除截取数据 */
18
+ removeRegion?: (id: string) => void;
19
+ generateRegions: () => void;
20
+ /**
21
+ * 选中片段:没有id则selectedRegion为空,selectedAttribute需要保留,playImmediately立刻播放片段
22
+ * @param {ISetSelectedRegionParams}
23
+ */
24
+ setSelectedRegion: (params: ISetSelectedRegionParams) => void;
25
+ }
26
+ /** 音频区间合并功能 */
27
+ declare const useAudioCombine: (props: IProps) => {
28
+ combineInstance: (this: any, instance: any) => void;
29
+ };
30
+ export default useAudioCombine;
@@ -0,0 +1,17 @@
1
+ interface IProps {
2
+ /** 提供滚动条的元素 */
3
+ container: Element | null;
4
+ /** 可移动、拖拽的元素 */
5
+ target: Element | null;
6
+ /** 移动到边缘的缓冲宽度 */
7
+ bufferWidth?: number;
8
+ /** 是否正在调整 */
9
+ clipping: boolean;
10
+ /** 音频的缩放 */
11
+ zoom: number;
12
+ /** 音频缩放时调用的方法 */
13
+ zoomHandler: (val: number) => void;
14
+ }
15
+ /** 音频截取片段拖到边缘时,需向边缘的方向匀速滚动 */
16
+ declare const useAudioScroll: (props: IProps) => void;
17
+ export default useAudioScroll;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @file 音频分割功能
3
+ * @author lihuaqi <lihuaqi@sensetime.com>
4
+ * @date 2022年11月16日
5
+ */
6
+ import { ISetSelectedRegionParams } from '..';
7
+ import { IAudioTimeSlice } from '@labelbee/lb-utils';
8
+ interface IProps {
9
+ /** WaveSurfer */
10
+ waveRef: any;
11
+ regionMap: {
12
+ [key: string]: IAudioTimeSlice;
13
+ };
14
+ /** 更新截取片段,如果传入的id不存在,会新建一个数据 */
15
+ updateRegion?: (region: IAudioTimeSlice) => void;
16
+ /** 根据id删除截取数据 */
17
+ removeRegion?: (id: string) => void;
18
+ generateRegions: () => void;
19
+ /**
20
+ * 选中片段:没有id则selectedRegion为空,selectedAttribute需要保留,playImmediately立刻播放片段
21
+ * @param {ISetSelectedRegionParams}
22
+ */
23
+ setSelectedRegion: (params: ISetSelectedRegionParams) => void;
24
+ }
25
+ /** 音频区间分割功能 */
26
+ declare const useAudioSegment: (props: IProps) => {
27
+ segmentInstance: (this: any, instance: any, time: any) => void;
28
+ onRegionMouseMove: (this: any, instance: any, e: any) => void;
29
+ segmentTimeTip: number | null;
30
+ };
31
+ export default useAudioSegment;
@@ -0,0 +1,12 @@
1
+ import { ISetSelectedRegionParams } from '..';
2
+ import { IAudioTimeSlice } from '@labelbee/lb-utils';
3
+ interface IProps {
4
+ sortByStartRegions?: IAudioTimeSlice[];
5
+ /**
6
+ * 选中片段:没有id则selectedRegion为空,selectedAttribute需要保留,playImmediately立刻播放片段
7
+ * @param {ISetSelectedRegionParams}
8
+ */
9
+ setSelectedRegion: (params: ISetSelectedRegionParams) => void;
10
+ }
11
+ declare const useSwitchHotkey: (props: IProps) => void;
12
+ export default useSwitchHotkey;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export declare const audioZoomInfo: {
3
+ min: number;
4
+ max: number;
5
+ ratio: number;
6
+ };
7
+ interface IZoomSliderProps {
8
+ /** 缩放时调用的方法,需要在外部控制最大值和最小值 */
9
+ onChange: (val: number) => void;
10
+ zoom: number;
11
+ }
12
+ declare const ZoomSlider: (props: IZoomSliderProps) => React.JSX.Element;
13
+ export default ZoomSlider;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ width?: number;
4
+ height?: number;
5
+ reloadImage: () => void;
6
+ hideSetInvalidTips?: boolean;
7
+ /** 忽略顶部的偏移,如: 多边形的容器已经计算好高度(容器不包含顶部标注提示语部分) */
8
+ ignoreOffsetY?: boolean;
9
+ layerStyle?: React.CSSProperties;
10
+ backgroundColor?: string;
11
+ fileTypeName?: string;
12
+ }
13
+ declare const ImageError: (props: IProps) => React.JSX.Element;
14
+ export default ImageError;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ width?: number;
4
+ height?: number;
5
+ isVideo?: boolean;
6
+ isAudio?: boolean;
7
+ }
8
+ declare const InvalidPage: (props: IProps) => React.JSX.Element;
9
+ export default InvalidPage;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export declare const VIDEO_PLAYBACK_RATE_SPEED: number[];
3
+ export declare const AUDIO_PLAYBACK_RATE_SPEED: number[];
4
+ export declare enum EPlayerType {
5
+ Video = 0,
6
+ Audio = 1
7
+ }
8
+ export declare const PLAYER_TYPE_RATE_SPEED: {
9
+ [key in number]: number[];
10
+ };
11
+ interface IProps {
12
+ onChange: (rate: number) => void;
13
+ playerType: number;
14
+ }
15
+ declare const SpeedController: (props: IProps) => React.JSX.Element;
16
+ export default SpeedController;
@@ -1,3 +1,14 @@
1
1
  import React from 'react';
2
+ /**
3
+ * Format video time to display
4
+ * Such as 61.9 => 01:01:9
5
+ * @param {Number} time
6
+ * @returns {String} displayTime (min:sec:mircoSec)
7
+ */
8
+ export declare const videoTimeFormat: (time: number) => string;
9
+ export declare enum EPlayerType {
10
+ Video = 0,
11
+ Audio = 1
12
+ }
2
13
  declare const VideoController: () => React.JSX.Element;
3
14
  export default VideoController;
@@ -22,6 +22,13 @@ export default class StepUtils {
22
22
  * @returns {Number} 是否为视频工具
23
23
  */
24
24
  static currentToolIsVideo(step: number, stepList: IStepInfo[]): boolean;
25
+ /**
26
+ * 根据toolName判断当前步骤是否为音频工具
27
+ * @param step 步骤
28
+ * @param stepList 步骤列表
29
+ * @returns {Number} 是否为音频工具
30
+ */
31
+ static currentToolIsAudio(step: number, stepList: IStepInfo[]): boolean;
25
32
  /**
26
33
  * Check for PointCloud
27
34
  * @param step
@@ -10,6 +10,7 @@ interface IPoint {
10
10
  }
11
11
  declare class ToolUtils {
12
12
  static isVideoTool(tool?: string): boolean;
13
+ static isAudioTool(tool?: string): boolean;
13
14
  static isPointCloudTool(tool?: string): boolean;
14
15
  static getPointCloudToolList(): cTool.EToolName[];
15
16
  static getPointToLineDistance(pt: IPoint, // A point outside the straight line