@labelbee/lb-components 1.22.0 → 1.23.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/answerList/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/determineGroup/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/scoreGroupButton/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/LLMToolView/utils/data.js +1 -1
- package/dist/components/NLPToolView/index.js +1 -0
- package/dist/components/NLPToolView/textContent/extraMask.js +1 -0
- package/dist/components/NLPToolView/textContent/index.js +1 -0
- package/dist/components/NLPToolView/utils/index.js +1 -0
- package/dist/components/messageMaskLayer/index.js +1 -0
- package/dist/components/tagList/components/overall/index.js +1 -0
- package/dist/components/tagList/components/portion/index.js +1 -0
- package/dist/components/tagList/index.js +1 -0
- package/dist/components/tagList/index.module.scss.js +1 -0
- package/dist/data/enums/ToolType.js +1 -1
- package/dist/hooks/annotation.js +1 -1
- package/dist/index.css +110 -0
- package/dist/index.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/store/ctx.js +1 -1
- package/dist/types/components/LLMToolView/index.d.ts +2 -0
- package/dist/types/components/LLMToolView/sidebar/components/answerList/index.d.ts +3 -10
- package/dist/types/components/LLMToolView/sidebar/components/answerSort/index.d.ts +1 -1
- package/dist/types/components/LLMToolView/sidebar/components/determineGroup/index.d.ts +1 -1
- package/dist/types/components/LLMToolView/sidebar/components/scoreGroupButton/index.d.ts +1 -1
- package/dist/types/components/LLMToolView/sidebar/components/textEditor/index.d.ts +1 -1
- package/dist/types/components/LLMToolView/sidebar/components/textInputBox/index.d.ts +1 -1
- package/dist/types/components/LLMToolView/sidebar/index.d.ts +1 -3
- package/dist/types/components/LLMToolView/types.d.ts +27 -0
- package/dist/types/components/LLMToolView/utils/data.d.ts +27 -0
- package/dist/types/components/NLPToolView/index.d.ts +16 -0
- package/dist/types/components/NLPToolView/textContent/extraMask.d.ts +12 -0
- package/dist/types/components/NLPToolView/textContent/index.d.ts +16 -0
- package/dist/types/components/NLPToolView/types.d.ts +82 -0
- package/dist/types/components/NLPToolView/utils/index.d.ts +2 -0
- package/dist/types/components/attributeList/index.d.ts +1 -1
- package/dist/types/components/messageMaskLayer/index.d.ts +11 -0
- package/dist/types/components/tagList/components/overall/index.d.ts +4 -0
- package/dist/types/components/tagList/components/portion/index.d.ts +4 -0
- package/dist/types/components/tagList/index.d.ts +4 -0
- package/dist/types/components/tagList/types.d.ts +23 -0
- package/dist/types/data/enums/ToolType.d.ts +2 -1
- package/dist/types/hooks/annotation.d.ts +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/store/ctx.d.ts +5 -0
- package/dist/types/views/MainView/NLPLayout/index.d.ts +13 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +1 -0
- package/dist/types/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.d.ts +13 -0
- package/dist/types/views/MainView/sidebar/NLPSidebar/index.d.ts +12 -0
- package/dist/types/views/MainView/sidebar/NLPSidebar/indicatorDetermine.d.ts +13 -0
- package/dist/types/views/MainView/sidebar/SwitchAttributeList/index.d.ts +2 -2
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/NLP/index.d.ts +6 -0
- package/dist/views/MainView/LLMLayout/index.js +1 -1
- package/dist/views/MainView/NLPLayout/index.js +1 -0
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -0
- package/dist/views/MainView/sidebar/NLPSidebar/index.js +1 -0
- package/dist/views/MainView/sidebar/NLPSidebar/indicatorDetermine.js +1 -0
- package/dist/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/LLM/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/NLP/index.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/components/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/answerList/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/determineGroup/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/scoreGroupButton/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/LLMToolView/sidebar/index.js +1 -1
- package/es/components/LLMToolView/utils/data.js +1 -1
- package/es/components/NLPToolView/index.js +1 -0
- package/es/components/NLPToolView/textContent/extraMask.js +1 -0
- package/es/components/NLPToolView/textContent/index.js +1 -0
- package/es/components/NLPToolView/utils/index.js +1 -0
- package/es/components/messageMaskLayer/index.js +1 -0
- package/es/components/tagList/components/overall/index.js +1 -0
- package/es/components/tagList/components/portion/index.js +1 -0
- package/es/components/tagList/index.js +1 -0
- package/es/components/tagList/index.module.scss.js +1 -0
- package/es/data/enums/ToolType.js +1 -1
- package/es/hooks/annotation.js +1 -1
- package/es/index.css +110 -0
- package/es/index.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/ctx.js +1 -1
- package/es/views/MainView/LLMLayout/index.js +1 -1
- package/es/views/MainView/NLPLayout/index.js +1 -0
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -0
- package/es/views/MainView/sidebar/NLPSidebar/index.js +1 -0
- package/es/views/MainView/sidebar/NLPSidebar/indicatorDetermine.js +1 -0
- package/es/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/LLM/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/NLP/index.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFormatSize as St}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Dt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as l}from"../Actions.js";import{jsonParser as U}from"../../utils/index.js";import W from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as vt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as rt,composeResult as Y}from"../../utils/data.js";import N from"../../utils/StepUtils.js";import J from"../../utils/ToolUtils.js";import{MathUtils as ut,CommonToolUtils as yt,AnnotationEngine as Rt,ImgUtils as Pt}from"@labelbee/lb-annotation";import{PointCloudUtils as at,i18n as F}from"@labelbee/lb-utils";import{Modal as ct}from"antd";import{message as dt}from"antd/es";import pt from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as _t}from"../../data/enums/ToolType.js";var Ct=Object.defineProperty,Ot=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,It=(t,e,r)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))bt.call(e,r)&&It(t,r,e[r]);if(gt)for(var r of gt(e))Ut.call(e,r)&&It(t,r,e[r]);return t},i=(t,e)=>Ot(t,ht(e)),mt=(t,e,r)=>new Promise((E,d)=>{var f=m=>{try{S(r.next(m))}catch(y){d(y)}},A=m=>{try{S(r.throw(m))}catch(y){d(y)}},S=m=>m.done?E(m.value):Promise.resolve(m.value).then(f,A);S((r=r.apply(t,e)).next())});const B=(t,e)=>t.find(r=>r.step===e),ft={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},Nt=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},Tt=(t,e)=>t.reduce((r,E)=>{if(E){const d=E.result;if(U(d)[`step_${e}`])return r+1}return r},0)/t.length,Bt=(t,e)=>{const{step:r,stepList:E}=t,d=N.getCurrentStepInfo(r,E),f=vt.jsonParser(d.config);if(J.isVideoTool(d==null?void 0:d.tool)||J.isAudioTool(d==null?void 0:d.tool)||J.isPointCloudTool(d==null?void 0:d.tool)||_t.LLM===(d==null?void 0:d.tool))return;const A=document.getElementById("toolContainer");if(!A)throw"Not exist dom named id-toolContainer";const S=St({width:window.innerWidth,height:window.innerHeight}),m=new Rt({container:A,toolName:d.tool,size:S,imgNode:e,config:f,style:JSON.parse(Dt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},wt=(t,e)=>(r,E)=>mt(void 0,null,function*(){var d;const{stepList:f,step:A}=E().annotation,S=N.currentToolIsVideo(A,f),m=N.currentToolIsPointCloud(A,f),y=((d=N.getCurrentStepInfo(A,f))==null?void 0:d.tool)===_t.LLM,O=N.currentToolIsAudio(A,f);if($(r,!0),yield r(xt(t)),S){r(Ft(t));return}if(m||y||O){r(jt(t));return}r(Gt(t,e))}),xt=t=>(e,r)=>mt(void 0,null,function*(){const{getFileData:E,imgList:d}=r().annotation;if(E){const f=yield E(d[t],t);e({type:l.SET_FILE_DATA,payload:{fileData:f,index:t}})}}),Ft=t=>e=>{e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},jt=t=>e=>{$(e,!1),e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},Gt=(t,e)=>(r,E)=>{var d;const{toolInstance:f,imgList:A}=E().annotation,S=(d=A==null?void 0:A[t])==null?void 0:d.url;Pt.load(S).then(m=>{$(r,!1),r({type:l.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),f==null||f.setErrorImg(),r({type:l.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Vt=({toolInstance:t,imgList:e,imgIndex:r,stepList:E,step:d=1})=>{var f,A,S,m;const y=((f=e[r])==null?void 0:f.result)||"",[O,j,G]=(A=t==null?void 0:t.exportData())!=null?A:[],V=(m=(S=t==null?void 0:t.exportCustomData)==null?void 0:S.call(t))!=null?m:{},M=rt(y,j),k=Y(M,{step:d,stepList:E},{rect:O},V);return e.map((w,H)=>H===r?n(i(n({},w),{result:k}),G):n({},w))},Mt=(t=n({},ft),e)=>{var r,E,d,f,A,S,m,y,O,j,G,V,M,k,w,H,X,q,Z,Q,tt,et,ot,nt,st;switch(e.type){case l.INIT_ALL_STATE:return n(n({},t),ft);case l.UPDATE_TOOL_INSTANCE:return i(n({},t),{toolInstance:e.payload.toolInstance});case l.UPDATE_IMG_LIST:return i(n({},t),{imgList:e.payload.imgList});case l.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=Tt(o,s);return i(n({},t),{stepProgress:u})}case l.SUBMIT_FILE_DATA:{const{imgList:o,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:T}=t;if(!p||!o[s])return t;const g=((r=o[s])==null?void 0:r.result)||"",[,_,I]=(E=p==null?void 0:p.exportData())!=null?E:[],L=(f=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?f:{},D=rt(g,_),R=Y(D,{step:u,stepList:a},{rect:T},L),v=t.imgList.map((C,P)=>{if(P===s){const x=W.dataCorrection(R,g,u,a);return n(i(n({},C),{result:x}),I)}return C});if(((A=e.payload)==null?void 0:A.submitType)===K.SyncImgList)return i(n({},t),{imgList:v});c&&c([v[s]],(S=e.payload)==null?void 0:S.submitType,s,v);const h=Tt(v,u);return i(n({},t),{stepProgress:h,imgList:v})}case l.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case l.SUBMIT_RESULT:{const{imgList:o,basicIndex:s,resultList:u,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let T=c;if((p==null?void 0:p.length)>0){const g=(y=p[s])==null?void 0:y.id,_=c.map(I=>i(n({},I),{sourceID:g}));T=pt.cloneDeep(u).filter(I=>I.sourceID!==g),T.push(..._)}return i(n({},t),{resultList:T,imgList:o})}case l.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:T,basicResultList:g}=t;if(!o||!c)return t;const _=e.payload.basicIndex,I=(O=g[_])==null?void 0:O.id,L=U((j=u[a])==null?void 0:j.result),D=(T||[]).filter(x=>x.sourceID===I),R=B(p,s),{dataSourceStep:v,tool:h}=R,C=B(p,v);let P=[];return v&&h&&(P=(G=L[`step_${v}`])==null?void 0:G.result,(P==null?void 0:P.length)>0?(c==null||c.setBasicInfo(C.tool,P[_]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),dt.info(F.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),i(n({},t),{basicIndex:_})}case l.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return i(n({},t),{triggerEventAfterIndexChanged:!!o})}case l.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return i(n({},t),{imgIndex:e.payload.nextIndex});const c=N.getCurrentStepInfo(s,p),{nextIndex:T,imgNode:g,nextBasicIndex:_,imgError:I}=e.payload,L=_!=null?_:0,D=U((V=o[T])==null?void 0:V.result),R=D[`step_${c.step}`],v=!R,h={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};g&&I!==!0?a==null||a.setImgNode(g,h):u==null||u.setValid(h.valid);const C=B(p,c.step),{dataSourceStep:P,tool:x}=C,lt=B(p,P),it=P&&x,b=(H=(w=D[`step_${P}`])==null?void 0:w.result)!=null?H:[],z=W.getInitialResultList(R==null?void 0:R.result,u,C,b,v);if(a==null||a.launchOperation(),it&&((b==null?void 0:b.length)>0?a==null||a.setBasicInfo(lt.tool,b[L]):(a==null||a.setBasicInfo(lt.tool),a==null||a.forbidOperation(),dt.info(F.t("NoDependency")))),c.tool!=="check"){const Lt=(q=(X=b[L])==null?void 0:X.id)!=null?q:"",Et=it?z.filter(At=>yt.isSameSourceID(At.sourceID,Lt)):z;(Z=u==null?void 0:u.history)==null||Z.initRecord(z,!0),u==null||u.setResult(Et)}return i(n({},t),{imgIndex:T,basicIndex:L,basicResultList:b,resultList:z})}case l.UPDATE_ANNOTATION_CONFIG:return i(n({},t),{config:(Q=e.payload.config)!=null?Q:"{}"});case l.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return i(n({},t),{stepList:o})}case l.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return i(n({},t),{stepList:o,step:s})}case l.INIT_TOOL:{const{imgNode:o}=t,s=Bt(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return i(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case l.SET_TOOL:{const o=(tt=e.payload)==null?void 0:tt.instance;return o?i(n({},t),{toolInstance:o}):n({},t)}case l.UPDATE_ON_SUBMIT:return i(n({},t),{onSubmit:e.payload.onSubmit});case l.UPDATE_ON_SAVE:return i(n({},t),{onSave:e.payload.onSave});case l.UPDATE_ON_PAGE_CHANGE:return i(n({},t),{onPageChange:e.payload.onPageChange});case l.SET_PREDICT_RESULT:return i(n({},t),{predictionResult:e.payload.result});case l.SET_PREDICT_RESULT_VISIBLE:return i(n({},t),{predictionResultVisible:e.payload.visible});case l.UPDATE_ON_STEP_CHANGE:return i(n({},t),{onStepChange:e.payload.onStepChange});case l.UPDATE_GET_FILE_DATA:return i(n({},t),{getFileData:e.payload.getFileData});case l.UPDATE_PAGE_SIZE:return i(n({},t),{pageSize:e.payload.pageSize});case l.UPDATE_LOAD_FILE_LIST:return i(n({},t),{loadFileList:e.payload.loadFileList});case l.UPDATE_BEFORE_ROTATE:return i(n({},t),{beforeRotate:e.payload.beforeRotate});case l.UPDATE_PRE_DATA_PROCESS:return i(n({},t),{preDataProcess:e.payload.preDataProcess});case l.SKIP_BEFORE_PAGE_TURNING:return i(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case l.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),i(n({},t),{imgList:a})}case l.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||(et=o==null?void 0:o.updateRotate)==null||et.call(o),t}case l.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(ot=o==null?void 0:o.valid)!=null?ot:!0;return ct.destroyAll(),ct.confirm({content:F.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:F.t("Confirm"),cancelText:F.t("Cancel")}),t}case l.COPY_BACKWARD_RESULT:{const{toolInstance:o,imgIndex:s,imgList:u,step:a}=t;if(!o)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const p=u[s-1].result;if(!p)return t;const c=W.copyResultChange(p,a,(nt=u[s].result)!=null?nt:"");u[s]=i(n({},u[s]),{result:c});const g=U(c)[`step_${a}`],_=(g==null?void 0:g.result)||[];return o==null||o.setResult(_),o==null||o.history.pushHistory(_),(st=o==null?void 0:o.asyncData)==null||st.call(o,u[s]),i(n({},t),{imgList:[...u]})}case l.SET_STEP:{const{stepList:o,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=B(o,u);return s==null||s.setToolName(a.tool,a.config),i(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case l.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return i(n({},t),{loadPCDFileLoading:!!o})}case l.SET_LOADING:{const{loading:o}=e.payload;return i(n({},t),{loading:!!o})}case l.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return i(n({},t),{pointCloudLoading:!!o})}case l.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return i(n({},t),{checkMode:!!o})}case l.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return i(n({},t),{highlightAttribute:o})}case l.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,T=[],g=a.map((_,I)=>{if(ut.isInRange(I,u)){const L=i(n({},_),{result:at.batchUpdateTrackID({id:o,newID:s,result:_.result})});return T.push({imgIndex:I,newInfo:L}),L}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:T}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,T=[],g=a.map((_,I)=>{if(ut.isInRange(I,u)){const L=i(n({},_),{result:at.batchUpdateResultByTrackID({id:o,newData:s,result:_.result})});return T.push({imgIndex:I,newInfo:L}),L}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:T}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:o,imgList:s,stepList:u,step:a,predictionResult:p}=t,c={};p.forEach(I=>{const{index:L}=I;c[L]=pt.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const T=`step_${a}`,g=[],_=s.map((I,L)=>{if(c[L]){const D=I.result==="{}"?U(Y("",{step:a,stepList:u},{rect:[]},{})):U(I.result);D[T].result.push(c[L]);const R=i(n({},I),{result:JSON.stringify(D)});return g.push({imgIndex:L,newInfo:R}),R}return I});return o==null||o(_,K.BatchUpdateImgList,-1,_,{updateImgList:g}),i(n({},t),{imgList:_})}default:return t}};export{wt as LoadFileAndFileData,Mt as annotationReducer,Vt as composeResultByToolInstance,B as getStepConfig,Nt as getTotalPage};
|
|
1
|
+
import{getFormatSize as At}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Dt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as l}from"../Actions.js";import{jsonParser as w}from"../../utils/index.js";import Y from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as vt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as ut,composeResult as J}from"../../utils/data.js";import O from"../../utils/StepUtils.js";import X from"../../utils/ToolUtils.js";import{MathUtils as at,CommonToolUtils as yt,AnnotationEngine as Pt,ImgUtils as Rt}from"@labelbee/lb-annotation";import{PointCloudUtils as ct,i18n as G}from"@labelbee/lb-utils";import{Modal as dt}from"antd";import{message as pt}from"antd/es";import _t from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as W}from"../../data/enums/ToolType.js";var Ct=Object.defineProperty,Ot=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,It=(t,e,r)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))bt.call(e,r)&&It(t,r,e[r]);if(gt)for(var r of gt(e))Nt.call(e,r)&&It(t,r,e[r]);return t},i=(t,e)=>Ot(t,ht(e)),mt=(t,e,r)=>new Promise((S,d)=>{var A=m=>{try{T(r.next(m))}catch(y){d(y)}},f=m=>{try{T(r.throw(m))}catch(y){d(y)}},T=m=>m.done?S(m.value):Promise.resolve(m.value).then(A,f);T((r=r.apply(t,e)).next())});const x=(t,e)=>t.find(r=>r.step===e),ft={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},Ut=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},Tt=(t,e)=>t.reduce((r,S)=>{if(S){const d=S.result;if(w(d)[`step_${e}`])return r+1}return r},0)/t.length,Bt=(t,e)=>{const{step:r,stepList:S}=t,d=O.getCurrentStepInfo(r,S),A=vt.jsonParser(d.config);if(X.isVideoTool(d==null?void 0:d.tool)||X.isAudioTool(d==null?void 0:d.tool)||X.isPointCloudTool(d==null?void 0:d.tool)||[W.LLM,W.NLP].includes(d==null?void 0:d.tool))return;const f=document.getElementById("toolContainer");if(!f)throw"Not exist dom named id-toolContainer";const T=At({width:window.innerWidth,height:window.innerHeight}),m=new Pt({container:f,toolName:d.tool,size:T,imgNode:e,config:A,style:JSON.parse(Dt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},wt=(t,e)=>(r,S)=>mt(void 0,null,function*(){var d,A;const{stepList:f,step:T}=S().annotation,m=O.currentToolIsVideo(T,f),y=O.currentToolIsPointCloud(T,f),h=((d=O.getCurrentStepInfo(T,f))==null?void 0:d.tool)===W.LLM,b=((A=O.getCurrentStepInfo(T,f))==null?void 0:A.tool)===W.NLP,N=O.currentToolIsAudio(T,f);if($(r,!0),yield r(xt(t)),m){r(Ft(t));return}if(y||h||N||b){r(jt(t));return}r(Gt(t,e))}),xt=t=>(e,r)=>mt(void 0,null,function*(){const{getFileData:S,imgList:d}=r().annotation;if(S){const A=yield S(d[t],t);e({type:l.SET_FILE_DATA,payload:{fileData:A,index:t}})}}),Ft=t=>e=>{e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},jt=t=>e=>{$(e,!1),e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},Gt=(t,e)=>(r,S)=>{var d;const{toolInstance:A,imgList:f}=S().annotation,T=(d=f==null?void 0:f[t])==null?void 0:d.url;Rt.load(T).then(m=>{$(r,!1),r({type:l.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),A==null||A.setErrorImg(),r({type:l.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Vt=({toolInstance:t,imgList:e,imgIndex:r,stepList:S,step:d=1})=>{var A,f,T,m;const y=((A=e[r])==null?void 0:A.result)||"",[h,b,N]=(f=t==null?void 0:t.exportData())!=null?f:[],V=(m=(T=t==null?void 0:t.exportCustomData)==null?void 0:T.call(t))!=null?m:{},M=ut(y,b),k=J(M,{step:d,stepList:S},{rect:h},V);return e.map((F,H)=>H===r?n(i(n({},F),{result:k}),N):n({},F))},Mt=(t=n({},ft),e)=>{var r,S,d,A,f,T,m,y,h,b,N,V,M,k,F,H,q,Z,Q,tt,et,ot,nt,st,lt;switch(e.type){case l.INIT_ALL_STATE:return n(n({},t),ft);case l.UPDATE_TOOL_INSTANCE:return i(n({},t),{toolInstance:e.payload.toolInstance});case l.UPDATE_IMG_LIST:return i(n({},t),{imgList:e.payload.imgList});case l.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=Tt(o,s);return i(n({},t),{stepProgress:u})}case l.SUBMIT_FILE_DATA:{const{imgList:o,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:L}=t;if(!p||!o[s])return t;const g=((r=o[s])==null?void 0:r.result)||"",[,_,I]=(S=p==null?void 0:p.exportData())!=null?S:[],E=(A=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?A:{},D=ut(g,_),P=J(D,{step:u,stepList:a},{rect:L},E),v=t.imgList.map((C,R)=>{if(R===s){const j=Y.dataCorrection(P,g,u,a);return n(i(n({},C),{result:j}),I)}return C});if(((f=e.payload)==null?void 0:f.submitType)===K.SyncImgList)return i(n({},t),{imgList:v});c&&c([v[s]],(T=e.payload)==null?void 0:T.submitType,s,v);const U=Tt(v,u);return i(n({},t),{stepProgress:U,imgList:v})}case l.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case l.SUBMIT_RESULT:{const{imgList:o,basicIndex:s,resultList:u,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let L=c;if((p==null?void 0:p.length)>0){const g=(y=p[s])==null?void 0:y.id,_=c.map(I=>i(n({},I),{sourceID:g}));L=_t.cloneDeep(u).filter(I=>I.sourceID!==g),L.push(..._)}return i(n({},t),{resultList:L,imgList:o})}case l.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:L,basicResultList:g}=t;if(!o||!c)return t;const _=e.payload.basicIndex,I=(h=g[_])==null?void 0:h.id,E=w((b=u[a])==null?void 0:b.result),D=(L||[]).filter(j=>j.sourceID===I),P=x(p,s),{dataSourceStep:v,tool:U}=P,C=x(p,v);let R=[];return v&&U&&(R=(N=E[`step_${v}`])==null?void 0:N.result,(R==null?void 0:R.length)>0?(c==null||c.setBasicInfo(C.tool,R[_]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),pt.info(G.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),i(n({},t),{basicIndex:_})}case l.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return i(n({},t),{triggerEventAfterIndexChanged:!!o})}case l.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return i(n({},t),{imgIndex:e.payload.nextIndex});const c=O.getCurrentStepInfo(s,p),{nextIndex:L,imgNode:g,nextBasicIndex:_,imgError:I}=e.payload,E=_!=null?_:0,D=w((V=o[L])==null?void 0:V.result),P=D[`step_${c.step}`],v=!P,U={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};g&&I!==!0?a==null||a.setImgNode(g,U):u==null||u.setValid(U.valid);const C=x(p,c.step),{dataSourceStep:R,tool:j}=C,it=x(p,R),rt=R&&j,B=(H=(F=D[`step_${R}`])==null?void 0:F.result)!=null?H:[],z=Y.getInitialResultList(P==null?void 0:P.result,u,C,B,v);if(a==null||a.launchOperation(),rt&&((B==null?void 0:B.length)>0?a==null||a.setBasicInfo(it.tool,B[E]):(a==null||a.setBasicInfo(it.tool),a==null||a.forbidOperation(),pt.info(G.t("NoDependency")))),c.tool!=="check"){const Lt=(Z=(q=B[E])==null?void 0:q.id)!=null?Z:"",Et=rt?z.filter(St=>yt.isSameSourceID(St.sourceID,Lt)):z;(Q=u==null?void 0:u.history)==null||Q.initRecord(z,!0),u==null||u.setResult(Et)}return i(n({},t),{imgIndex:L,basicIndex:E,basicResultList:B,resultList:z})}case l.UPDATE_ANNOTATION_CONFIG:return i(n({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case l.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return i(n({},t),{stepList:o})}case l.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return i(n({},t),{stepList:o,step:s})}case l.INIT_TOOL:{const{imgNode:o}=t,s=Bt(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return i(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case l.SET_TOOL:{const o=(et=e.payload)==null?void 0:et.instance;return o?i(n({},t),{toolInstance:o}):n({},t)}case l.UPDATE_ON_SUBMIT:return i(n({},t),{onSubmit:e.payload.onSubmit});case l.UPDATE_ON_SAVE:return i(n({},t),{onSave:e.payload.onSave});case l.UPDATE_ON_PAGE_CHANGE:return i(n({},t),{onPageChange:e.payload.onPageChange});case l.SET_PREDICT_RESULT:return i(n({},t),{predictionResult:e.payload.result});case l.SET_PREDICT_RESULT_VISIBLE:return i(n({},t),{predictionResultVisible:e.payload.visible});case l.UPDATE_ON_STEP_CHANGE:return i(n({},t),{onStepChange:e.payload.onStepChange});case l.UPDATE_GET_FILE_DATA:return i(n({},t),{getFileData:e.payload.getFileData});case l.UPDATE_PAGE_SIZE:return i(n({},t),{pageSize:e.payload.pageSize});case l.UPDATE_LOAD_FILE_LIST:return i(n({},t),{loadFileList:e.payload.loadFileList});case l.UPDATE_BEFORE_ROTATE:return i(n({},t),{beforeRotate:e.payload.beforeRotate});case l.UPDATE_PRE_DATA_PROCESS:return i(n({},t),{preDataProcess:e.payload.preDataProcess});case l.SKIP_BEFORE_PAGE_TURNING:return i(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case l.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),i(n({},t),{imgList:a})}case l.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||(ot=o==null?void 0:o.updateRotate)==null||ot.call(o),t}case l.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(nt=o==null?void 0:o.valid)!=null?nt:!0;return dt.destroyAll(),dt.confirm({content:G.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:G.t("Confirm"),cancelText:G.t("Cancel")}),t}case l.COPY_BACKWARD_RESULT:{const{toolInstance:o,imgIndex:s,imgList:u,step:a}=t;if(!o)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const p=u[s-1].result;if(!p)return t;const c=Y.copyResultChange(p,a,(st=u[s].result)!=null?st:"");u[s]=i(n({},u[s]),{result:c});const g=w(c)[`step_${a}`],_=(g==null?void 0:g.result)||[];return o==null||o.setResult(_),o==null||o.history.pushHistory(_),(lt=o==null?void 0:o.asyncData)==null||lt.call(o,u[s]),i(n({},t),{imgList:[...u]})}case l.SET_STEP:{const{stepList:o,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=x(o,u);return s==null||s.setToolName(a.tool,a.config),i(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case l.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return i(n({},t),{loadPCDFileLoading:!!o})}case l.SET_LOADING:{const{loading:o}=e.payload;return i(n({},t),{loading:!!o})}case l.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return i(n({},t),{pointCloudLoading:!!o})}case l.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return i(n({},t),{checkMode:!!o})}case l.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return i(n({},t),{highlightAttribute:o})}case l.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=i(n({},_),{result:ct.batchUpdateTrackID({id:o,newID:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=i(n({},_),{result:ct.batchUpdateResultByTrackID({id:o,newData:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:o,imgList:s,stepList:u,step:a,predictionResult:p}=t,c={};p.forEach(I=>{const{index:E}=I;c[E]=_t.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const L=`step_${a}`,g=[],_=s.map((I,E)=>{if(c[E]){const D=I.result==="{}"?w(J("",{step:a,stepList:u},{rect:[]},{})):w(I.result);D[L].result.push(c[E]);const P=i(n({},I),{result:JSON.stringify(D)});return g.push({imgIndex:E,newInfo:P}),P}return I});return o==null||o(_,K.BatchUpdateImgList,-1,_,{updateImgList:g}),i(n({},t),{imgList:_})}default:return t}};export{wt as LoadFileAndFileData,Mt as annotationReducer,Vt as composeResultByToolInstance,x as getStepConfig,Ut as getTotalPage};
|
package/es/store/ctx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{createDispatchHook as o,createSelectorHook as s}from"react-redux";const t=e.createContext(void 0),r=o(t),c=s(t),n=e.createContext({hoverKey:-1,newAnswerList:[],setHoverKey:()=>{},modelAPIResponse:[],setModelAPIResponse:()=>{},setNewAnswerList:()=>{}}),a=e.createContext({highlightKey:"",setHighlightKey:()=>{}});export{n as LLMContext,t as LabelBeeContext,a as NLPContext,r as useDispatch,c as useSelector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{prefix as
|
|
1
|
+
import{prefix as s}from"../../../constant/index.js";import{Layout as m}from"antd/es";import t,{useState as o,useMemo as f}from"react";import y from"../sidebar/index.js";import v from"../toolFooter/index.js";import{getClassName as w}from"../../../utils/dom.js";import{classnames as M}from"../../../utils/index.js";import{LLMContext as x}from"../../../store/ctx.js";import h from"../../../components/LLMToolView/index.js";const{Sider:_,Content:j}=m,d=`${s}-layout`,E=e=>{var l,r;const[a,c]=o(-1),[n,u]=o([]),[i,L]=o([]);return t.createElement(m,{className:w("layout","container")},t.createElement(x.Provider,{value:f(()=>({hoverKey:a,setHoverKey:c,modelAPIResponse:n,setModelAPIResponse:u,newAnswerList:i,setNewAnswerList:L}),[a,n,i])},e==null?void 0:e.leftSider,t.createElement(j,{className:M({[`${d}__content`]:!0,[`${s}-LLMLayout`]:!0})},t.createElement(h,{checkMode:e.checkMode,showTips:e.showTips,tips:e.tips,drawLayerSlot:e.drawLayerSlot}),t.createElement(v,{style:(l=e.style)==null?void 0:l.footer,mode:e.mode,footer:e==null?void 0:e.footer})),t.createElement(_,{className:`${d}__side`,width:600,style:{position:"relative"}},t.createElement(y,{sider:e==null?void 0:e.sider,checkMode:e==null?void 0:e.checkMode}),(r=e.drawLayerSlot)==null?void 0:r.call(e,{}))))};export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{prefix as l}from"../../../constant/index.js";import{Layout as i}from"antd/es";import t,{useState as d,useMemo as c}from"react";import u from"../sidebar/index.js";import s from"../toolFooter/index.js";import{getClassName as f}from"../../../utils/dom.js";import{classnames as h}from"../../../utils/index.js";import{NLPContext as v}from"../../../store/ctx.js";import y from"../../../components/NLPToolView/index.js";const{Sider:x,Content:L}=i,m=`${l}-layout`,N=e=>{var o,a;const[n,r]=d("");return t.createElement(i,{className:f("layout","container")},t.createElement(v.Provider,{value:c(()=>({highlightKey:n,setHighlightKey:r}),[n])},e==null?void 0:e.leftSider,t.createElement(L,{className:h({[`${m}__content`]:!0,[`${l}-NLPLayout`]:!0})},t.createElement(y,{checkMode:e.checkMode,showTips:e.showTips,tips:e.tips,extraLayer:e==null?void 0:e.extraLayer,extraData:e==null?void 0:e.extraData,onChangeAnnotation:e==null?void 0:e.onChangeAnnotation,customAnnotationData:e==null?void 0:e.customAnnotationData}),t.createElement(s,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer})),t.createElement(x,{className:`${m}__side`,width:400,style:{position:"relative"}},t.createElement(u,{sider:e==null?void 0:e.sider,checkMode:e==null?void 0:e.checkMode}),(a=e.drawLayerSlot)==null?void 0:a.call(e,{}))))};export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as
|
|
1
|
+
import{ViewportProvider as b}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as A}from"antd";import{Layout as y}from"antd/es";import t,{useState as O}from"react";import V from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import k from"./sidebar/index.js";import h from"./toolFooter/index.js";import F from"./toolHeader/index.js";import{getStepConfig as E}from"../../store/annotation/reducer.js";import I from"../../components/videoAnnotate/index.js";import{connect as $}from"react-redux";import g from"../../utils/ToolUtils.js";import H from"../../components/pointCloudView/index.js";import{getClassName as R}from"../../utils/dom.js";import{classnames as W}from"../../utils/index.js";import B from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as D}from"../../store/ctx.js";import{EToolName as c}from"../../data/enums/ToolType.js";import U from"./LLMLayout/index.js";import z from"./NLPLayout/index.js";import q from"../../components/audioAnnotate/index.js";import{LoadingOutlined as G}from"@ant-design/icons";import{useTranslation as J}from"react-i18next";import{EPointCloudName as K}from"@labelbee/lb-annotation";var Q=Object.defineProperty,T=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,P=(e,o,n)=>o in e?Q(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,i=(e,o)=>{for(var n in o||(o={}))X.call(o,n)&&P(e,n,o[n]);if(T)for(var n of T(o))Y.call(o,n)&&P(e,n,o[n]);return e};const{Sider:Z,Content:p}=y,u=`${C}-layout`,ee=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(V,i({},e)),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},te=e=>{var o;return t.createElement(t.Fragment,null,t.createElement(H,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},oe=e=>{var o;const{stepList:n,step:r}=e,a=(o=E(n,r))==null?void 0:o.tool,m=g.isPointCloudTool(a),l=g.isVideoTool(a);return m?t.createElement(te,i({},e)):l?t.createElement(I,{drawLayerSlot:e.drawLayerSlot,footer:e.footer}):t.createElement(ee,i({},e))},f=e=>{var o,n,r;const{t:a}=J(),{stepList:m,step:l}=e,d=(o=E(m,l))==null?void 0:o.tool,s=![c.LLM,c.NLP].includes(d),v=![c.LLM,c.NLP].includes(d),L=[K.PointCloud].includes(d);return t.createElement(b,null,t.createElement(A,{spinning:e.loading,indicator:t.createElement(G,null),tip:t.createElement("span",{style:{marginTop:200}},a("LoadingTips")),delay:500},t.createElement(y,{className:W([u,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${u}__header`,style:(r=e.style)==null?void 0:r.header},t.createElement(F,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:s,hasHeaderOption:v,hasPredictTrackingIcon:L})),e.children)))},ne=e=>{var o,n,r,a,m,l,d;const[s,v]=O(void 0),L=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:x,step:N}=e,_=(r=E(x,N))==null?void 0:r.tool,j=c.LLM===_,w=c.NLP===_,S=g.isAudioTool(_);return j?t.createElement(f,i({},e),t.createElement(U,i({},e))):w?t.createElement(f,i({},e),t.createElement(z,i({},e))):S?t.createElement(f,i({},e),t.createElement(q,i({},e))):t.createElement(f,i({},e),t.createElement(y,{className:R("layout","container")},e==null?void 0:e.leftSider,t.createElement(p,{className:`${u}__content`},t.createElement(oe,i({},e)),t.createElement(B,null)),t.createElement(Z,{className:`${u}__side`,width:(a=s!=null?s:L)!=null?a:240,style:(m=e.style)==null?void 0:m.sider},t.createElement(k,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:v,propsSiderWidth:(d=(l=e.style)==null?void 0:l.sider)==null?void 0:d.width}))))},le=({annotation:e})=>{var o,n,r;const{imgList:a,loading:m}=e,l=(o=a[e.imgIndex])!=null?o:{};return{path:(r=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?r:"",loading:m}};var ie=$(le,null,null,{context:D})(ne);export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s,{useState as
|
|
1
|
+
import s,{useState as d,useCallback as B}from"react";import{connect as g}from"react-redux";import I from"../../../../utils/StepUtils.js";import{jsonParser as v}from"../../../../utils/index.js";import C from"./ActionsConfirm.js";import y from"./useOperationList.js";import{LabelBeeContext as S}from"../../../../store/ctx.js";import U from"../../../../assets/annotation/pointCloudTool/unitAttribute.svg.js";import w from"../../../../assets/annotation/pointCloudTool/unitAttributeForbid.svg.js";import T from"../../../../assets/annotation/pointCloudTool/unitAttributeHover.svg.js";import{useTranslation as V}from"react-i18next";import A from"../../../../components/pointCloudView/components/UnifyParamsModal/index.js";import{useSingleBox as E}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{composeResultByToolInstance as M}from"../../../../store/annotation/reducer.js";import{useStatus as _}from"../../../../components/pointCloudView/hooks/useStatus.js";const x=o=>{var t,i;const n=I.getCurrentStepInfo((t=o.annotation)==null?void 0:t.step,(i=o.annotation)==null?void 0:i.stepList);return{toolInstance:o.annotation.toolInstance,stepInfo:n,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:o.annotation.stepList}},R=({toolInstance:o,stepInfo:t,hideValidity:i})=>{const n=y(o),r=v(t==null?void 0:t.config),e=[n.empty];return(t==null?void 0:t.dataSourceStep)===0&&!i&&e.push(n.setValidity),(r==null?void 0:r.copyBackwardResult)&&e.push(n.copyPrevious),s.createElement(C,{allOperation:e})},$=g(x,null,null,{context:S})(({toolInstance:o,stepInfo:t,imgList:i,stepList:n,imgIndex:r})=>{const{t:e}=V(),{selectedBox:m}=E(),u=y(o),[P,c]=d(!1),[j,L]=d([]),{isPointCloudDetectionPattern:b,isPointCloudSegmentationPattern:k}=_(),p=v(t.config);let a=[u.copyPrevious,u.empty,u.setValidity];if(b&&p.trackConfigurable===!0){const l=!m,O={name:e("UnifyParams"),key:"UnifyParams",imgSvg:l?w:U,hoverSvg:T,onClick:()=>{L(M({toolInstance:o,imgList:i,imgIndex:r,stepList:n})),c(!0)},forbidConfirm:!0,forbidOperation:l};a.unshift(O)}const h=B(()=>{c(!1)},[]),f=m==null?void 0:m.info;return k&&(a=a.filter(l=>!["setValidity","copyPrevious"].includes(l.key))),s.createElement(s.Fragment,null,s.createElement(C,{allOperation:a}),s.createElement(A,{id:f==null?void 0:f.trackID,visible:P,onCancel:h,config:p,imgList:j}))});var D=g(x,null,null,{context:S})(R);export{$ as PointCloudOperation,D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a,{useState as g,useRef as E,useEffect as $}from"react";import{connect as S}from"react-redux";import j from"../../../../utils/StepUtils.js";import{useTranslation as I}from"react-i18next";import{LabelBeeContext as w}from"../../../../store/ctx.js";import{prefix as P}from"../../../../constant/index.js";import{jsonParser as T,classnames as D}from"../../../../utils/index.js";import{Tooltip as R,Popconfirm as F}from"antd";import{CloseOutlined as H}from"@ant-design/icons";var k=Object.defineProperty,K=Object.defineProperties,U=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,b=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t)=>{for(var n in t||(t={}))B.call(t,n)&&b(e,n,t[n]);if(x)for(var n of x(t))M.call(t,n)&&b(e,n,t[n]);return e},q=(e,t)=>K(e,U(t));const l=`${P}-sidebar`,z=(e,t)=>{const n=(e==null?void 0:e.attributeList)||[];return t.map(s=>{var p,u;const o=((u=(p=n.filter(m=>m.value===s.attribute))==null?void 0:p[0])==null?void 0:u.key)||"";return q(V({},s),{label:o})})},G=e=>{var t,n;const[s,p]=g(0),u=E(null),{toolInstance:o,checkMode:m,stepInfo:h}=e,{t:c}=I(),L=T(h.config),[f,y]=g("");$(()=>(o&&o.on("changeAttributeSidebar",r=>{p(i=>i+1)}),()=>{o==null||o.unbindAll("changeAttributeSidebar")}),[o,u]);const[v]=o.exportData(),C=(n=(t=v==null?void 0:v[0])==null?void 0:t.textAnnotation)!=null?n:[],_=z(L,C),N=r=>{let i=r===f?"":r;o==null||o.setHighlightKey(i),y(i)},O=r=>{o==null||o.deleteTextAnnotation(r.id)};return(_==null?void 0:_.length)===0?null:a.createElement("div",{className:`${l}__content__NLPList`},_.map((r,i)=>{const A=f===r.id;return a.createElement("div",{key:i,className:D({[`${l}__content__NLPList__item`]:!0,[`${l}__content__NLPList__item__active`]:A}),onClick:()=>N(r.id)},a.createElement("span",{className:`${l}__content__NLPList__item__text`},a.createElement(R,{title:r.text,overlayInnerStyle:{maxHeight:"400px",overflow:"auto"}},a.createElement("span",null,`${r.label||c("NoAttribute")}\uFF0C${c("textTool")}\uFF1A${r.text}`))),!m&&a.createElement(F,{title:c("DeleteCommentConfirm"),placement:"topRight",okText:c("Confirm"),cancelText:c("Cancel"),getPopupContainer:d=>d.parentElement,onConfirm:()=>O(r),overlayClassName:`${P}-pop-confirm`},a.createElement(H,{className:`${l}-pop-remove`,onClick:d=>{d.stopPropagation()}})))}))},J=e=>{var t,n;const s=j.getCurrentStepInfo((t=e.annotation)==null?void 0:t.step,(n=e.annotation)==null?void 0:n.stepList);return{toolInstance:e.annotation.toolInstance,stepInfo:s}};var Q=S(J,null,null,{context:w})(G);export{Q as default,l as sidebarCls};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";import{connect as i}from"react-redux";import{LabelBeeContext as o}from"../../../../store/ctx.js";import{prefix as a}from"../../../../constant/index.js";import l from"../SwitchAttributeList/index.js";import m from"../GeneralOperation/index.js";import s from"./NLPAnnotatedList.js";import c from"./indicatorDetermine.js";const d=({checkMode:e})=>e?null:t.createElement(l,null),r=`${a}-sidebar`,u=({toolInstance:e,checkMode:n})=>t.createElement("div",{className:`${r}`},t.createElement("div",{className:`${r}__content`},t.createElement(c,{disabeledAll:n}),t.createElement(d,{checkMode:n}),t.createElement(s,{checkMode:n})),!n&&t.createElement(m,{hideValidity:!0}));function p(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex}}var f=i(p,null,null,{context:o})(u);export{f as default,r as sidebarCls};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import c,{useState as I,useEffect as D}from"react";import{connect as j}from"react-redux";import h from"../../../../utils/StepUtils.js";import{useTranslation as R}from"react-i18next";import{LabelBeeContext as S}from"../../../../store/ctx.js";import{jsonParser as E}from"../../../../utils/index.js";import V from"../../../../components/LLMToolView/sidebar/components/determineGroup/index.js";import{getCurrentResultFromResultList as C}from"../../../../components/LLMToolView/utils/data.js";var T=Object.defineProperty,A=Object.defineProperties,B=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,P=(t,e,n)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_=(t,e)=>{for(var n in e||(e={}))G.call(e,n)&&P(t,n,e[n]);if(y)for(var n of y(e))H.call(e,n)&&P(t,n,e[n]);return t},M=(t,e)=>A(t,B(e));const U=t=>{const{toolInstance:e,stepInfo:n,disabeledAll:u,imgIndex:p,imgList:d}=t,[g]=e.exportData(),[a,x]=I(g==null?void 0:g[0]),{t:L}=R(),[F,O]=I(0);D(()=>{var o;if(!d[p])return;const r=(o=d[p])!=null?o:{},i=C((r==null?void 0:r.result)||"");x(i)},[p,d]),D(()=>(e&&e.on("changeIndicatorDetermine",o=>{const[r]=e.exportData();x(r==null?void 0:r[0]),O(i=>i+1)}),()=>{e==null||e.unbindAll("changeIndicatorDetermine")}),[e]);const b=E(n.config),{indicatorDetermine:m}=b,w=o=>{var r;const{value:i,key:l}=o;if(l){const f={[l]:i},s=(r=a==null?void 0:a.indicatorDetermine)!=null?r:{},v=M(_({},a),{indicatorDetermine:_(_({},s),f)});e.updateResult(v)}};if((m==null?void 0:m.length)>0){const o=m.filter(r=>r==null?void 0:r.label);return c.createElement("div",{style:{padding:"12px",marginBottom:"12px"}},c.createElement("div",{style:{fontSize:"16px",fontWeight:500,lineHeight:"46px"}},L("IndicatorJudgment")),c.createElement("div",{style:{maxHeight:"400px",overflow:"auto"}},o.map((r,i)=>{var l;const{label:f,value:s}=r;return c.createElement(V,{selectValue:(l=a==null?void 0:a.indicatorDetermine)==null?void 0:l[s],title:f,updateValue:v=>{w({key:s,value:v})},key:i,disabeledAll:u})})))}return null},k=t=>{var e,n;const u=h.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(n=t.annotation)==null?void 0:n.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:u,imgIndex:t.annotation.imgIndex,imgList:t.annotation.imgList}};var z=j(k,null,null,{context:S})(U);export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m,{useState as p,useRef as v,useEffect as L}from"react";import{connect as A}from"react-redux";import S from"../../../../components/attributeList/index.js";import g from"../../../../utils/StepUtils.js";import{jsonParser as I}from"../../../../utils/index.js";import{useTranslation as h}from"react-i18next";import{EToolName as x}from"../../../../data/enums/ToolType.js";import{LabelBeeContext as T}from"../../../../store/ctx.js";const _=e=>{var r;const[a,l]=p(0),u=v(null),{toolInstance:t}=e,{t:f}=h(),b=o=>{t==null||t.setAttributeLockList(o)};if(L(()=>(t&&t.singleOn("changeAttributeSidebar",o=>{var s;l(n=>n+1),!!u.current&&((s=u.current.children[o])==null||s.scrollIntoView({block:"center"}))}),()=>{t==null||t.unbindAll("changeAttributeSidebar")}),[t,u]),!e.stepInfo)return null;const i=I(e.stepInfo.config),c=e.stepInfo.tool===x.ScribbleTool;if(i.attributeConfigurable!==!0&&!c)return null;if((i.attributeConfigurable===!0||c)&&(i==null?void 0:i.attributeList)){const o=i.attributeList.map(n=>({label:n.key,value:n.value,color:n==null?void 0:n.color}));c||o.unshift({label:f("NoAttribute"),value:""});const s=n=>{t&&(t.setDefaultAttribute(n),l(d=>d+1))};return m.createElement(S,{list:o,attributeChanged:s,selectedAttribute:(r=t==null?void 0:t.defaultAttribute)!=null?r:"",ref:u,attributeLockChange:b})}return null},j=e=>{var r,a;const l=g.getCurrentStepInfo((r=e.annotation)==null?void 0:r.step,(a=e.annotation)==null?void 0:a.stepList);return{toolInstance:e.annotation.toolInstance,stepInfo:l}};var C=A(j,null,null,{context:T})(_);export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{prefix as
|
|
1
|
+
import{prefix as M}from"../../../constant/index.js";import{EToolName as o}from"../../../data/enums/ToolType.js";import R from"../../../utils/StepUtils.js";import{Collapse as d}from"antd/es";import e,{useState as z}from"react";import{useTranslation as D}from"react-i18next";import G from"./AnnotationText/index.js";import U from"./ClearIcon/index.js";import q,{PointCloudOperation as _}from"./GeneralOperation/index.js";import H from"./ImgAttributeInfo/index.js";import J from"./SwitchAttributeList/index.js";import u,{expandIconFuc as L}from"./TagSidebar/index.js";import p from"./TextToolSidebar/index.js";import $ from"./PointCloudToolSidebar/index.js";import Q from"./ToolStyle/index.js";import{cTool as W}from"@labelbee/lb-annotation";import X from"./ScribbleSidebar/index.js";import{ToolIcons as Y}from"./ToolIcons.js";import{useSelector as Z}from"../../../store/ctx.js";import{Tabs as I}from"antd";import{classnames as ee}from"../../../utils/index.js";import P from"../../../assets/annotation/common/icon_menu_fold.svg.js";import te from"../../../components/LLMToolView/sidebar/index.js";import ne from"./NLPSidebar/index.js";import oe from"../../../components/videoAnnotate/videoClipTool/components/annotatedList/index.js";const{EVideoToolName:f,EPointCloudName:re}=W,{Panel:A}=d,t=`${M}-sidebar`,ie=({sider:l,enableColorPicker:w,setSiderWidth:E,propsSiderWidth:le,checkMode:b})=>{const x=Z(r=>R.getCurrentStepInfo(r.annotation.step,r.annotation.stepList)),[c,V]=z(!0),n=x==null?void 0:x.tool,{t:S}=D();if(!n)return null;const k=r=>{const s=e.createElement(Q,null);return e.createElement(A,{header:S("Style"),className:"panel",key:r},s)},T=e.createElement(Y,{toolName:n,onChange:()=>{}}),a=e.createElement(J,null),g=e.createElement(G,null),N=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:L},k("1")),v=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:L},e.createElement(A,{header:e.createElement("div",null,S("Adjust"),e.createElement(U,null)),className:"panel",key:"imgAttribute"},e.createElement(H,null))),i=e.createElement(q,null),B=e.createElement(u,null),O=r=>e.createElement(p,{disabled:r}),h=e.createElement(X,{onChange:(r,s)=>{}}),C=e.createElement(oe,null),y=e.createElement(te,{checkMode:b}),j=e.createElement(ne,{checkMode:b}),m=e.createElement("div",{className:`${t}__horizontal`}),F=e.createElement($,{enableColorPicker:w}),K=e.createElement(_,null);if(l)return typeof l=="function"?e.createElement("div",{className:`${t}`},l({toolIcon:T,attributeList:a,annotationText:g,toolStyle:N,imageAttributeInfo:v,operation:i,tagToolSideBar:B,textToolSideBar:O,horizontal:m,pointCloudToolSidebar:F,pointCloudOperation:K,scribbleSidebar:h,LLMSidebar:y,videoClipSidebar:C,NLPSidebar:j})):l;if([o.Rect,o.Point,o.Line,o.Rect,o.Polygon,o.Cuboid].includes(n))return e.createElement("div",{className:`${t}`},T,m,a,g,m,e.createElement("div",{className:`${t}__content`},N,v),i);if(n===o.Tag)return e.createElement("div",{className:`${t}`},e.createElement(u,null));if(n===f.VideoClipTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},C,a),i);if(n===f.VideoTagTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(u,null)),i);if(n===f.VideoTextTool)return e.createElement("div",{className:`${t}`},e.createElement(p,null));if(n===o.Text)return e.createElement("div",{className:`${t}`},"s",e.createElement(p,null));if(n===re.PointCloud){const r=()=>{V(!c),E&&E(c?48:void 0)},s=e.createElement("div",{style:{width:"48px",height:"100%",display:"flex",justifyContent:"center",background:"#ffffff"}},e.createElement("span",{onClick:()=>r()},e.createElement("img",{style:{width:"16px",height:"16px",marginTop:"18px",cursor:"pointer",transform:"rotate(180deg)"},src:P})));return c?e.createElement(I,{type:"card",activeKey:"1",className:ee({[`${t}`]:!0,[`${t}__pointCloud`]:!0}),tabBarExtraContent:{left:e.createElement("span",{onClick:()=>r(),style:{padding:"0px 4px"}},e.createElement("img",{style:{width:"16px",height:"16px",marginLeft:"4px",cursor:"pointer"},src:P}))}},e.createElement(I.TabPane,{tab:"\u5DE5\u5177\u9762\u677F",key:"1",style:{height:"100%",display:"flex",flexDirection:"column"}},e.createElement("div",{className:`${t}__content`},e.createElement($,null)),e.createElement(_,null))):s}return n===o.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},h,a),i):n===o.LLM?y:n===o.NLP?j:null};export{ie as default,t as sidebarCls};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{setValid as t,backward as r,forward as n}from"../common/index.js";import a from"../../../../../../assets/annotation/toolHotKeyIcon/icon_next_kj.svg.js";const o={name:"Save",icon:a,shortCut:["Ctrl","Enter"]},e=[t,r,n,o];export{e as default,o as forwardWithEnter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{backward as o,forward as r}from"../common/index.js";const a=[o,r];export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useContext as v}from"react";import k from"../../../../../assets/annotation/toolHotKeyIcon/icon_kj1.svg.js";import
|
|
1
|
+
import e,{useContext as v}from"react";import k from"../../../../../assets/annotation/toolHotKeyIcon/icon_kj1.svg.js";import L from"../../../../../assets/annotation/toolHotKeyIcon/icon_kj_h.svg.js";import{EToolName as l}from"../../../../../data/enums/ToolType.js";import N from"./rectToolShortCutTable/index.js";import w from"./point/index.js";import O from"./polygon/index.js";import I from"./line/index.js";import H from"./tag/index.js";import R from"./text/index.js";import G from"./videoTag/index.js";import M,{pointCloudShortCutTable_POLYGON as K,pointCloudShortCutTable_SEGMENT as V}from"./pointCloud/index.js";import A from"./scribble/index.js";import W from"./cuboid/index.js";import Y from"./LLM/index.js";import $ from"./NLP/index.js";import B from"./audioText/index.js";import{footerCls as D}from"../../index.js";import{useTranslation as F}from"react-i18next";import{EAudioToolName as z,cTool as U}from"@labelbee/lb-annotation";import{PointCloudContext as q}from"../../../../../components/pointCloudView/PointCloudContext.js";import J from"../../FooterPopover.js";import{EPointCloudPattern as T}from"@labelbee/lb-utils";var Q=Object.defineProperty,C=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,b=(o,r,t)=>r in o?Q(o,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[r]=t,ee=(o,r)=>{for(var t in r||(r={}))X.call(r,t)&&b(o,t,r[t]);if(C)for(var t of C(r))Z.call(r,t)&&b(o,t,r[t]);return o};const{EVideoToolName:te,EPointCloudName:u}=U,f={[l.Rect]:N,[l.Tag]:H,[l.Point]:w,[l.Polygon]:O,[l.Line]:I,[l.Text]:R,[te.VideoTagTool]:G,[u.PointCloud]:M,[u.PointCloud+"_POLYGON"]:K,[u.PointCloud+"_SEGMENT"]:V,[l.ScribbleTool]:A,[l.Cuboid]:W,[l.LLM]:Y,[l.NLP]:$,[z.AudioTextTool]:B},oe=({icon:o})=>typeof o=="string"?e.createElement("img",{width:16,height:16,src:o}):o||null,E=({title:o,style:r,shortCutList:t})=>{const{t:m}=F(),d={width:320,display:"flex",justifyContent:"space-between",margin:16},s={display:"block",padding:"0 3px",minWidth:"20px",marginRight:"3px",border:"1px solid rgba(204,204,204,1)",verticalAlign:"middle",fontSize:"12px",textAlign:"center"},y=(a,c)=>e.createElement("div",{style:d,key:c},e.createElement("span",{style:{display:"flex",alignItems:"center"}},e.createElement(oe,{icon:a.icon}),e.createElement("span",{style:{marginLeft:a.icon?16:0}},m(a.name))),e.createElement("span",{style:{display:"flex",alignItems:"center"}},a.noticeInfo&&e.createElement("span",{style:{marginRight:"5px",color:"#CCCCCC"}},m(a.noticeInfo)),x(a.shortCut,a.shortCutUseHtml,a.linkSymbol))),x=(a,c=!1,_="+")=>{if(!a)return null;const j=a.map((n,i)=>{var g,h;const p={display:"flex",alignItems:"center"};return c?e.createElement("span",{key:i,style:p},e.createElement("span",{style:s,dangerouslySetInnerHTML:{__html:n}})):i<a.length-1?typeof n=="number"?e.createElement("span",{key:i,style:p},e.createElement("span",{style:s},n),e.createElement("span",{style:{marginRight:"3px"}},"~")):((g=n==null?void 0:n.startsWith)==null?void 0:g.call(n,"data"))?e.createElement("span",{key:i,style:p},e.createElement("span",{className:"shortCutButton",style:{marginRight:"3px"}},e.createElement("img",{width:16,height:23,src:n})),e.createElement("span",{style:{marginRight:"3px"}},"+")):e.createElement("span",{key:i,style:p},e.createElement("span",{style:s},n),e.createElement("span",{style:{marginRight:"3px"}},_)):typeof n=="number"?e.createElement("span",{key:i,style:p},e.createElement("span",{style:s},n)):((h=n==null?void 0:n.startsWith)==null?void 0:h.call(n,"data"))?e.createElement("span",{className:"shortCutButton",key:i,style:{marginRight:"3px"}},e.createElement("img",{width:16,height:23,src:n})):e.createElement("span",{style:s,key:i},n)});return e.createElement("div",{style:{display:"flex",justifyContent:"space-around",alignItems:"center"}},j)},S=e.createElement("div",{className:`${D}__hotkey-content`},t==null?void 0:t.map((a,c)=>y(a,c))),P=r||{};return e.createElement(J,{hoverIcon:L,icon:k,title:m("Hotkeys"),content:S,containerStyle:P})},re=({style:o,title:r,toolName:t})=>{const{pointCloudPattern:m,globalPattern:d}=v(q);if(!t||!f[t])return null;let s=t;switch(d){case T.Detection:switch(m){case l.Polygon:s+="_POLYGON";break;case l.Line:s=l.Line;break;case l.Point:s=l.Point;break}break;case T.Segmentation:s=u.PointCloud+"_SEGMENT";break}const y={style:o,title:r,shortCutList:f[s]};return e.createElement(E,ee({},y))};export{E as ToolHotKeyCom,re as default,f as shortCutTable};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0-alpha.2",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.
|
|
47
|
-
"@labelbee/lb-utils": "1.
|
|
46
|
+
"@labelbee/lb-annotation": "1.27.0-alpha.2",
|
|
47
|
+
"@labelbee/lb-utils": "1.19.0-alpha.1",
|
|
48
48
|
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"@types/react-transition-group": "^4.4.9",
|