@labelbee/lb-components 1.23.0-alpha.99 → 1.23.1-alpha.1
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/components/AnnotationView/hooks/useFilterAnnotations.js +1 -0
- package/dist/components/AnnotationView/index.js +1 -1
- package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -0
- package/dist/components/LLMMultiWheelView/index.js +1 -0
- package/dist/components/LLMMultiWheelView/sidebar/index.js +1 -0
- package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/imgView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/modelAnswerSort/index.js +1 -0
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/attributeList/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/audioPlayer/useAudioScroll/index.js +1 -1
- package/dist/components/markdownView/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegmentListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -0
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/predictTracking/predictTrackingIcon/index.js +1 -1
- package/dist/components/predictTracking/previewResult/index.js +1 -1
- package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/dist/data/enums/ToolType.js +1 -1
- package/dist/index.css +71 -4
- package/dist/index.js +1 -1
- package/dist/store/LLMMultiWheel/index.js +1 -0
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/store/ctx.js +1 -1
- package/dist/store/toolConfig/baseToolConfig.js +1 -0
- package/dist/store/toolConfig/index.js +1 -0
- package/dist/store/toolConfig/pointCloudToolConfig.js +1 -0
- package/dist/types/App.d.ts +1 -0
- package/dist/types/components/AnnotationView/hooks/useFilterAnnotations.d.ts +2 -0
- package/dist/types/components/AnnotationView/index.d.ts +9 -0
- package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +15 -0
- package/dist/types/components/LLMMultiWheelView/index.d.ts +21 -0
- package/dist/types/components/LLMMultiWheelView/sidebar/index.d.ts +8 -0
- package/dist/types/components/LLMMultiWheelView/types.d.ts +62 -0
- package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +15 -0
- package/dist/types/components/LLMToolView/questionView/index.d.ts +7 -0
- package/dist/types/components/LLMToolView/sidebar/components/answerSort/index.d.ts +3 -0
- package/dist/types/components/LLMToolView/sidebar/components/modelAnswerSort/index.d.ts +30 -0
- package/dist/types/components/LLMToolView/sidebar/components/textInputBox/index.d.ts +2 -2
- package/dist/types/components/LLMToolView/sidebar/index.d.ts +10 -0
- package/dist/types/components/LLMToolView/types.d.ts +6 -2
- package/dist/types/components/LLMToolView/utils/data.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -0
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +23 -1
- package/dist/types/components/pointCloudView/hooks/useUpdatePointCloudColor.d.ts +4 -0
- package/dist/types/components/pointCloudView/index.d.ts +1 -0
- package/dist/types/data/enums/ToolType.d.ts +2 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/store/LLMMultiWheel/index.d.ts +15 -0
- package/dist/types/store/annotation/actionCreators.d.ts +1 -1
- package/dist/types/store/ctx.d.ts +7 -0
- package/dist/types/store/toolConfig/baseToolConfig.d.ts +4 -0
- package/dist/types/store/toolConfig/index.d.ts +3 -0
- package/dist/types/store/toolConfig/pointCloudToolConfig.d.ts +4 -0
- package/dist/types/store/toolConfig/types.d.ts +10 -0
- package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +2 -1
- package/dist/types/views/MainView/LLMMultiWheelLayout/index.d.ts +9 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.d.ts +3 -0
- package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -1
- package/dist/views/MainView/LLMMultiWheelLayout/index.js +1 -0
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/_virtual/2DViewWorker.js +1 -1
- package/es/components/AnnotationView/hooks/useFilterAnnotations.js +1 -0
- package/es/components/AnnotationView/index.js +1 -1
- package/es/components/LLMMultiWheelView/dialogView/index.js +1 -0
- package/es/components/LLMMultiWheelView/index.js +1 -0
- package/es/components/LLMMultiWheelView/sidebar/index.js +1 -0
- package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/imgView/index.js +1 -1
- package/es/components/LLMToolView/questionView/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/modelAnswerSort/index.js +1 -0
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/attributeList/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/audioPlayer/useAudioScroll/index.js +1 -1
- package/es/components/markdownView/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSegmentListener.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -0
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/predictTracking/predictTrackingIcon/index.js +1 -1
- package/es/components/predictTracking/previewResult/index.js +1 -1
- package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/es/data/enums/ToolType.js +1 -1
- package/es/index.css +71 -4
- package/es/index.js +1 -1
- package/es/store/LLMMultiWheel/index.js +1 -0
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/ctx.js +1 -1
- package/es/store/toolConfig/baseToolConfig.js +1 -0
- package/es/store/toolConfig/index.js +1 -0
- package/es/store/toolConfig/pointCloudToolConfig.js +1 -0
- package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -1
- package/es/views/MainView/LLMMultiWheelLayout/index.js +1 -0
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/package.json +5 -4
|
@@ -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(E){u(E)}},p=I=>{try{O(l.throw(I))}catch(E){u(E)}},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].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),E=StepUtils.currentToolIsPointCloud(O,p),D=((u=StepUtils.getCurrentStepInfo(O,p))==null?void 0:u.tool)===ToolType.EToolName.LLM,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(E||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 E=((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(E,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,E,D,y,P,x,B,w,b,F,G,M,V,q,k,H,z,K,W,$,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),m=e.imgList.map((v,C)=>{if(C===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:m});r&&r([m[o]],(O=t.payload)==null?void 0:O.submitType,o,m);const R=calcStepProgress(m,s);return __spreadProps(__spreadValues({},e),{stepProgress:R,imgList:m})}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]=(I=i==null?void 0:i.exportData())!=null?I:[];let A=r;if((a==null?void 0:a.length)>0){const T=(E=a[o])==null?void 0:E.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=(D=T[d])==null?void 0:D.id,N=index.jsonParser((y=s[i])==null?void 0:y.result),f=(A||[]).filter(U=>U.sourceID===c),L=getStepConfig(a,o),{dataSourceStep:m,tool:R}=L,v=getStepConfig(a,m);let C=[];return m&&R&&(C=(P=N[`step_${m}`])==null?void 0:P.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:A,imgNode:T,nextBasicIndex:d,imgError:c}=t.payload,N=d!=null?d:0,f=index.jsonParser((x=n[A])==null?void 0:x.result),L=f[`step_${r.step}`],m=!L,R={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!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:U}=v,Z=getStepConfig(a,C),Q=C&&U,h=(F=(b=f[`step_${C}`])==null?void 0:b.result)!=null?F:[],j=AnnotationDataUtils.getInitialResultList(L==null?void 0:L.result,s,v,h,m);if(i==null||i.launchOperation(),Q&&((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"){const ee=(M=(G=h[N])==null?void 0:G.id)!=null?M:"",te=Q?j.filter(ne=>lbAnnotation.CommonToolUtils.isSameSourceID(ne.sourceID,ee)):j;(V=s==null?void 0:s.history)==null||V.initRecord(j,!0),s==null||s.setResult(te)}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=(K=A==null?void 0:A.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,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=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;
|
package/dist/store/ctx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const LabelBeeContext=React__default.default.createContext(void 0),useDispatch=reactRedux.createDispatchHook(LabelBeeContext),useSelector=reactRedux.createSelectorHook(LabelBeeContext),LLMContext=React__default.default.createContext({hoverKey:-1,newAnswerList:[],setHoverKey:()=>{},modelAPIResponse:[],setModelAPIResponse:()=>{},setNewAnswerList:()=>{}}),NLPContext=React__default.default.createContext({highlightKey:"",setHighlightKey:()=>{}});exports.LLMContext=LLMContext,exports.LabelBeeContext=LabelBeeContext,exports.NLPContext=NLPContext,exports.useDispatch=useDispatch,exports.useSelector=useSelector;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const LabelBeeContext=React__default.default.createContext(void 0),useDispatch=reactRedux.createDispatchHook(LabelBeeContext),useSelector=reactRedux.createSelectorHook(LabelBeeContext),LLMContext=React__default.default.createContext({hoverKey:-1,newAnswerList:[],setHoverKey:()=>{},modelAPIResponse:[],setModelAPIResponse:()=>{},setNewAnswerList:()=>{}}),NLPContext=React__default.default.createContext({highlightKey:"",setHighlightKey:()=>{}});React__default.default.createContext({hoverKey:-1,setHoverKey:()=>{},selectKey:1,setSelectKey:()=>{}}),exports.LLMContext=LLMContext,exports.LabelBeeContext=LabelBeeContext,exports.NLPContext=NLPContext,exports.useDispatch=useDispatch,exports.useSelector=useSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const baseToolStateCreator=(t,e)=>({onlyLoadFirstData:!1,setOnlyLoadFirstData:a=>t(s=>({onlyLoadFirstData:a}))});module.exports=baseToolStateCreator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var zustand=require("zustand"),baseToolConfig=require("./baseToolConfig.js"),pointCloudToolConfig=require("./pointCloudToolConfig.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,r,e)=>r in o?__defProp(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,__spreadValues=(o,r)=>{for(var e in r||(r={}))__hasOwnProp.call(r,e)&&__defNormalProp(o,e,r[e]);if(__getOwnPropSymbols)for(var e of __getOwnPropSymbols(r))__propIsEnum.call(r,e)&&__defNormalProp(o,e,r[e]);return o};const useToolConfigStore=zustand.create((o,r,e)=>__spreadValues(__spreadValues({},baseToolConfig(o)),pointCloudToolConfig(o)));module.exports=useToolConfigStore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const pointCloudToolStateCreator=(e,o)=>({selectBoxVisibleSwitch:!1,setSelectBoxVisibleSwitch:t=>e(()=>({selectBoxVisibleSwitch:t}))});module.exports=pointCloudToolStateCreator;
|
package/dist/types/App.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ export interface AppProps {
|
|
|
80
80
|
auditContext?: any;
|
|
81
81
|
getImgIndexByExternal: GetImgIndexByExternal;
|
|
82
82
|
annotationBefore?: (setAnnotationData: Function) => void;
|
|
83
|
+
setResourceLoading?: (loading: boolean) => void;
|
|
83
84
|
toolStyle?: ToolStyle;
|
|
84
85
|
}
|
|
85
86
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<AppProps>, import("react-redux").Omit<AppProps & {
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* @author laoluo
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { EPointCloudName } from '@labelbee/lb-annotation';
|
|
7
|
+
import { IPointCloudBoxList } from '@labelbee/lb-utils';
|
|
6
8
|
export type TAfterImgOnLoad = (img: HTMLImageElement) => void;
|
|
7
9
|
interface IProps {
|
|
8
10
|
src: string;
|
|
@@ -30,6 +32,13 @@ interface IProps {
|
|
|
30
32
|
};
|
|
31
33
|
staticMode?: boolean;
|
|
32
34
|
measureVisible?: boolean;
|
|
35
|
+
onRightClick?: (e: {
|
|
36
|
+
event: MouseEvent;
|
|
37
|
+
targetId: string;
|
|
38
|
+
}) => void;
|
|
39
|
+
pointCloudBoxList?: IPointCloudBoxList;
|
|
40
|
+
hiddenText?: boolean;
|
|
41
|
+
renderToolName?: EPointCloudName.PointCloud | undefined;
|
|
33
42
|
}
|
|
34
43
|
declare const _default: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
|
|
35
44
|
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ILLMMultiWheelToolConfig } from '@/components/LLMToolView/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface IDialogViewProps {
|
|
4
|
+
id: number | string;
|
|
5
|
+
answerList: any;
|
|
6
|
+
question: any;
|
|
7
|
+
name?: string;
|
|
8
|
+
index: number;
|
|
9
|
+
isSelected: boolean;
|
|
10
|
+
answerIsImg: boolean;
|
|
11
|
+
questionIsImg: boolean;
|
|
12
|
+
LLMConfig?: ILLMMultiWheelToolConfig;
|
|
13
|
+
}
|
|
14
|
+
declare const DialogView: (props: IDialogViewProps) => React.JSX.Element;
|
|
15
|
+
export default DialogView;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ILLMMultiWheelToolConfig } from '../LLMToolView/types';
|
|
3
|
+
import { DrawLayerSlot } from '@/types/main';
|
|
4
|
+
interface IProps {
|
|
5
|
+
annotation?: any;
|
|
6
|
+
showTips?: boolean;
|
|
7
|
+
tips?: string;
|
|
8
|
+
drawLayerSlot?: DrawLayerSlot;
|
|
9
|
+
}
|
|
10
|
+
interface ILLMMultiWheelSourceViewProps {
|
|
11
|
+
questionIsImg: boolean;
|
|
12
|
+
answerIsImg: boolean;
|
|
13
|
+
LLMConfig?: ILLMMultiWheelToolConfig;
|
|
14
|
+
dialogList: any[];
|
|
15
|
+
lang?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const LLMMultiWheelSourceView: React.FC<ILLMMultiWheelSourceViewProps>;
|
|
18
|
+
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}, "annotation">>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
annotation?: any;
|
|
4
|
+
dispatch: any;
|
|
5
|
+
checkMode?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import("react-redux").ConnectedComponent<(props: IProps) => React.JSX.Element, import("react-redux").Omit<IProps, "annotation" | "dispatch">>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export interface ITextList {
|
|
2
|
+
textId?: string;
|
|
3
|
+
title?: string | number;
|
|
4
|
+
tip?: string;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
value?: string;
|
|
8
|
+
isFillAnswer?: boolean;
|
|
9
|
+
textControl?: boolean;
|
|
10
|
+
isLaText?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface IAnswerList {
|
|
13
|
+
id: string;
|
|
14
|
+
answer: string;
|
|
15
|
+
newAnswer: string;
|
|
16
|
+
indicatorScore: {
|
|
17
|
+
[key: string]: number;
|
|
18
|
+
};
|
|
19
|
+
indicatorDetermine: {
|
|
20
|
+
[key: string]: boolean;
|
|
21
|
+
};
|
|
22
|
+
tagList: {
|
|
23
|
+
[key: string]: string[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface IModelData {
|
|
27
|
+
id: number;
|
|
28
|
+
sort: Array<number[]>;
|
|
29
|
+
answerList: IAnswerList[];
|
|
30
|
+
}
|
|
31
|
+
export interface IModelResult {
|
|
32
|
+
sort: Array<number[]>;
|
|
33
|
+
answerSort: {
|
|
34
|
+
[key: string]: number[];
|
|
35
|
+
};
|
|
36
|
+
textAttribute: ITextList[];
|
|
37
|
+
modelData: IModelData[];
|
|
38
|
+
}
|
|
39
|
+
export interface ISortData {
|
|
40
|
+
newSort?: IAnswerSort[][];
|
|
41
|
+
waitSorts?: IWaitAnswerSort[];
|
|
42
|
+
}
|
|
43
|
+
export interface IWaitAnswerSort {
|
|
44
|
+
title: string;
|
|
45
|
+
id: string;
|
|
46
|
+
}
|
|
47
|
+
export interface IPoint {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}
|
|
51
|
+
export interface ITagVertexPoint {
|
|
52
|
+
bl: IPoint;
|
|
53
|
+
br: IPoint;
|
|
54
|
+
tl: IPoint;
|
|
55
|
+
tr: IPoint;
|
|
56
|
+
}
|
|
57
|
+
export interface IAnswerSort {
|
|
58
|
+
title: string;
|
|
59
|
+
id: string;
|
|
60
|
+
tagCenterPoint?: IPoint;
|
|
61
|
+
tagVertexPoint?: ITagVertexPoint;
|
|
62
|
+
}
|
|
@@ -12,5 +12,20 @@ interface IProps {
|
|
|
12
12
|
setDataFormatType: (v: EDataFormatType) => void;
|
|
13
13
|
isImg?: boolean;
|
|
14
14
|
}
|
|
15
|
+
export declare const RenderQuestion: ({ question, dataFormatType, isImg, }: {
|
|
16
|
+
question: string | {
|
|
17
|
+
id: number;
|
|
18
|
+
path: string;
|
|
19
|
+
url: string;
|
|
20
|
+
processedUrl: string;
|
|
21
|
+
thumbnail: string;
|
|
22
|
+
};
|
|
23
|
+
dataFormatType: EDataFormatType;
|
|
24
|
+
isImg?: boolean | undefined;
|
|
25
|
+
}) => React.JSX.Element;
|
|
15
26
|
declare const Header: (props: IProps) => React.JSX.Element;
|
|
27
|
+
export declare const ToggleDataFormatType: (props: {
|
|
28
|
+
dataFormatType: EDataFormatType;
|
|
29
|
+
setDataFormatType: (v: EDataFormatType) => void;
|
|
30
|
+
}) => React.JSX.Element;
|
|
16
31
|
export default Header;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { EDataFormatType } from '@/constant';
|
|
2
3
|
import { IAnswerList, IModelAPIAnswer, ILLMToolConfig } from '@/components/LLMToolView/types';
|
|
3
4
|
interface IProps {
|
|
4
5
|
hoverKey?: number;
|
|
@@ -19,5 +20,11 @@ interface IProps {
|
|
|
19
20
|
answerHeaderSlot?: React.ReactDOM | string;
|
|
20
21
|
}
|
|
21
22
|
export declare const LLMViewCls: string;
|
|
23
|
+
export declare const RenderAnswer: ({ i, dataFormatType, isTextControl, }: {
|
|
24
|
+
i: IAnswerList;
|
|
25
|
+
dataFormatType: EDataFormatType;
|
|
26
|
+
isTextControl: boolean;
|
|
27
|
+
}) => React.JSX.Element;
|
|
28
|
+
export declare const getTextControlByConfig: (result: IAnswerList, LLMConfig: any) => boolean;
|
|
22
29
|
declare const WrapQuestionView: (props: IProps) => React.JSX.Element;
|
|
23
30
|
export default WrapQuestionView;
|
|
@@ -5,6 +5,9 @@ interface IProps {
|
|
|
5
5
|
sortList: IAnswerSort[][];
|
|
6
6
|
waitSortList: IWaitAnswerSort[];
|
|
7
7
|
disabeledAll?: boolean;
|
|
8
|
+
header?: HTMLElement | string;
|
|
9
|
+
title?: string;
|
|
10
|
+
prefixId?: string;
|
|
8
11
|
}
|
|
9
12
|
declare const AnswerSort: (props: IProps) => React.JSX.Element;
|
|
10
13
|
export default AnswerSort;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ISelectAnswerSort {
|
|
3
|
+
[key: string]: number[][];
|
|
4
|
+
}
|
|
5
|
+
interface IModelList {
|
|
6
|
+
id: number;
|
|
7
|
+
answerList: IAnswerList[];
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
interface IAnswerList {
|
|
11
|
+
id: string;
|
|
12
|
+
answer: string;
|
|
13
|
+
}
|
|
14
|
+
interface IProps {
|
|
15
|
+
selectedSort?: ISelectAnswerSort;
|
|
16
|
+
modelData: IModelList[];
|
|
17
|
+
selectedAnswerSort: (sorts: ISelectAnswerSort) => void;
|
|
18
|
+
disabeledAll?: boolean;
|
|
19
|
+
imgIndex: number;
|
|
20
|
+
}
|
|
21
|
+
export declare const getSorts: ({ selectedSort, initSelected, modelList, }: {
|
|
22
|
+
selectedSort?: number[][] | undefined;
|
|
23
|
+
modelList: any[];
|
|
24
|
+
initSelected?: number[][] | undefined;
|
|
25
|
+
}) => {
|
|
26
|
+
waitSorts: any[];
|
|
27
|
+
newSort: any[];
|
|
28
|
+
};
|
|
29
|
+
declare const _default: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
|
|
30
|
+
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ITextList } from '@/components/LLMToolView/types';
|
|
3
3
|
interface IProps {
|
|
4
4
|
textAttribute: ITextList[];
|
|
5
5
|
disabeledAll?: boolean;
|
|
6
|
-
LLMConfig?: ILLMToolConfig;
|
|
7
6
|
setText: (value: ITextList[]) => void;
|
|
7
|
+
textConfig: ITextList[];
|
|
8
8
|
}
|
|
9
9
|
declare const TextInputBox: (props: IProps) => React.JSX.Element;
|
|
10
10
|
export default TextInputBox;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IWaitAnswerSort, IAnswerSort, ILLMToolConfig, IAnswerList, ITextList, ISelectedTags, ILLMMultiWheelToolConfig } from '@/components/LLMToolView/types';
|
|
2
3
|
interface IProps {
|
|
3
4
|
annotation?: any;
|
|
4
5
|
dispatch: any;
|
|
5
6
|
checkMode?: boolean;
|
|
6
7
|
}
|
|
8
|
+
export interface IAnnotationResult {
|
|
9
|
+
newSort?: IAnswerSort[][];
|
|
10
|
+
waitSorts?: IWaitAnswerSort[];
|
|
11
|
+
answerList?: IAnswerList[];
|
|
12
|
+
textAttribute?: ITextList[];
|
|
13
|
+
tagList?: ISelectedTags;
|
|
14
|
+
}
|
|
15
|
+
export declare const EmptyConfig: () => React.JSX.Element;
|
|
16
|
+
export declare const getLLMIsNoConfig: (LLMConfig?: ILLMMultiWheelToolConfig | ILLMToolConfig) => boolean;
|
|
7
17
|
declare const _default: import("react-redux").ConnectedComponent<(props: IProps) => React.JSX.Element, import("react-redux").Omit<IProps, "annotation" | "dispatch">>;
|
|
8
18
|
export default _default;
|
|
@@ -21,6 +21,7 @@ export interface IAnswerList {
|
|
|
21
21
|
newAnswer?: string;
|
|
22
22
|
url?: string;
|
|
23
23
|
tagList?: ISelectedTags;
|
|
24
|
+
id?: string | number;
|
|
24
25
|
}
|
|
25
26
|
export interface IModelAPIAnswer {
|
|
26
27
|
id: string;
|
|
@@ -56,6 +57,9 @@ export interface ILLMToolConfig {
|
|
|
56
57
|
tagInputListConfigurable: boolean;
|
|
57
58
|
inputList?: IInputList[];
|
|
58
59
|
}
|
|
60
|
+
export interface ILLMMultiWheelToolConfig extends Omit<ILLMToolConfig, 'enableModelAPI' | 'modelAPIConfigList'> {
|
|
61
|
+
dialogSort?: boolean;
|
|
62
|
+
}
|
|
59
63
|
export interface ITextList {
|
|
60
64
|
textId?: string;
|
|
61
65
|
title?: string | number;
|
|
@@ -68,7 +72,7 @@ export interface ITextList {
|
|
|
68
72
|
isLaText?: boolean;
|
|
69
73
|
}
|
|
70
74
|
export interface IWaitAnswerSort {
|
|
71
|
-
title: number;
|
|
75
|
+
title: number | string;
|
|
72
76
|
id: number;
|
|
73
77
|
}
|
|
74
78
|
export interface IPoint {
|
|
@@ -82,7 +86,7 @@ export interface ITagVertexPoint {
|
|
|
82
86
|
tr: IPoint;
|
|
83
87
|
}
|
|
84
88
|
export interface IAnswerSort {
|
|
85
|
-
title: number;
|
|
89
|
+
title: number | string;
|
|
86
90
|
id: number;
|
|
87
91
|
tagCenterPoint?: IPoint;
|
|
88
92
|
tagVertexPoint?: ITagVertexPoint;
|
|
@@ -19,6 +19,7 @@ export declare const initAnswerList: (initValue: IAnswerList[], LLMConfig?: ILLM
|
|
|
19
19
|
} | undefined;
|
|
20
20
|
newAnswer?: string | undefined;
|
|
21
21
|
url?: string | undefined;
|
|
22
|
+
id?: string | number | undefined;
|
|
22
23
|
}[];
|
|
23
24
|
export declare const getRenderDataByResult: (LLMConfig?: ILLMToolConfig, result?: ILLMBoxResult) => {
|
|
24
25
|
newSort: IAnswerSort[][];
|
|
@@ -4,6 +4,7 @@ import { ICustomToolInstance } from '@/hooks/annotation';
|
|
|
4
4
|
interface IProps extends IA2MapStateProps {
|
|
5
5
|
checkMode?: boolean;
|
|
6
6
|
toolInstanceRef: React.MutableRefObject<ICustomToolInstance>;
|
|
7
|
+
setResourceLoading?: (loading: boolean) => void;
|
|
7
8
|
}
|
|
8
9
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
9
10
|
children?: React.ReactNode;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { PointCloudAnnotation, PointCloud } from '@labelbee/lb-annotation';
|
|
7
7
|
import { IPointCloudBox, IPointCloudSphere, IPointUnit, UpdatePolygonByDragList, IDefaultSize, IBasicRect } from '@labelbee/lb-utils';
|
|
8
8
|
import { ISize } from '@/types/main';
|
|
9
|
+
import { EPointCloudBoxRenderTrigger } from '@/utils/ToolPointCloudBoxRenderHelper';
|
|
9
10
|
import { IFileItem } from '@/types/data';
|
|
10
11
|
export declare const topViewPoint2PointCloud: (newPoint: any, size: ISize, pointCloud: PointCloud, selectedPointCloudSphere?: IPointCloudSphere, defaultValue?: {
|
|
11
12
|
[v: string]: any;
|
|
@@ -53,7 +54,23 @@ export declare const syncTopViewByPoint: (newSphereParams: IPointCloudSphere, ne
|
|
|
53
54
|
* @param newPolygon TODO! Need to add type
|
|
54
55
|
*/
|
|
55
56
|
export declare const synchronizeTopView: (newBoxParams: IPointCloudBox, newPolygon: any, topViewInstance?: PointCloudAnnotation, mainViewInstance?: PointCloud) => void;
|
|
56
|
-
|
|
57
|
+
interface IUsePointCloudViewsParams {
|
|
58
|
+
setResourceLoading?: (loading: boolean) => void;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Sync views' data from omit view, regenerate and highlight box on 3D-view
|
|
62
|
+
* @param omitView
|
|
63
|
+
* @param polygon
|
|
64
|
+
* @param boxParams
|
|
65
|
+
*/
|
|
66
|
+
interface ISyncPointCloudViews {
|
|
67
|
+
omitView?: string;
|
|
68
|
+
polygon: any;
|
|
69
|
+
boxParams: IPointCloudBox;
|
|
70
|
+
zoom?: number;
|
|
71
|
+
newPointCloudBoxList?: IPointCloudBox[];
|
|
72
|
+
}
|
|
73
|
+
export declare const usePointCloudViews: (params?: IUsePointCloudViewsParams) => {
|
|
57
74
|
topViewAddSphere: () => void;
|
|
58
75
|
topViewAddBox: () => void;
|
|
59
76
|
topViewSelectedChanged: () => void;
|
|
@@ -63,6 +80,8 @@ export declare const usePointCloudViews: () => {
|
|
|
63
80
|
sideViewUpdatePoint?: undefined;
|
|
64
81
|
backViewUpdatePoint?: undefined;
|
|
65
82
|
topViewUpdateBox?: undefined;
|
|
83
|
+
syncPointCloudViews?: undefined;
|
|
84
|
+
syncPointCloudPoint?: undefined;
|
|
66
85
|
pointCloudBoxListUpdated?: undefined;
|
|
67
86
|
initPointCloud3d?: undefined;
|
|
68
87
|
updatePointCloudData?: undefined;
|
|
@@ -97,6 +116,8 @@ export declare const usePointCloudViews: () => {
|
|
|
97
116
|
topViewUpdateBox: (updateList: UpdatePolygonByDragList, size: ISize) => void;
|
|
98
117
|
sideViewUpdateBox: (newPolygon: any, originPolygon: any) => void;
|
|
99
118
|
backViewUpdateBox: (newPolygon: any, originPolygon: any) => void;
|
|
119
|
+
syncPointCloudViews: (params: ISyncPointCloudViews, trigger?: EPointCloudBoxRenderTrigger) => void;
|
|
120
|
+
syncPointCloudPoint: (omitView: string, point: any, sphereParams: IPointCloudSphere, zoom?: number, newPointCloudSphereList?: IPointCloudSphere[], config?: any) => Promise<void>;
|
|
100
121
|
pointCloudBoxListUpdated: (newBoxes: IPointCloudBox[]) => void;
|
|
101
122
|
initPointCloud3d: (size: ISize) => void;
|
|
102
123
|
updatePointCloudData: (newData?: any) => Promise<void>;
|
|
@@ -114,3 +135,4 @@ export declare const usePointCloudViews: () => {
|
|
|
114
135
|
export declare const useSyncRectPositionDimensionToPointCloudList: () => {
|
|
115
136
|
syncToPointCloudBoxList: () => IPointCloudBox[] | null;
|
|
116
137
|
};
|
|
138
|
+
export {};
|
|
@@ -12,6 +12,7 @@ interface IProps extends IA2MapStateProps {
|
|
|
12
12
|
checkMode?: boolean;
|
|
13
13
|
intelligentFit?: boolean;
|
|
14
14
|
measureVisible?: boolean;
|
|
15
|
+
setResourceLoading?: (loading: boolean) => void;
|
|
15
16
|
}
|
|
16
17
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
17
18
|
children?: React.ReactNode;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -18,11 +18,13 @@ import { FindTrackIDIndexInCheckMode as FindTrackIDIndex } from './views/MainVie
|
|
|
18
18
|
import { WrapAudioPlayer as AudioPlayer } from './components/audioPlayer';
|
|
19
19
|
import { generatePointCloudBoxRects } from './utils';
|
|
20
20
|
import SubAttributeList from './components/subAttributeList';
|
|
21
|
+
import useToolConfigStore from '@/store/toolConfig';
|
|
22
|
+
import { LLMMultiWheelSourceView } from './components/LLMMultiWheelView';
|
|
21
23
|
export declare const store: import("redux").Store<{}, import("redux").Action<any>> & {
|
|
22
24
|
dispatch: unknown;
|
|
23
25
|
};
|
|
24
26
|
declare const _default: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<unknown>>;
|
|
25
27
|
export default _default;
|
|
26
|
-
export { AnnotationView, PointCloudAnnotationView, QuestionView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, SwitchCuboidBoxIn2DViewStateMode, BatchSwitchConnectIn2DView, MeasureCanvas, AnnotatedBox, RectRotateSensitivitySlider, FindTrackIDIndex, AudioPlayer, generatePointCloudBoxRects, SubAttributeList, };
|
|
28
|
+
export { AnnotationView, PointCloudAnnotationView, QuestionView, LLMMultiWheelSourceView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, SwitchCuboidBoxIn2DViewStateMode, BatchSwitchConnectIn2DView, MeasureCanvas, AnnotatedBox, RectRotateSensitivitySlider, FindTrackIDIndex, AudioPlayer, generatePointCloudBoxRects, SubAttributeList, useToolConfigStore, };
|
|
27
29
|
export * from './constant';
|
|
28
30
|
export * from './typeTem';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EDataFormatType } from '@/constant';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface INewAnswerListMap {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
}
|
|
6
|
+
interface Store {
|
|
7
|
+
dataFormatType: EDataFormatType;
|
|
8
|
+
setDataFormatType: (dataFormatType: EDataFormatType) => void;
|
|
9
|
+
selectedID: React.Key;
|
|
10
|
+
setSelectedID: (selectedID: React.Key) => void;
|
|
11
|
+
newAnswerListMap: INewAnswerListMap;
|
|
12
|
+
setNewAnswerListMap: (newAnswerListMap: INewAnswerListMap) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const useLLMMultiWheelStore: import("zustand").UseBoundStore<import("zustand").StoreApi<Store>>;
|
|
15
|
+
export default useLLMMultiWheelStore;
|
|
@@ -92,10 +92,10 @@ export declare const DispatcherTurning: (dispatch: any, getState: any, pageTurni
|
|
|
92
92
|
* */
|
|
93
93
|
export declare const ChangeSave: (dispatch: Function) => void;
|
|
94
94
|
export declare const SetAnnotationLoading: (dispatch: Function, loading: boolean) => void;
|
|
95
|
-
export declare const SetPointCloudLoading: (dispatch: Function, loading: boolean) => void;
|
|
96
95
|
export declare const SetLoadPCDFileLoading: (dispatch: Function, loadPCDFileLoading: boolean) => void;
|
|
97
96
|
export declare const InitAnnotationState: (dispatch: Function) => void;
|
|
98
97
|
export declare const SetPredictResult: (dispatch: Function, result: any) => void;
|
|
99
98
|
export declare const SetPredictResultVisible: (dispatch: Function, visible: boolean) => void;
|
|
100
99
|
export declare const GetBoxesByID: (selectedBoxTrackID: number, selectedBoxID: string) => (dispatch: any, getState: any) => IPointCloudBox[];
|
|
101
100
|
export declare const PreDataProcess: (params: IPreDataProcessParams) => (dispatch: any, getState: any) => IPointCloudBox[];
|
|
101
|
+
export declare const SubmitHandler: (submitType: ESubmitType) => (dispatch: any, getState: any) => Promise<void>;
|
|
@@ -9,6 +9,12 @@ interface ILLMContext {
|
|
|
9
9
|
setModelAPIResponse: React.Dispatch<React.SetStateAction<IModelAPIAnswer[]>>;
|
|
10
10
|
setNewAnswerList: (value: IAnswerList[]) => void;
|
|
11
11
|
}
|
|
12
|
+
interface ILLMMultiWheelContext {
|
|
13
|
+
hoverKey: number;
|
|
14
|
+
setHoverKey: (value: number) => void;
|
|
15
|
+
selectKey: number;
|
|
16
|
+
setSelectKey: (value: number) => void;
|
|
17
|
+
}
|
|
12
18
|
interface INLPContext {
|
|
13
19
|
highlightKey: string;
|
|
14
20
|
setHighlightKey: (value: string) => void;
|
|
@@ -18,4 +24,5 @@ export declare const useDispatch: () => Dispatch<AnyAction | any>;
|
|
|
18
24
|
export declare const useSelector: <Selected extends unknown>(selector: (state: any) => Selected, equalityFn?: ((previous: Selected, next: Selected) => boolean) | undefined) => Selected;
|
|
19
25
|
export declare const LLMContext: React.Context<ILLMContext>;
|
|
20
26
|
export declare const NLPContext: React.Context<INLPContext>;
|
|
27
|
+
export declare const LLMMultiWheelContext: React.Context<ILLMMultiWheelContext>;
|
|
21
28
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface BaseStore {
|
|
2
|
+
onlyLoadFirstData: boolean;
|
|
3
|
+
setOnlyLoadFirstData: (onlyLoadFirstData: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
export interface PointCloudToolConfigStore {
|
|
6
|
+
selectBoxVisibleSwitch: boolean;
|
|
7
|
+
setSelectBoxVisibleSwitch: (selectBoxVisibleSwitch: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface ToolConfigStore extends BaseStore, PointCloudToolConfigStore {
|
|
10
|
+
}
|
|
@@ -8,7 +8,8 @@ export declare enum EPointCloudBoxRenderTrigger {
|
|
|
8
8
|
SingleToggleValid = "SingleToggleValid",
|
|
9
9
|
SingleRotate = "SingleRotate",
|
|
10
10
|
MultiPaste = "MultiPaste",
|
|
11
|
-
MultiMove = "MultiMove"
|
|
11
|
+
MultiMove = "MultiMove",
|
|
12
|
+
MulitSelect = "MulitSelect"
|
|
12
13
|
}
|
|
13
14
|
export declare enum EPointCloudBoxSingleModifiedType {
|
|
14
15
|
ChangeAttribute = "ChangeAttribute",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppProps } from '@/App';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const LLMMultiWheelViewCls: string;
|
|
4
|
+
interface IProps {
|
|
5
|
+
path: string;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const LLMMultiWheelLayout: React.FC<AppProps & IProps>;
|
|
9
|
+
export default LLMMultiWheelLayout;
|