@labelbee/lb-components 1.24.0-alpha.5 → 1.24.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/2DViewWorker.js +1 -1
- package/dist/assets/annotation/rectTool/three_points_rect.svg.js +1 -0
- package/dist/assets/annotation/rectTool/two_points_rect.svg.js +1 -0
- package/dist/components/DynamicResizer/DynamicResizer.js +1 -1
- package/dist/components/DynamicResizer/hooks/useDrag.js +1 -1
- package/dist/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
- package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
- package/dist/components/DynamicResizer/utils/index.js +1 -0
- package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -1
- package/dist/components/LLMMultiWheelView/index.js +1 -1
- package/dist/components/LLMMultiWheelView/sidebar/index.js +1 -1
- package/dist/components/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/modelAPIView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/audioView/index.js +1 -0
- package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/dist/components/LLMToolView/questionView/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/attributeList/index.js +1 -1
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/longText/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/components/TitleButton/index.js +1 -1
- package/dist/components/pointCloudView/components/UnifyParamsModal/index.js +1 -1
- package/dist/components/pointCloudView/components/sideAndBackOverView/index.js +1 -1
- package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudAttribute.js +1 -0
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/tagList/index.js +1 -1
- package/dist/components/videoPlayer/components/SpeedController/index.js +1 -1
- package/dist/components/videoPlayer/index.js +1 -1
- package/dist/constant/index.js +1 -1
- package/dist/index.css +112 -90
- package/dist/store/Actions.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/store/toolConfig/pointCloudToolConfig.js +1 -1
- package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +3 -3
- package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +24 -7
- package/dist/types/components/DynamicResizer/hooks/useDraggingAllowed.d.ts +12 -0
- package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +10 -21
- package/dist/types/components/DynamicResizer/types/interface.d.ts +14 -6
- package/dist/types/components/DynamicResizer/utils/index.d.ts +4 -0
- package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +2 -0
- package/dist/types/components/LLMMultiWheelView/index.d.ts +2 -0
- package/dist/types/components/LLMToolView/questionView/components/audioView/index.d.ts +8 -0
- package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +3 -1
- package/dist/types/components/attributeList/components/limitPopover/index.d.ts +2 -2
- package/dist/types/components/longText/index.d.ts +1 -1
- package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +0 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +4 -0
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -0
- package/dist/types/components/pointCloudView/hooks/usePointCloudAttribute.d.ts +3 -0
- package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +1 -2
- package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +1 -2
- package/dist/types/components/pointCloudView/index.d.ts +2 -0
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +1 -1
- package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/components/videoAnnotate/videoTextTool/index.d.ts +1 -1
- package/dist/types/components/videoPlayer/index.d.ts +1 -1
- package/dist/types/constant/index.d.ts +4 -2
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/annotation/actionCreators.d.ts +9 -1
- package/dist/types/store/annotation/map.d.ts +1 -0
- package/dist/types/store/annotation/reducer.d.ts +5 -1
- package/dist/types/store/annotation/types.d.ts +4 -2
- package/dist/types/store/toolConfig/types.d.ts +2 -0
- package/dist/types/utils/LLM.d.ts +6 -0
- package/dist/types/views/MainView/index.d.ts +2 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +9 -0
- package/dist/types/views/MainView/sidebar/index.d.ts +2 -0
- package/dist/utils/LLM.js +1 -0
- package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -1
- package/dist/views/MainView/LLMMultiWheelLayout/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/ToolIcons.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/es/_virtual/2DViewWorker.js +1 -1
- package/es/assets/annotation/rectTool/three_points_rect.svg.js +1 -0
- package/es/assets/annotation/rectTool/two_points_rect.svg.js +1 -0
- package/es/components/DynamicResizer/DynamicResizer.js +1 -1
- package/es/components/DynamicResizer/hooks/useDrag.js +1 -1
- package/es/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
- package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
- package/es/components/DynamicResizer/utils/index.js +1 -0
- package/es/components/LLMMultiWheelView/dialogView/index.js +1 -1
- package/es/components/LLMMultiWheelView/index.js +1 -1
- package/es/components/LLMMultiWheelView/sidebar/index.js +1 -1
- package/es/components/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/modelAPIView/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/audioView/index.js +1 -0
- package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/es/components/LLMToolView/questionView/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/attributeList/index.js +1 -1
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/longText/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/components/TitleButton/index.js +1 -1
- package/es/components/pointCloudView/components/UnifyParamsModal/index.js +1 -1
- package/es/components/pointCloudView/components/sideAndBackOverView/index.js +1 -1
- package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudAttribute.js +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/tagList/index.js +1 -1
- package/es/components/videoPlayer/components/SpeedController/index.js +1 -1
- package/es/components/videoPlayer/index.js +1 -1
- package/es/constant/index.js +1 -1
- package/es/index.css +112 -90
- package/es/store/Actions.js +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/toolConfig/pointCloudToolConfig.js +1 -1
- package/es/utils/LLM.js +1 -0
- package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -1
- package/es/views/MainView/LLMMultiWheelLayout/index.js +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/ToolIcons.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/package.json +8 -8
- package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
- package/dist/components/DynamicResizer/assets/divider.svg.js +0 -1
- package/dist/components/DynamicResizer/assets/topToZero.svg.js +0 -1
- package/es/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
- package/es/components/DynamicResizer/assets/divider.svg.js +0 -1
- package/es/components/DynamicResizer/assets/topToZero.svg.js +0 -1
|
@@ -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,l)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,__spreadValues=(e,t)=>{for(var l in t||(t={}))__hasOwnProp.call(t,l)&&__defNormalProp(e,l,t[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(t))__propIsEnum.call(t,l)&&__defNormalProp(e,l,t[l]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,l)=>new Promise((g,u)=>{var S=I=>{try{O(l.next(I))}catch(m){u(m)}},p=I=>{try{O(l.throw(I))}catch(m){u(m)}},O=I=>I.done?g(I.value):Promise.resolve(I.value).then(S,p);O((l=l.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(l=>l.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:l}=e;return Math.ceil(t.length/l)},calcStepProgress=(e,t)=>e.reduce((l,g)=>{if(g){const u=g.result;if(index.jsonParser(u)[`step_${t}`])return l+1}return l},0)/e.length,updateToolInstance=(e,t)=>{const{step:l,stepList:g}=e,u=StepUtils.getCurrentStepInfo(l,g),S=ConfigUtils.ConfigUtils.jsonParser(u.config);if(ToolUtils.isVideoTool(u==null?void 0:u.tool)||ToolUtils.isAudioTool(u==null?void 0:u.tool)||ToolUtils.isPointCloudTool(u==null?void 0:u.tool)||[ToolType.EToolName.LLM,ToolType.EToolName.NLP,ToolType.EToolName.LLMMultiWheel].includes(u==null?void 0:u.tool))return;const p=document.getElementById("toolContainer");if(!p)throw"Not exist dom named id-toolContainer";const O=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:p,toolName:u.tool,size:O,imgNode:t,config:S,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(l,g)=>__async(void 0,null,function*(){var u,S;const{stepList:p,step:O}=g().annotation,I=StepUtils.currentToolIsVideo(O,p),m=StepUtils.currentToolIsPointCloud(O,p),D=[ToolType.EToolName.LLM,ToolType.EToolName.LLMMultiWheel].includes((u=StepUtils.getCurrentStepInfo(O,p))==null?void 0:u.tool),y=((S=StepUtils.getCurrentStepInfo(O,p))==null?void 0:S.tool)===ToolType.EToolName.NLP,P=StepUtils.currentToolIsAudio(O,p);if(actionCreators.SetAnnotationLoading(l,!0),yield l(TryGetFileDataByAPI(e)),I){l(AfterVideoLoaded(e));return}if(m||D||P||y){l(AfterCommonLoaded(e));return}l(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,l)=>__async(void 0,null,function*(){const{getFileData:g,imgList:u}=l().annotation;if(g){const S=yield g(u[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:S,index:e}})}}),AfterVideoLoaded=e=>t=>{t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterCommonLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(l,g)=>{var u;const{toolInstance:S,imgList:p}=g().annotation,O=(u=p==null?void 0:p[e])==null?void 0:u.url;lbAnnotation.ImgUtils.load(O).then(I=>{actionCreators.SetAnnotationLoading(l,!1),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(l,!1),S==null||S.setErrorImg(),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:l,stepList:g,step:u=1})=>{var S,p,O,I;const m=((S=t[l])==null?void 0:S.result)||"",[D,y,P]=(p=e==null?void 0:e.exportData())!=null?p:[],x=(I=(O=e==null?void 0:e.exportCustomData)==null?void 0:O.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(m,y),w=data.composeResult(B,{step:u,stepList:g},{rect:D},x);return t.map((b,F)=>F===l?__spreadValues(__spreadProps(__spreadValues({},b),{result:w}),P):__spreadValues({},b))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var l,g,u,S,p,O,I,m,D,y,P,x,B,w,b,F,G,V,q,k,H,z,W,K,$,X,Y,J;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,s=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:s})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:s,stepList:i,toolInstance:a,onSubmit:r,resultList:A}=e;if(!a||!n[o])return e;const T=((l=n[o])==null?void 0:l.result)||"",[,d,c]=(g=a==null?void 0:a.exportData())!=null?g:[],N=(S=(u=a==null?void 0:a.exportCustomData)==null?void 0:u.call(a))!=null?S:{},f=data.composeResultWithBasicImgInfo(T,d),L=data.composeResult(f,{step:s,stepList:i},{rect:A},N),C=e.imgList.map((v,E)=>{if(E===o){const U=AnnotationDataUtils.dataCorrection(L,T,s,i);return __spreadValues(__spreadProps(__spreadValues({},v),{result:U}),c)}return v});if(((p=t.payload)==null?void 0:p.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:C});const R=calcStepProgress(C,s);return __spreadProps(__spreadValues({},e),{stepProgress:R,imgList:C})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:s}=e;return s==null||s(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:s,toolInstance:i,basicResultList:a}=e;if(!i)return e;const[r]=(O=i==null?void 0:i.exportData())!=null?O:[];let A=r;if((a==null?void 0:a.length)>0){const T=(I=a[o])==null?void 0:I.id,d=r.map(c=>__spreadProps(__spreadValues({},c),{sourceID:T}));A=___default.default.cloneDeep(s).filter(c=>c.sourceID!==T),A.push(...d)}return __spreadProps(__spreadValues({},e),{resultList:A,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:s,imgIndex:i,stepList:a,annotationEngine:r,resultList:A,basicResultList:T}=e;if(!n||!r)return e;const d=t.payload.basicIndex,c=(m=T[d])==null?void 0:m.id,N=index.jsonParser((D=s[i])==null?void 0:D.result),f=(A||[]).filter(U=>U.sourceID===c),L=getStepConfig(a,o),{dataSourceStep:C,tool:R}=L,v=getStepConfig(a,C);let E=[];return C&&R&&(E=(y=N[`step_${C}`])==null?void 0:y.result,(E==null?void 0:E.length)>0?(r==null||r.setBasicInfo(v.tool,E[d]),r==null||r.launchOperation()):(r==null||r.setBasicInfo(v.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:d})}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:s,annotationEngine:i,stepList:a}=e;if(!s)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const r=StepUtils.getCurrentStepInfo(o,a),{nextIndex:A,imgNode:T,nextBasicIndex:d,imgError:c}=t.payload,N=d!=null?d:0,f=index.jsonParser((P=n[A])==null?void 0:P.result),L=f[`step_${r.step}`],C=!L,R={rotate:(x=f.rotate)!=null?x:0,valid:(B=f.valid)!=null?B:!0};T&&c!==!0?i==null||i.setImgNode(T,R):s==null||s.setValid(R.valid);const v=getStepConfig(a,r.step),{dataSourceStep:E,tool:U}=v,Z=getStepConfig(a,E),M=E&&U,h=(b=(w=f[`step_${E}`])==null?void 0:w.result)!=null?b:[],j=AnnotationDataUtils.getInitialResultList(L==null?void 0:L.result,s,v,h,C);if(i==null||i.launchOperation(),M&&((h==null?void 0:h.length)>0?i==null||i.setBasicInfo(Z.tool,h[N]):(i==null||i.setBasicInfo(Z.tool),i==null||i.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),r.tool!=="check"&&M){const Q=(G=(F=h[N])==null?void 0:F.id)!=null?G:"",ee=M?j.filter(te=>lbAnnotation.CommonToolUtils.isSameSourceID(te.sourceID,Q)):j;(V=s==null?void 0:s.history)==null||V.initRecord(j,!0),s==null||s.setResult(ee)}return __spreadProps(__spreadValues({},e),{imgIndex:A,basicIndex:N,basicResultList:h,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});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:s,annotationEngine:i}=o;return __spreadProps(__spreadValues({},e),{toolInstance:s,annotationEngine:i})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(k=t.payload)==null?void 0:k.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.UPDATE_IMG_INDEX_BY_EXTERNAL:return __spreadProps(__spreadValues({},e),{getImgIndexByExternal:t.payload.getImgIndexByExternal});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:s}=e,i=[...s];return i[o]=__spreadValues(__spreadValues({},i[o]),n),__spreadProps(__spreadValues({},e),{imgList:i})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||(H=n==null?void 0:n.updateRotate)==null||H.call(n),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(z=n==null?void 0:n.valid)!=null?z:!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:s,step:i,stepList:a}=e;if(!n)return e;if(o===0||o>=s.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const r=s[o-1].result;if(!r)return e;const A=StepUtils.getCurrentStepInfo(i,a),T=(W=A==null?void 0:A.step)!=null?W:i,d=(K=n==null?void 0:n.valid)!=null?K:!0,c=AnnotationDataUtils.copyResultChange({copyResult:r,step:T,currentResult:($=s[o].result)!=null?$:"",preMappingImgList:(X=s[o-1].mappingImgList)!=null?X:[],mappingImgList:(Y=s[o].mappingImgList)!=null?Y:[],valid:d});s[o]=__spreadProps(__spreadValues({},s[o]),{result:c});const f=index.jsonParser(c)[`step_${i}`],L=(f==null?void 0:f.result)||[];return n==null||n.setResult(L),n==null||n.history.pushHistory(L),(J=n==null?void 0:n.asyncData)==null||J.call(n,s[o]),__spreadProps(__spreadValues({},e),{imgList:[...s]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:s}=t.payload;if(o){const i=getStepConfig(n,s);return o==null||o.setToolName(i.tool,i.config),__spreadProps(__spreadValues({},e),{step:s,toolInstance:o==null?void 0:o.toolInstance})}return __spreadProps(__spreadValues({},e),{step:s})}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:s,imgList:i}=t.payload,{imgIndex:a,onSubmit:r}=e,A=[],T=i.map((d,c)=>{if(lbAnnotation.MathUtils.isInRange(c,s)){const N=__spreadProps(__spreadValues({},d),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:d.result})});return A.push({imgIndex:c,newInfo:N}),N}return d});return r&&r([T[a]],index$1.ESubmitType.BatchUpdateTrackID,a,T,{updateImgList:A}),__spreadProps(__spreadValues({},e),{imgList:T})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:s}=t.payload,{imgList:i,imgIndex:a,onSubmit:r}=e,A=[],T=i.map((d,c)=>{if(lbAnnotation.MathUtils.isInRange(c,s)){const N=__spreadProps(__spreadValues({},d),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:d.result})});return A.push({imgIndex:c,newInfo:N}),N}return d});return r&&r([T[a]],index$1.ESubmitType.BatchUpdateTrackID,a,T,{updateImgList:A}),__spreadProps(__spreadValues({},e),{imgList:T})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:s,step:i,predictionResult:a}=e,r={};a.forEach(c=>{const{index:N}=c;r[N]=___default.default.pick(c,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const A=`step_${i}`,T=[],d=o.map((c,N)=>{if(r[N]){const f=c.result==="{}"?index.jsonParser(data.composeResult("",{step:i,stepList:s},{rect:[]},{})):index.jsonParser(c.result);f[A].result.push(r[N]);const L=__spreadProps(__spreadValues({},c),{result:JSON.stringify(f)});return T.push({imgIndex:N,newInfo:L}),L}return c});return n==null||n(d,index$1.ESubmitType.BatchUpdateImgList,-1,d,{updateImgList:T}),__spreadProps(__spreadValues({},e),{imgList:d})}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,l)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,__spreadValues=(e,t)=>{for(var l in t||(t={}))__hasOwnProp.call(t,l)&&__defNormalProp(e,l,t[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(t))__propIsEnum.call(t,l)&&__defNormalProp(e,l,t[l]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,l)=>new Promise((g,u)=>{var S=A=>{try{O(l.next(A))}catch(m){u(m)}},p=A=>{try{O(l.throw(A))}catch(m){u(m)}},O=A=>A.done?g(A.value):Promise.resolve(A.value).then(S,p);O((l=l.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(l=>l.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:"",confirmPageTurning:!1},getTotalPage=e=>{const{imgList:t,imgPageSize:l}=e;return Math.ceil(t.length/l)},calcStepProgress=(e,t)=>e.reduce((l,g)=>{if(g){const u=g.result;if(index.jsonParser(u)[`step_${t}`])return l+1}return l},0)/e.length,updateToolInstance=(e,t)=>{const{step:l,stepList:g}=e,u=StepUtils.getCurrentStepInfo(l,g),S=ConfigUtils.ConfigUtils.jsonParser(u.config);if(ToolUtils.isVideoTool(u==null?void 0:u.tool)||ToolUtils.isAudioTool(u==null?void 0:u.tool)||ToolUtils.isPointCloudTool(u==null?void 0:u.tool)||[ToolType.EToolName.LLM,ToolType.EToolName.NLP,ToolType.EToolName.LLMMultiWheel].includes(u==null?void 0:u.tool))return;const p=document.getElementById("toolContainer");if(!p)throw"Not exist dom named id-toolContainer";const O=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),A=new lbAnnotation.AnnotationEngine({container:p,toolName:u.tool,size:O,imgNode:t,config:S,style:JSON.parse(styleString)});return{toolInstance:A==null?void 0:A.toolInstance,annotationEngine:A}},LoadFileAndFileData=(e,t)=>(l,g)=>__async(void 0,null,function*(){var u,S;const{stepList:p,step:O}=g().annotation,A=StepUtils.currentToolIsVideo(O,p),m=StepUtils.currentToolIsPointCloud(O,p),D=[ToolType.EToolName.LLM,ToolType.EToolName.LLMMultiWheel].includes((u=StepUtils.getCurrentStepInfo(O,p))==null?void 0:u.tool),y=((S=StepUtils.getCurrentStepInfo(O,p))==null?void 0:S.tool)===ToolType.EToolName.NLP,P=StepUtils.currentToolIsAudio(O,p);if(actionCreators.SetAnnotationLoading(l,!0),yield l(TryGetFileDataByAPI(e)),A){l(AfterVideoLoaded(e));return}if(m||D||P||y){l(AfterCommonLoaded(e));return}l(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,l)=>__async(void 0,null,function*(){const{getFileData:g,imgList:u}=l().annotation;if(g){const S=yield g(u[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:S,index:e}})}}),AfterVideoLoaded=e=>t=>{t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterCommonLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(l,g)=>{var u;const{toolInstance:S,imgList:p}=g().annotation,O=(u=p==null?void 0:p[e])==null?void 0:u.url;lbAnnotation.ImgUtils.load(O).then(A=>{actionCreators.SetAnnotationLoading(l,!1),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:A,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(l,!1),S==null||S.setErrorImg(),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:l,stepList:g,step:u=1})=>{var S,p,O,A;const m=((S=t[l])==null?void 0:S.result)||"",[D,y,P]=(p=e==null?void 0:e.exportData())!=null?p:[],x=(A=(O=e==null?void 0:e.exportCustomData)==null?void 0:O.call(e))!=null?A:{},B=data.composeResultWithBasicImgInfo(m,y),w=data.composeResult(B,{step:u,stepList:g},{rect:D},x);return t.map((U,F)=>F===l?__spreadValues(__spreadProps(__spreadValues({},U),{result:w}),P):__spreadValues({},U))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var l,g,u,S,p,O,A,m,D,y,P,x,B,w,U,F,G,V,q,k,H,z,K,W,$,X,Y,J,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,s=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:s})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:s,stepList:i,toolInstance:a,onSubmit:r,resultList:I}=e;if(!a||!n[o])return e;const T=((l=n[o])==null?void 0:l.result)||"",[,d,c]=(g=a==null?void 0:a.exportData())!=null?g:[],N=(S=(u=a==null?void 0:a.exportCustomData)==null?void 0:u.call(a))!=null?S:{},f=data.composeResultWithBasicImgInfo(T,d),L=data.composeResult(f,{step:s,stepList:i},{rect:I},N),E=e.imgList.map((v,C)=>{if(C===o){const h=AnnotationDataUtils.dataCorrection(L,T,s,i);return __spreadValues(__spreadProps(__spreadValues({},v),{result:h}),c)}return v});if(((p=t.payload)==null?void 0:p.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:E});const R=calcStepProgress(E,s);return __spreadProps(__spreadValues({},e),{stepProgress:R,imgList:E})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:s}=e;return s==null||s(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:s,toolInstance:i,basicResultList:a}=e;if(!i)return e;const[r]=(O=i==null?void 0:i.exportData())!=null?O:[];let I=r;if((a==null?void 0:a.length)>0){const T=(A=a[o])==null?void 0:A.id,d=r.map(c=>__spreadProps(__spreadValues({},c),{sourceID:T}));I=___default.default.cloneDeep(s).filter(c=>c.sourceID!==T),I.push(...d)}return __spreadProps(__spreadValues({},e),{resultList:I,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:s,imgIndex:i,stepList:a,annotationEngine:r,resultList:I,basicResultList:T}=e;if(!n||!r)return e;const d=t.payload.basicIndex,c=(m=T[d])==null?void 0:m.id,N=index.jsonParser((D=s[i])==null?void 0:D.result),f=(I||[]).filter(h=>h.sourceID===c),L=getStepConfig(a,o),{dataSourceStep:E,tool:R}=L,v=getStepConfig(a,E);let C=[];return E&&R&&(C=(y=N[`step_${E}`])==null?void 0:y.result,(C==null?void 0:C.length)>0?(r==null||r.setBasicInfo(v.tool,C[d]),r==null||r.launchOperation()):(r==null||r.setBasicInfo(v.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:d})}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:s,annotationEngine:i,stepList:a}=e;if(!s)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const r=StepUtils.getCurrentStepInfo(o,a),{nextIndex:I,imgNode:T,nextBasicIndex:d,imgError:c}=t.payload,N=d!=null?d:0,f=index.jsonParser((P=n[I])==null?void 0:P.result),L=f[`step_${r.step}`],E=!L,R={rotate:(x=f.rotate)!=null?x:0,valid:(B=f.valid)!=null?B:!0};T&&c!==!0?i==null||i.setImgNode(T,R):s==null||s.setValid(R.valid);const v=getStepConfig(a,r.step),{dataSourceStep:C,tool:h}=v,Q=getStepConfig(a,C),M=C&&h,b=(U=(w=f[`step_${C}`])==null?void 0:w.result)!=null?U:[],j=AnnotationDataUtils.getInitialResultList(L==null?void 0:L.result,s,v,b,E);i==null||i.launchOperation();const ee=[ToolType.EToolName.Cuboid,ToolType.EToolName.ScribbleTool].includes(h);if(M&&((b==null?void 0:b.length)>0?i==null||i.setBasicInfo(Q.tool,b[N]):(i==null||i.setBasicInfo(Q.tool),i==null||i.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),r.tool!=="check"&&(ee||M)){const te=(G=(F=b[N])==null?void 0:F.id)!=null?G:"",ne=M?j.filter(oe=>lbAnnotation.CommonToolUtils.isSameSourceID(oe.sourceID,te)):j;(V=s==null?void 0:s.history)==null||V.initRecord(j,!0),s==null||s.setResult(ne)}return __spreadProps(__spreadValues({},e),{imgIndex:I,basicIndex:N,basicResultList:b,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});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:s,annotationEngine:i}=o;return __spreadProps(__spreadValues({},e),{toolInstance:s,annotationEngine:i})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(k=t.payload)==null?void 0:k.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.UPDATE_IMG_INDEX_BY_EXTERNAL:return __spreadProps(__spreadValues({},e),{getImgIndexByExternal:t.payload.getImgIndexByExternal});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:s}=e,i=[...s];return i[o]=__spreadValues(__spreadValues({},i[o]),n),__spreadProps(__spreadValues({},e),{imgList:i})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||(H=n==null?void 0:n.updateRotate)==null||H.call(n),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(z=n==null?void 0:n.valid)!=null?z:!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:s,step:i,stepList:a}=e;if(!n)return e;if(o===0||o>=s.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const r=s[o-1].result;if(!r)return e;const I=StepUtils.getCurrentStepInfo(i,a),T=(K=I==null?void 0:I.step)!=null?K:i,d=(W=n==null?void 0:n.valid)!=null?W:!0,c=AnnotationDataUtils.copyResultChange({copyResult:r,step:T,currentResult:($=s[o].result)!=null?$:"",preMappingImgList:(X=s[o-1].mappingImgList)!=null?X:[],mappingImgList:(Y=s[o].mappingImgList)!=null?Y:[],valid:d});s[o]=__spreadProps(__spreadValues({},s[o]),{result:c});const f=index.jsonParser(c)[`step_${i}`],L=(f==null?void 0:f.result)||[];return n==null||n.setResult(L),n==null||n.history.pushHistory(L),(J=n==null?void 0:n.asyncData)==null||J.call(n,s[o]),__spreadProps(__spreadValues({},e),{imgList:[...s]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:s}=t.payload;if(o){const i=getStepConfig(n,s);return o==null||o.setToolName(i.tool,i.config),__spreadProps(__spreadValues({},e),{step:s,toolInstance:o==null?void 0:o.toolInstance})}return __spreadProps(__spreadValues({},e),{step:s})}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:s,imgList:i}=t.payload,{imgIndex:a,onSubmit:r}=e,I=[],T=i.map((d,c)=>{if(lbAnnotation.MathUtils.isInRange(c,s)){const N=__spreadProps(__spreadValues({},d),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:d.result})});return I.push({imgIndex:c,newInfo:N}),N}return d});return r&&r([T[a]],index$1.ESubmitType.BatchUpdateTrackID,a,T,{updateImgList:I}),__spreadProps(__spreadValues({},e),{imgList:T})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const n=t,{id:o,newData:s,rangeIndex:i,imgList:a}=n.payload,{imgIndex:r,onSubmit:I}=e,T=[],d=a.map((c,N)=>{if(lbAnnotation.MathUtils.isInRange(N,i)){const f=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:o,newData:s,result:c.result})});return T.push({imgIndex:N,newInfo:f}),f}return c});return I&&I([d[r]],index$1.ESubmitType.BatchUpdateTrackID,r,d,{updateImgList:T}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:s,step:i,predictionResult:a}=e,r={};a.forEach(c=>{const{index:N}=c;r[N]=___default.default.pick(c,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const I=`step_${i}`,T=[],d=o.map((c,N)=>{if(r[N]){const f=c.result==="{}"?index.jsonParser(data.composeResult("",{step:i,stepList:s},{rect:[]},{})):index.jsonParser(c.result);f[I].result.push(r[N]);const L=__spreadProps(__spreadValues({},c),{result:JSON.stringify(f)});return T.push({imgIndex:N,newInfo:L}),L}return c});return n==null||n(d,index$1.ESubmitType.BatchUpdateImgList,-1,d,{updateImgList:T}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.CHANGE_PAGE_CHECK:{const{toolInstance:n,step:o,stepList:s}=e;if(!n)return e;const[i]=(Z=n==null?void 0:n.exportData())!=null?Z:[],a=getStepConfig(s,o),r=ConfigUtils.ConfigUtils.jsonParser(a.config),I=i.some(T=>(T==null?void 0:T.result)&&Object.keys(T.result).length>0);return __spreadProps(__spreadValues({},e),{confirmPageTurning:r.showConfirm&&!I})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const pointCloudToolStateCreator=(
|
|
1
|
+
"use strict";const pointCloudToolStateCreator=(t,i)=>({selectBoxVisibleSwitch:!1,setSelectBoxVisibleSwitch:e=>t(()=>({selectBoxVisibleSwitch:e})),attrChangeTrigger:0,setAttrChangeTrigger:e=>t(()=>({attrChangeTrigger:e}))});module.exports=pointCloudToolStateCreator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import './DynamicResizer.scss';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import { DynamicResizerProps } from './types/interface';
|
|
4
|
-
|
|
3
|
+
import './styles.scss';
|
|
4
|
+
declare const DynamicResizer: React.FC<DynamicResizerProps>;
|
|
5
5
|
export default DynamicResizer;
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { DragProps } from '../types/interface';
|
|
3
|
-
declare const useDrag: ({ containerRef, minTopHeight, minBottomHeight,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
height: string;
|
|
2
|
+
declare const useDrag: ({ containerRef, direction, defaultHeight, defaultWidth, minTopHeight, minBottomHeight, minLeftWidth, minRightWidth, localKey, enableEdges, onResizeStart, onResize, onResizeStop, }: DragProps) => {
|
|
3
|
+
size: {
|
|
4
|
+
width: string | number;
|
|
5
|
+
height: string | number;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
onResizeStart: () => void;
|
|
8
|
+
onResize: () => void;
|
|
9
|
+
onResizeStop: (e: any, direction: any, ref: HTMLElement) => void;
|
|
10
|
+
enable: {
|
|
11
|
+
top: boolean | undefined;
|
|
12
|
+
bottom: boolean | undefined;
|
|
13
|
+
left: boolean | undefined;
|
|
14
|
+
right: boolean | undefined;
|
|
15
|
+
topLeft: boolean;
|
|
16
|
+
ropRight: boolean;
|
|
17
|
+
bottomLeft: boolean;
|
|
18
|
+
bottomRight: boolean;
|
|
10
19
|
};
|
|
20
|
+
handleClasses: {
|
|
21
|
+
right: string;
|
|
22
|
+
bottom: string;
|
|
23
|
+
};
|
|
24
|
+
minWidth: string | number | undefined;
|
|
25
|
+
maxWidth: string | number | undefined;
|
|
26
|
+
minHeight: string | number | undefined;
|
|
27
|
+
maxHeight: string | number | undefined;
|
|
11
28
|
};
|
|
12
29
|
export default useDrag;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EdgeDirection, ResizableDirection } from '../types/interface';
|
|
2
|
+
declare const useDraggingAllowed: (direction?: ResizableDirection, enableEdges?: EdgeDirection[]) => {
|
|
3
|
+
top: boolean | undefined;
|
|
4
|
+
bottom: boolean | undefined;
|
|
5
|
+
left: boolean | undefined;
|
|
6
|
+
right: boolean | undefined;
|
|
7
|
+
topLeft: boolean;
|
|
8
|
+
ropRight: boolean;
|
|
9
|
+
bottomLeft: boolean;
|
|
10
|
+
bottomRight: boolean;
|
|
11
|
+
};
|
|
12
|
+
export default useDraggingAllowed;
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const useUpdateHeight: (containerRef
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
bottom: number;
|
|
12
|
-
};
|
|
13
|
-
topStyle: {
|
|
14
|
-
height: string;
|
|
15
|
-
};
|
|
16
|
-
bottomStyle: {
|
|
17
|
-
height: string;
|
|
18
|
-
};
|
|
19
|
-
updateELHeight: (newTopHeight: number) => void;
|
|
20
|
-
setBottomHeightToZero: () => void;
|
|
21
|
-
setTopHeightToZero: () => void;
|
|
1
|
+
import { DragProps } from '../types/interface';
|
|
2
|
+
declare const useUpdateHeight: ({ containerRef, direction, defaultHeight, defaultWidth, minTopHeight, minBottomHeight, minLeftWidth, minRightWidth, localKey, }: DragProps) => {
|
|
3
|
+
width: string | number;
|
|
4
|
+
height: string | number;
|
|
5
|
+
minWidth: string | number | undefined;
|
|
6
|
+
minHeight: string | number | undefined;
|
|
7
|
+
maxWidth: string | number | undefined;
|
|
8
|
+
maxHeight: string | number | undefined;
|
|
9
|
+
updateWidth: (width: number) => void;
|
|
10
|
+
updateHeight: (height: number) => void;
|
|
22
11
|
};
|
|
23
12
|
export default useUpdateHeight;
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { ReactElement, RefObject } from 'react';
|
|
2
|
+
export type ResizableDirection = 'horizontal' | 'vertical';
|
|
3
|
+
export type EdgeDirection = 'top' | 'bottom' | 'left' | 'right';
|
|
2
4
|
interface Common {
|
|
5
|
+
direction?: ResizableDirection;
|
|
6
|
+
defaultWidth?: number;
|
|
3
7
|
defaultHeight?: number;
|
|
4
|
-
minTopHeight?: number;
|
|
5
|
-
minBottomHeight?: number;
|
|
6
|
-
|
|
8
|
+
minTopHeight?: number | string;
|
|
9
|
+
minBottomHeight?: number | string;
|
|
10
|
+
minLeftWidth?: number | string;
|
|
11
|
+
minRightWidth?: number | string;
|
|
7
12
|
localKey?: string;
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
enableEdges?: EdgeDirection[];
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
onResizeStart?: () => void;
|
|
16
|
+
onResize?: () => void;
|
|
17
|
+
onResizeStop?: () => void;
|
|
10
18
|
}
|
|
11
19
|
export interface DynamicResizerProps extends Common {
|
|
12
|
-
children: ReactElement[]
|
|
20
|
+
children: ReactElement[];
|
|
13
21
|
}
|
|
14
22
|
export interface DragProps extends Common {
|
|
15
23
|
containerRef: RefObject<HTMLDivElement>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const isValidSize: (value: any) => boolean;
|
|
2
|
+
export declare const calcMaxSize: (curSize: number | string, limitSize: number) => number;
|
|
3
|
+
export declare const calcMinSize: (curSize: number | string, totalSize: number) => number;
|
|
4
|
+
export declare const adjustDefaultSize: (curSize: number | string | undefined, minPrimarySize: number | string, minSecondarySize: number | string, containerSize: number | undefined, defaultSize: number) => number;
|
|
@@ -10,6 +10,8 @@ interface IDialogViewProps {
|
|
|
10
10
|
answerIsImg: boolean;
|
|
11
11
|
questionIsImg: boolean;
|
|
12
12
|
LLMConfig?: ILLMMultiWheelToolConfig;
|
|
13
|
+
answerIsAudio?: boolean;
|
|
14
|
+
questionIsAudio?: boolean;
|
|
13
15
|
}
|
|
14
16
|
declare const DialogView: (props: IDialogViewProps) => React.JSX.Element;
|
|
15
17
|
export default DialogView;
|
|
@@ -13,6 +13,8 @@ interface ILLMMultiWheelSourceViewProps {
|
|
|
13
13
|
LLMConfig?: ILLMMultiWheelToolConfig;
|
|
14
14
|
dialogList: any[];
|
|
15
15
|
lang?: string;
|
|
16
|
+
questionIsAudio?: boolean;
|
|
17
|
+
answerIsAudio?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare const LLMMultiWheelSourceView: React.FC<ILLMMultiWheelSourceViewProps>;
|
|
18
20
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
@@ -11,8 +11,9 @@ interface IProps {
|
|
|
11
11
|
dataFormatType: EDataFormatType;
|
|
12
12
|
setDataFormatType: (v: EDataFormatType) => void;
|
|
13
13
|
isImg?: boolean;
|
|
14
|
+
isAudio?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare const RenderQuestion: ({ question, dataFormatType, isImg, }: {
|
|
16
|
+
export declare const RenderQuestion: ({ question, dataFormatType, isImg, isAudio, }: {
|
|
16
17
|
question: string | {
|
|
17
18
|
id: number;
|
|
18
19
|
path: string;
|
|
@@ -22,6 +23,7 @@ export declare const RenderQuestion: ({ question, dataFormatType, isImg, }: {
|
|
|
22
23
|
};
|
|
23
24
|
dataFormatType: EDataFormatType;
|
|
24
25
|
isImg?: boolean | undefined;
|
|
26
|
+
isAudio?: boolean | undefined;
|
|
25
27
|
}) => React.JSX.Element;
|
|
26
28
|
declare const Header: (props: IProps) => React.JSX.Element;
|
|
27
29
|
export declare const ToggleDataFormatType: (props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IDefaultSize, IPointCloudLimit } from '@labelbee/lb-utils';
|
|
3
3
|
declare const LimitPopover: ({ limit, updateSize, }: {
|
|
4
|
-
limit:
|
|
4
|
+
limit: IPointCloudLimit;
|
|
5
5
|
updateSize?: ((size: IDefaultSize) => void) | undefined;
|
|
6
6
|
}) => React.JSX.Element;
|
|
7
7
|
export default LimitPopover;
|
|
@@ -40,10 +40,12 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
|
|
|
40
40
|
selectedIDs: string[];
|
|
41
41
|
setSelectedIDs: (ids?: string[] | string) => void;
|
|
42
42
|
valid: boolean;
|
|
43
|
+
visibleBatchSetValid: boolean;
|
|
43
44
|
setPointCloudResult: (resultList: IPointCloudBoxList) => void;
|
|
44
45
|
setPointCloudSphereList: (sphereList: IPointCloudSphereList) => void;
|
|
45
46
|
selectedPointCloudBox?: IPointCloudBox;
|
|
46
47
|
setPointCloudValid: (valid?: boolean) => void;
|
|
48
|
+
setBatchSetValidModal: (visible: boolean) => void;
|
|
47
49
|
addSelectedID: (selectedID: string) => void;
|
|
48
50
|
addHighlightID: (highlightID: number) => void;
|
|
49
51
|
selectedAllBoxes: () => void;
|
|
@@ -102,6 +104,8 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
|
|
|
102
104
|
linkageImageNameRectMap: MapIndirectWeakSet<IPointCloudBoxRect>;
|
|
103
105
|
updateRectListByReducer: UpdateRectListByReducer;
|
|
104
106
|
windowKeydownListenerHook: WindowKeydownListenerHooker;
|
|
107
|
+
isLargeStatus: boolean;
|
|
108
|
+
setIsLargeStatus: (isLargeStatus: boolean) => void;
|
|
105
109
|
}
|
|
106
110
|
export declare const PointCloudContext: React.Context<IPointCloudContext>;
|
|
107
111
|
export declare const PointCloudProvider: React.FC<PropsWithChildren<{}>>;
|
|
@@ -5,6 +5,7 @@ interface IProps extends IA2MapStateProps {
|
|
|
5
5
|
checkMode?: boolean;
|
|
6
6
|
toolInstanceRef: React.MutableRefObject<ICustomToolInstance>;
|
|
7
7
|
setResourceLoading?: (loading: boolean) => void;
|
|
8
|
+
isBatchSetValid?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
10
11
|
children?: React.ReactNode;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { IAnnotationStateProps } from '@/store/annotation/map';
|
|
3
2
|
/**
|
|
4
3
|
* PointCloud Rotate Hook
|
|
5
4
|
* @returns
|
|
6
5
|
*/
|
|
7
6
|
export declare const useRotate: ({ currentData }: IAnnotationStateProps) => {
|
|
8
|
-
updateRotate: import("lodash").
|
|
7
|
+
updateRotate: import("lodash").DebouncedFuncLeading<(angle: number) => void>;
|
|
9
8
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { IAnnotationStateProps } from '@/store/annotation/map';
|
|
3
2
|
/**
|
|
4
3
|
* PointCloud Rotate Hook
|
|
5
4
|
* @returns
|
|
6
5
|
*/
|
|
7
6
|
export declare const useRotateEdge: ({ currentData }: IAnnotationStateProps) => {
|
|
8
|
-
updateRotateEdge: import("lodash").
|
|
7
|
+
updateRotateEdge: import("lodash").DebouncedFuncLeading<(angle: number) => void>;
|
|
9
8
|
};
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { DrawLayerSlot } from '@/types/main';
|
|
9
9
|
import { IA2MapStateProps } from '@/store/annotation/map';
|
|
10
|
+
import { IBatchSetValid } from '@/views/MainView/sidebar/GeneralOperation';
|
|
10
11
|
interface IProps extends IA2MapStateProps {
|
|
11
12
|
drawLayerSlot?: DrawLayerSlot;
|
|
12
13
|
checkMode?: boolean;
|
|
13
14
|
intelligentFit?: boolean;
|
|
14
15
|
measureVisible?: boolean;
|
|
15
16
|
setResourceLoading?: (loading: boolean) => void;
|
|
17
|
+
setBatchSetValid?: (values: IBatchSetValid) => void;
|
|
16
18
|
}
|
|
17
19
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
18
20
|
children?: React.ReactNode;
|
|
@@ -9,7 +9,7 @@ interface IVideoClipProps extends IVideoAnnotateProps {
|
|
|
9
9
|
pageBackward: () => void;
|
|
10
10
|
onMounted: (instance: any) => void;
|
|
11
11
|
onUnmounted: () => void;
|
|
12
|
-
onVideoLoaded: () => void;
|
|
12
|
+
onVideoLoaded: (isError?: boolean) => void;
|
|
13
13
|
}
|
|
14
14
|
interface IState {
|
|
15
15
|
result: IVideoTimeSlice[];
|
|
@@ -14,7 +14,7 @@ export interface IVideoTagInstanceAdaptorProps extends IVideoAnnotateProps {
|
|
|
14
14
|
pageBackward: () => void;
|
|
15
15
|
onMounted: (instance: any) => void;
|
|
16
16
|
onUnmounted: () => void;
|
|
17
|
-
onVideoLoaded: () => void;
|
|
17
|
+
onVideoLoaded: (isError?: boolean) => void;
|
|
18
18
|
}
|
|
19
19
|
interface IVideoTagInstanceAdaptorState {
|
|
20
20
|
tagResult: any[];
|
|
@@ -6,7 +6,7 @@ export interface IVideoTextInstanceAdaptorProps extends IVideoAnnotateProps {
|
|
|
6
6
|
pageBackward: () => void;
|
|
7
7
|
onMounted: (instance: any) => void;
|
|
8
8
|
onUnmounted: () => void;
|
|
9
|
-
onVideoLoaded: () => void;
|
|
9
|
+
onVideoLoaded: (isError?: boolean) => void;
|
|
10
10
|
}
|
|
11
11
|
interface IVideoTextInstanceAdaptorState {
|
|
12
12
|
result: any;
|
|
@@ -22,10 +22,12 @@ export declare const prefix = "bee";
|
|
|
22
22
|
export declare const componentCls: string;
|
|
23
23
|
export declare enum EDataFormatType {
|
|
24
24
|
Default = "default",
|
|
25
|
-
Markdown = "markdown"
|
|
25
|
+
Markdown = "markdown",
|
|
26
|
+
Latex = "latex"
|
|
26
27
|
}
|
|
27
28
|
export declare enum ELLMDataType {
|
|
28
29
|
Picture = "picture",
|
|
29
30
|
Text = "text",
|
|
30
|
-
None = "none"
|
|
31
|
+
None = "none",
|
|
32
|
+
Audio = "audio"
|
|
31
33
|
}
|
|
@@ -41,6 +41,7 @@ export declare const ANNOTATION_ACTIONS: {
|
|
|
41
41
|
SET_HIGHLIGHT_ATTRIBUTE: string;
|
|
42
42
|
UPDATE_PRE_DATA_PROCESS: string;
|
|
43
43
|
UPDATE_IMG_INDEX_BY_EXTERNAL: string;
|
|
44
|
+
CHANGE_PAGE_CHECK: string;
|
|
44
45
|
};
|
|
45
46
|
export declare const IMAGE_ATTRIBUTE_ACTIONS: {
|
|
46
47
|
UPDATE_IMG_ATTRIBUTE: string;
|
|
@@ -36,7 +36,7 @@ export declare function BatchUpdateTrackID({ id, newID, rangeIndex, imgList, }:
|
|
|
36
36
|
imgList: IFileItem[];
|
|
37
37
|
}): AnnotationActionTypes;
|
|
38
38
|
export declare function BatchUpdateResultByTrackID(id: number, // originData
|
|
39
|
-
newData: Partial<IPointCloudBox>, rangeIndex: [number, number]): AnnotationActionTypes;
|
|
39
|
+
newData: Partial<IPointCloudBox>, rangeIndex: [number, number], imgList: IFileItem[]): AnnotationActionTypes;
|
|
40
40
|
export declare function BatchUpdateImgListResultByPredictResult(): AnnotationActionTypes;
|
|
41
41
|
export declare const UpdateCheckMode: (checkMode: boolean) => AnnotationActionTypes;
|
|
42
42
|
export declare const UpdateHighlightAttribute: (attribute: string) => AnnotationActionTypes;
|
|
@@ -79,6 +79,14 @@ export declare const PageJump: (toIndex: number, triggerEventAfterIndexChanged?:
|
|
|
79
79
|
* @param isInitial // 是否为初始化加载
|
|
80
80
|
*/
|
|
81
81
|
export declare const loadImgList: (dispatch: any, getState: any, nextIndex: number, isInitial?: boolean) => Promise<true | undefined>;
|
|
82
|
+
/**
|
|
83
|
+
* The CheckExecutePageTurning function is the extraction function of the DispatcherTurning function
|
|
84
|
+
* @param dispatch
|
|
85
|
+
* @param getState
|
|
86
|
+
* @param pageTurningOperation
|
|
87
|
+
* @param toIndex
|
|
88
|
+
*/
|
|
89
|
+
export declare const CheckExecutePageTurning: (dispatch: any, getState: any, pageTurningOperation: EPageTurningOperation, triggerEventAfterIndexChanged?: boolean, toIndex?: number) => Promise<any>;
|
|
82
90
|
/**
|
|
83
91
|
* 判断翻页还是切换依赖数据
|
|
84
92
|
* @param dispatch
|
|
@@ -20,6 +20,7 @@ export interface IA2MapStateProps extends IAnnotationStateProps {
|
|
|
20
20
|
configString: string;
|
|
21
21
|
highlightAttribute: string;
|
|
22
22
|
loadPCDFileLoading: boolean;
|
|
23
|
+
setResourceLoading?: (loading: boolean) => void;
|
|
23
24
|
}
|
|
24
25
|
export declare const a2MapStateToProps: (state: AppState) => {
|
|
25
26
|
currentData: any;
|
|
@@ -48,11 +48,15 @@ export declare const annotationReducer: (state: {
|
|
|
48
48
|
triggerEventAfterIndexChanged: boolean;
|
|
49
49
|
skipBeforePageTurning?: ((pageTurning: Function) => void) | undefined;
|
|
50
50
|
beforeRotate?: (() => boolean) | undefined;
|
|
51
|
-
pointCloudLoading: boolean;
|
|
51
|
+
pointCloudLoading: boolean; /**
|
|
52
|
+
* 获取当前文件列表的总页数
|
|
53
|
+
* @param state
|
|
54
|
+
*/
|
|
52
55
|
checkMode: boolean;
|
|
53
56
|
predictionResult: import("./types").IPointCloudBoxWithIndex[];
|
|
54
57
|
predictionResultVisible: boolean;
|
|
55
58
|
highlightAttribute: string;
|
|
56
59
|
preDataProcess?: ((params: import("../../App").IPreDataProcessParams) => IPointCloudBox[]) | undefined;
|
|
57
60
|
getImgIndexByExternal?: import("@/types/data").GetImgIndexByExternal | undefined;
|
|
61
|
+
confirmPageTurning?: boolean | undefined;
|
|
58
62
|
} | undefined, action: AnnotationActionTypes) => AnnotationState;
|
|
@@ -48,6 +48,7 @@ export interface AnnotationState {
|
|
|
48
48
|
highlightAttribute: string;
|
|
49
49
|
preDataProcess?: (params: IPreDataProcessParams) => IPointCloudBox[];
|
|
50
50
|
getImgIndexByExternal?: GetImgIndexByExternal;
|
|
51
|
+
confirmPageTurning?: boolean;
|
|
51
52
|
}
|
|
52
53
|
interface UpdateToolInstance {
|
|
53
54
|
type: typeof ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE;
|
|
@@ -157,12 +158,13 @@ interface BatchUpdateTrackID {
|
|
|
157
158
|
imgList: IFileItem[];
|
|
158
159
|
};
|
|
159
160
|
}
|
|
160
|
-
interface BatchUpdateResultByTrackID {
|
|
161
|
+
export interface BatchUpdateResultByTrackID {
|
|
161
162
|
type: typeof ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID;
|
|
162
163
|
payload: {
|
|
163
164
|
id: number;
|
|
164
165
|
newData: Partial<IPointCloudBox>;
|
|
165
|
-
|
|
166
|
+
rangeIndex: [number, number];
|
|
167
|
+
imgList: IFileItem[];
|
|
166
168
|
};
|
|
167
169
|
}
|
|
168
170
|
export type AnnotationActionTypes = UpdateToolInstance | UpdateImgList | UpdateAnnotationConfig | SubmitFileData | LoadFileData | SetTaskConfig | InitTool | UpdateOnSubmit | UpdateOnPageChange | UpdateOnStepChange | UpdateGetFileData | UpdatePageSize | UpdateGetFileList | CopyBackWordResult | UpdateOnSave | BatchUpdateTrackID | BatchUpdateResultByTrackID | UpdataImgIndexByExternal | InitAnnotationState;
|
|
@@ -5,6 +5,8 @@ export interface BaseStore {
|
|
|
5
5
|
export interface PointCloudToolConfigStore {
|
|
6
6
|
selectBoxVisibleSwitch: boolean;
|
|
7
7
|
setSelectBoxVisibleSwitch: (selectBoxVisibleSwitch: boolean) => void;
|
|
8
|
+
attrChangeTrigger: number;
|
|
9
|
+
setAttrChangeTrigger: (attrChangeTrigger: number) => void;
|
|
8
10
|
}
|
|
9
11
|
export interface ToolConfigStore extends BaseStore, PointCloudToolConfigStore {
|
|
10
12
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { AppProps } from '@/App';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { IBatchSetValid } from './sidebar/GeneralOperation';
|
|
3
4
|
interface IProps {
|
|
4
5
|
path: string;
|
|
5
6
|
loading: boolean;
|
|
6
7
|
measureVisible?: boolean;
|
|
8
|
+
setBatchSetValid?: (values: IBatchSetValid) => void;
|
|
7
9
|
}
|
|
8
10
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<AppProps & IProps>, import("react-redux").Omit<AppProps & IProps & {
|
|
9
11
|
children?: React.ReactNode;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IBatchSetValid } from '../GeneralOperation';
|
|
2
3
|
export interface IOperationConfig {
|
|
3
4
|
name: string;
|
|
4
5
|
key: string;
|
|
@@ -11,5 +12,7 @@ export interface IOperationConfig {
|
|
|
11
12
|
}
|
|
12
13
|
declare const ActionsConfirm: React.FC<{
|
|
13
14
|
allOperation: IOperationConfig[];
|
|
15
|
+
setBatchSetValid?: (values: IBatchSetValid) => void;
|
|
16
|
+
valid?: boolean;
|
|
14
17
|
}>;
|
|
15
18
|
export default ActionsConfirm;
|
|
@@ -3,6 +3,14 @@ import { ConnectedComponent } from 'react-redux';
|
|
|
3
3
|
import { ToolInstance } from '@/store/annotation/types';
|
|
4
4
|
import { IStepInfo } from '@/types/step';
|
|
5
5
|
import { AnnotationFileList } from '@/types/data';
|
|
6
|
+
export interface IBatchSetValid {
|
|
7
|
+
isHover?: boolean;
|
|
8
|
+
valid?: boolean;
|
|
9
|
+
isModal?: boolean;
|
|
10
|
+
visibleModal?: boolean;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
singleSetQuestionImg?: () => void;
|
|
13
|
+
}
|
|
6
14
|
interface IProps {
|
|
7
15
|
toolInstance: ToolInstance;
|
|
8
16
|
stepInfo: IStepInfo;
|
|
@@ -10,6 +18,7 @@ interface IProps {
|
|
|
10
18
|
imgIndex: number;
|
|
11
19
|
stepList: IStepInfo[];
|
|
12
20
|
hideValidity?: boolean;
|
|
21
|
+
setBatchSetValid?: (values: IBatchSetValid) => void;
|
|
13
22
|
}
|
|
14
23
|
export declare const PointCloudOperation: ConnectedComponent<React.FC<IProps>, Omit<IProps & {
|
|
15
24
|
children?: React.ReactNode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EToolName } from '@/data/enums/ToolType';
|
|
2
2
|
import { Sider } from '@/types/main';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { IBatchSetValid } from './GeneralOperation';
|
|
4
5
|
interface IProps {
|
|
5
6
|
toolName?: EToolName;
|
|
6
7
|
sider?: Sider;
|
|
@@ -8,6 +9,7 @@ interface IProps {
|
|
|
8
9
|
setSiderWidth?: (width: number | undefined) => void;
|
|
9
10
|
propsSiderWidth?: number | undefined;
|
|
10
11
|
checkMode?: boolean;
|
|
12
|
+
setBatchSetValid?: (values: IBatchSetValid) => void;
|
|
11
13
|
}
|
|
12
14
|
export declare const sidebarCls: string;
|
|
13
15
|
declare const Sidebar: React.FC<IProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const convertLatexFormat=r=>{try{return r.replace(/\\\((.+?)\\\)/gs,(o,e)=>`$${e}$`).replace(/\\\[(.+?)\\\]/gs,(o,e)=>`$$${e}$$`)}catch(t){return r}};exports.convertLatexFormat=convertLatexFormat;
|