@labelbee/lb-components 1.16.0-alpha.1 → 1.16.0-alpha.10
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/assets/annotation/audio/clip.svg.js +1 -0
- package/dist/assets/annotation/audio/clipA.svg.js +1 -0
- package/dist/assets/annotation/audio/clipASmall.svg.js +1 -0
- package/dist/assets/annotation/audio/clipSmall.svg.js +1 -0
- package/dist/assets/annotation/audio/delete.svg.js +1 -0
- package/dist/assets/annotation/audio/loop.svg.js +1 -0
- package/dist/assets/annotation/audio/loopA.svg.js +1 -0
- package/dist/assets/annotation/audio/progressDot.svg.js +1 -0
- package/dist/assets/annotation/audio/progressDotA.svg.js +1 -0
- package/dist/assets/annotation/audio/tag.svg.js +1 -0
- package/dist/assets/annotation/audio/tagA.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/deleteRemark.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_down.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_eyeLock_kj.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_polygonCut_kj.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_up.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/nextRemark.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/preRemark.svg.js +1 -0
- package/dist/assets/annotation/video/icon_clip.svg.js +1 -0
- package/dist/components/audioAnnotate/audioContext/index.js +1 -0
- package/dist/components/audioAnnotate/audioContext/index.module.scss.js +1 -0
- package/dist/components/audioAnnotate/audioSide/LabelDetailPopover/index.js +1 -0
- package/dist/components/audioAnnotate/audioSide/LabelDetailPopover/index.module.scss.js +1 -0
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -0
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.module.scss.js +1 -0
- package/dist/components/audioAnnotate/audioSide/labelFilterInput/index.js +1 -0
- package/dist/components/audioAnnotate/audioSide/labelFilterInput/index.module.scss.js +1 -0
- package/dist/components/audioAnnotate/audioSide/labelSidebar/index.js +1 -0
- package/dist/components/audioAnnotate/audioSide/labelSidebar/index.module.scss.js +1 -0
- package/dist/components/audioAnnotate/index.js +1 -0
- package/dist/components/audioAnnotate/index.module.scss.js +1 -0
- package/dist/components/audioAnnotate/tagResultShow/index.js +1 -0
- package/dist/components/audioAnnotate/tagResultShow/index.module.scss.js +1 -0
- package/dist/components/audioAnnotate/textInput/index.js +1 -0
- package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -0
- package/dist/components/audioAnnotate/utils/getWebPcm2Wac.js +1 -0
- package/dist/components/audioPlayer/clipRegion/index.js +1 -0
- package/dist/components/audioPlayer/clipRegion/index.module.scss.js +1 -0
- package/dist/components/audioPlayer/clipTip/index.js +1 -0
- package/dist/components/audioPlayer/combineTip/index.js +1 -0
- package/dist/components/audioPlayer/index.js +1 -0
- package/dist/components/audioPlayer/index.module.scss.js +1 -0
- package/dist/components/audioPlayer/labelDisplayToggle/index.js +1 -0
- package/dist/components/audioPlayer/labelDisplayToggle/index.module.scss.js +1 -0
- package/dist/components/audioPlayer/progressDot/index.js +1 -0
- package/dist/components/audioPlayer/progressDot/index.module.scss.js +1 -0
- package/dist/components/audioPlayer/segmentTip/index.js +1 -0
- package/dist/components/audioPlayer/useAudioCombine/index.js +2 -0
- package/dist/components/audioPlayer/useAudioScroll/index.js +1 -0
- package/dist/components/audioPlayer/useAudioSegment/index.js +1 -0
- package/dist/components/audioPlayer/useSwitchHotkey/index.js +1 -0
- package/dist/components/audioPlayer/zoomSlider/index.js +1 -0
- package/dist/components/audioPlayer/zoomSlider/index.module.scss.js +1 -0
- package/dist/components/imageError/index.js +1 -0
- package/dist/components/invalidPage/index.js +1 -0
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/videoPlayer/components/SpeedController/index.js +1 -0
- package/dist/components/videoPlayer/components/SpeedController/index.module.scss.js +1 -0
- package/dist/components/videoPlayer/components/controller/index.js +1 -1
- package/dist/components/videoPlayer/index.js +1 -1
- package/dist/index.css +721 -0
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/types/App.d.ts +1 -0
- package/dist/types/components/attributeList/index.d.ts +1 -0
- package/dist/types/components/audioAnnotate/audioContext/index.d.ts +40 -0
- package/dist/types/components/audioAnnotate/audioSide/LabelDetailPopover/index.d.ts +9 -0
- package/dist/types/components/audioAnnotate/audioSide/clipSidebar/index.d.ts +11 -0
- package/dist/types/components/audioAnnotate/audioSide/labelFilterInput/index.d.ts +7 -0
- package/dist/types/components/audioAnnotate/audioSide/labelSidebar/index.d.ts +49 -0
- package/dist/types/components/audioAnnotate/index.d.ts +12 -0
- package/dist/types/components/audioAnnotate/tagResultShow/index.d.ts +3 -0
- package/dist/types/components/audioAnnotate/textInput/index.d.ts +52 -0
- package/dist/types/components/audioAnnotate/utils/getWebPcm2Wac.d.ts +1 -0
- package/dist/types/components/audioPlayer/clipRegion/index.d.ts +22 -0
- package/dist/types/components/audioPlayer/clipTip/index.d.ts +15 -0
- package/dist/types/components/audioPlayer/combineTip/index.d.ts +12 -0
- package/dist/types/components/audioPlayer/index.d.ts +43 -0
- package/dist/types/components/audioPlayer/labelDisplayToggle/index.d.ts +6 -0
- package/dist/types/components/audioPlayer/progressDot/index.d.ts +6 -0
- package/dist/types/components/audioPlayer/segmentTip/index.d.ts +12 -0
- package/dist/types/components/audioPlayer/useAudioCombine/index.d.ts +30 -0
- package/dist/types/components/audioPlayer/useAudioScroll/index.d.ts +17 -0
- package/dist/types/components/audioPlayer/useAudioSegment/index.d.ts +31 -0
- package/dist/types/components/audioPlayer/useSwitchHotkey/index.d.ts +12 -0
- package/dist/types/components/audioPlayer/zoomSlider/index.d.ts +13 -0
- package/dist/types/components/imageError/index.d.ts +14 -0
- package/dist/types/components/invalidPage/index.d.ts +9 -0
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +1 -3
- package/dist/types/components/videoPlayer/components/SpeedController/index.d.ts +16 -0
- package/dist/types/components/videoPlayer/components/controller/index.d.ts +11 -0
- package/dist/types/hooks/annotation.d.ts +1 -1
- package/dist/types/utils/StepUtils.d.ts +7 -0
- package/dist/types/utils/ToolUtils.d.ts +1 -0
- package/dist/types/utils/audio.d.ts +132 -0
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.d.ts +18 -0
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.d.ts +39 -0
- package/dist/types/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.d.ts +1 -1
- package/dist/utils/StepUtils.js +1 -1
- package/dist/utils/ToolUtils.js +1 -1
- package/dist/utils/audio.js +1 -0
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/ToolStyle/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/line/index.js +1 -1
- package/dist/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
- package/es/assets/annotation/audio/clip.svg.js +1 -0
- package/es/assets/annotation/audio/clipA.svg.js +1 -0
- package/es/assets/annotation/audio/clipASmall.svg.js +1 -0
- package/es/assets/annotation/audio/clipSmall.svg.js +1 -0
- package/es/assets/annotation/audio/delete.svg.js +1 -0
- package/es/assets/annotation/audio/loop.svg.js +1 -0
- package/es/assets/annotation/audio/loopA.svg.js +1 -0
- package/es/assets/annotation/audio/progressDot.svg.js +1 -0
- package/es/assets/annotation/audio/progressDotA.svg.js +1 -0
- package/es/assets/annotation/audio/tag.svg.js +1 -0
- package/es/assets/annotation/audio/tagA.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/deleteRemark.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_down.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_eyeLock_kj.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonCut_kj.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_up.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/nextRemark.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/preRemark.svg.js +1 -0
- package/es/assets/annotation/video/icon_clip.svg.js +1 -0
- package/es/components/audioAnnotate/audioContext/index.js +1 -0
- package/es/components/audioAnnotate/audioContext/index.module.scss.js +1 -0
- package/es/components/audioAnnotate/audioSide/LabelDetailPopover/index.js +1 -0
- package/es/components/audioAnnotate/audioSide/LabelDetailPopover/index.module.scss.js +1 -0
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -0
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.module.scss.js +1 -0
- package/es/components/audioAnnotate/audioSide/labelFilterInput/index.js +1 -0
- package/es/components/audioAnnotate/audioSide/labelFilterInput/index.module.scss.js +1 -0
- package/es/components/audioAnnotate/audioSide/labelSidebar/index.js +1 -0
- package/es/components/audioAnnotate/audioSide/labelSidebar/index.module.scss.js +1 -0
- package/es/components/audioAnnotate/index.js +1 -0
- package/es/components/audioAnnotate/index.module.scss.js +1 -0
- package/es/components/audioAnnotate/tagResultShow/index.js +1 -0
- package/es/components/audioAnnotate/tagResultShow/index.module.scss.js +1 -0
- package/es/components/audioAnnotate/textInput/index.js +1 -0
- package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -0
- package/es/components/audioAnnotate/utils/getWebPcm2Wac.js +1 -0
- package/es/components/audioPlayer/clipRegion/index.js +1 -0
- package/es/components/audioPlayer/clipRegion/index.module.scss.js +1 -0
- package/es/components/audioPlayer/clipTip/index.js +1 -0
- package/es/components/audioPlayer/combineTip/index.js +1 -0
- package/es/components/audioPlayer/index.js +1 -0
- package/es/components/audioPlayer/index.module.scss.js +1 -0
- package/es/components/audioPlayer/labelDisplayToggle/index.js +1 -0
- package/es/components/audioPlayer/labelDisplayToggle/index.module.scss.js +1 -0
- package/es/components/audioPlayer/progressDot/index.js +1 -0
- package/es/components/audioPlayer/progressDot/index.module.scss.js +1 -0
- package/es/components/audioPlayer/segmentTip/index.js +1 -0
- package/es/components/audioPlayer/useAudioCombine/index.js +2 -0
- package/es/components/audioPlayer/useAudioScroll/index.js +1 -0
- package/es/components/audioPlayer/useAudioSegment/index.js +1 -0
- package/es/components/audioPlayer/useSwitchHotkey/index.js +1 -0
- package/es/components/audioPlayer/zoomSlider/index.js +1 -0
- package/es/components/audioPlayer/zoomSlider/index.module.scss.js +1 -0
- package/es/components/imageError/index.js +1 -0
- package/es/components/invalidPage/index.js +1 -0
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/videoPlayer/components/SpeedController/index.js +1 -0
- package/es/components/videoPlayer/components/SpeedController/index.module.scss.js +1 -0
- package/es/components/videoPlayer/components/controller/index.js +1 -1
- package/es/index.css +721 -0
- package/es/store/annotation/reducer.js +1 -1
- package/es/utils/StepUtils.js +1 -1
- package/es/utils/ToolUtils.js +1 -1
- package/es/utils/audio.js +1 -0
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/ToolStyle/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/line/index.js +1 -1
- package/es/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
- package/package.json +9 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFormatSize as Et}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import St from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as i}from"../Actions.js";import{jsonParser as b}from"../../utils/index.js";import W from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as Dt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as st,composeResult as Y}from"../../utils/data.js";import w from"../../utils/StepUtils.js";import lt from"../../utils/ToolUtils.js";import{MathUtils as it,CommonToolUtils as At,AnnotationEngine as vt,ImgUtils as yt}from"@labelbee/lb-annotation";import{PointCloudUtils as rt,i18n as x}from"@labelbee/lb-utils";import{Modal as ut}from"antd";import{message as at}from"antd/es";import ct from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as dt}from"../../data/enums/ToolType.js";var Rt=Object.defineProperty,Pt=Object.defineProperties,Ct=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,gt=(t,e,r)=>e in t?Rt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,o=(t,e)=>{for(var r in e||(e={}))ht.call(e,r)&>(t,r,e[r]);if(pt)for(var r of pt(e))Ot.call(e,r)&>(t,r,e[r]);return t},l=(t,e)=>Pt(t,Ct(e)),_t=(t,e,r)=>new Promise((E,p)=>{var f=m=>{try{D(r.next(m))}catch(y){p(y)}},S=m=>{try{D(r.throw(m))}catch(y){p(y)}},D=m=>m.done?E(m.value):Promise.resolve(m.value).then(f,S);D((r=r.apply(t,e)).next())});const U=(t,e)=>t.find(r=>r.step===e),It={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:""},bt=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},mt=(t,e)=>t.reduce((r,E)=>{if(E){const p=E.result;if(b(p)[`step_${e}`])return r+1}return r},0)/t.length,Ut=(t,e)=>{const{step:r,stepList:E}=t,p=w.getCurrentStepInfo(r,E),f=Dt.jsonParser(p.config);if(lt.isVideoTool(p==null?void 0:p.tool)||lt.isPointCloudTool(p==null?void 0:p.tool)||dt.LLM===(p==null?void 0:p.tool))return;const S=document.getElementById("toolContainer");if(!S)throw"Not exist dom named id-toolContainer";const D=Et({width:window.innerWidth,height:window.innerHeight}),m=new vt({container:S,toolName:p.tool,size:D,imgNode:e,config:f,style:JSON.parse(St)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},Nt=(t,e)=>(r,E)=>_t(void 0,null,function*(){var p;const{stepList:f,step:S}=E().annotation,D=w.currentToolIsVideo(S,f),m=w.currentToolIsPointCloud(S,f),y=((p=w.getCurrentStepInfo(S,f))==null?void 0:p.tool)===dt.LLM;if($(r,!0),yield r(Bt(t)),D||m||y){r(wt(t));return}r(xt(t,e))}),Bt=t=>(e,r)=>_t(void 0,null,function*(){const{getFileData:E,imgList:p}=r().annotation;if(E){const f=yield E(p[t],t);e({type:i.SET_FILE_DATA,payload:{fileData:f,index:t}})}}),wt=t=>e=>{$(e,!1),e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},xt=(t,e)=>(r,E)=>{var p;const{toolInstance:f,imgList:S}=E().annotation,D=(p=S==null?void 0:S[t])==null?void 0:p.url;yt.load(D).then(m=>{$(r,!1),r({type:i.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),f==null||f.setErrorImg(),r({type:i.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Ft=({toolInstance:t,imgList:e,imgIndex:r,stepList:E,step:p=1})=>{var f,S,D,m;const y=((f=e[r])==null?void 0:f.result)||"",[F,j,G]=(S=t==null?void 0:t.exportData())!=null?S:[],V=(m=(D=t==null?void 0:t.exportCustomData)==null?void 0:D.call(t))!=null?m:{},M=st(y,j),k=Y(M,{step:p,stepList:E},{rect:F},V);return e.map((N,H)=>H===r?o(l(o({},N),{result:k}),G):o({},N))},jt=(t=o({},It),e)=>{var r,E,p,f,S,D,m,y,F,j,G,V,M,k,N,H,J,X,q,Z,Q,tt,et;switch(e.type){case i.INIT_ALL_STATE:return o(o({},t),It);case i.UPDATE_TOOL_INSTANCE:return l(o({},t),{toolInstance:e.payload.toolInstance});case i.UPDATE_IMG_LIST:return l(o({},t),{imgList:e.payload.imgList});case i.CALC_STEP_PROGRESS:{const{imgList:n,step:s}=t,u=mt(n,s);return l(o({},t),{stepProgress:u})}case i.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:s,step:u,stepList:a,toolInstance:d,onSubmit:c,resultList:T}=t;if(!d||!n[s])return t;const _=((r=n[s])==null?void 0:r.result)||"",[,g,I]=(E=d==null?void 0:d.exportData())!=null?E:[],L=(f=(p=d==null?void 0:d.exportCustomData)==null?void 0:p.call(d))!=null?f:{},A=st(_,g),R=Y(A,{step:u,stepList:a},{rect:T},L),v=t.imgList.map((C,P)=>{if(P===s){const B=W.dataCorrection(R,_,u,a);return o(l(o({},C),{result:B}),I)}return C});if(((S=e.payload)==null?void 0:S.submitType)===K.SyncImgList)return l(o({},t),{imgList:v});c&&c([v[s]],(D=e.payload)==null?void 0:D.submitType,s,v);const h=mt(v,u);return l(o({},t),{stepProgress:h,imgList:v})}case i.SAVE_RESULT:{const{imgList:n,imgIndex:s,onSave:u}=t;return u==null||u(n[s],s,n),o({},t)}case i.SUBMIT_RESULT:{const{imgList:n,basicIndex:s,resultList:u,toolInstance:a,basicResultList:d}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let T=c;if((d==null?void 0:d.length)>0){const _=(y=d[s])==null?void 0:y.id,g=c.map(I=>l(o({},I),{sourceID:_}));T=ct.cloneDeep(u).filter(I=>I.sourceID!==_),T.push(...g)}return l(o({},t),{resultList:T,imgList:n})}case i.SET_BASIC_INDEX:{const{toolInstance:n,step:s,imgList:u,imgIndex:a,stepList:d,annotationEngine:c,resultList:T,basicResultList:_}=t;if(!n||!c)return t;const g=e.payload.basicIndex,I=(F=_[g])==null?void 0:F.id,L=b((j=u[a])==null?void 0:j.result),A=(T||[]).filter(B=>B.sourceID===I),R=U(d,s),{dataSourceStep:v,tool:h}=R,C=U(d,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[g]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),at.info(x.t("NoDependency")))),n==null||n.setResult(A),n==null||n.history.initRecord(A,!0),l(o({},t),{basicIndex:g})}case i.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=e.payload;return l(o({},t),{triggerEventAfterIndexChanged:!!n})}case i.LOAD_FILE_DATA:{const{imgList:n,step:s,toolInstance:u,annotationEngine:a,stepList:d}=t;if(!u)return l(o({},t),{imgIndex:e.payload.nextIndex});const c=w.getCurrentStepInfo(s,d),{nextIndex:T,imgNode:_,nextBasicIndex:g,imgError:I}=e.payload,L=g!=null?g:0,A=b((V=n[T])==null?void 0:V.result),R=A[`step_${c.step}`],v=!R,h={rotate:(M=A.rotate)!=null?M:0,valid:(k=A.valid)!=null?k:!0};_&&I!==!0?a==null||a.setImgNode(_,h):u==null||u.setValid(h.valid);const C=U(d,c.step),{dataSourceStep:P,tool:B}=C,nt=U(d,P),ot=P&&B,O=(H=(N=A[`step_${P}`])==null?void 0:N.result)!=null?H:[],z=W.getInitialResultList(R==null?void 0:R.result,u,C,O,v);if(a==null||a.launchOperation(),ot&&((O==null?void 0:O.length)>0?a==null||a.setBasicInfo(nt.tool,O[L]):(a==null||a.setBasicInfo(nt.tool),a==null||a.forbidOperation(),at.info(x.t("NoDependency")))),c.tool!=="check"){const ft=(X=(J=O[L])==null?void 0:J.id)!=null?X:"",Tt=ot?z.filter(Lt=>At.isSameSourceID(Lt.sourceID,ft)):z;u==null||u.history.initRecord(z,!0),u==null||u.setResult(Tt)}return l(o({},t),{imgIndex:T,basicIndex:L,basicResultList:O,resultList:z})}case i.UPDATE_ANNOTATION_CONFIG:return l(o({},t),{config:(q=e.payload.config)!=null?q:"{}"});case i.SET_TASK_STEP_LIST:{const{stepList:n}=e.payload;return l(o({},t),{stepList:n})}case i.SET_TASK_CONFIG:{const{stepList:n,step:s}=e.payload;return l(o({},t),{stepList:n,step:s})}case i.INIT_TOOL:{const{imgNode:n}=t,s=Ut(t,n);if(s){const{toolInstance:u,annotationEngine:a}=s;return l(o({},t),{toolInstance:u,annotationEngine:a})}return o({},t)}case i.SET_TOOL:{const n=(Z=e.payload)==null?void 0:Z.instance;return n?l(o({},t),{toolInstance:n}):o({},t)}case i.UPDATE_ON_SUBMIT:return l(o({},t),{onSubmit:e.payload.onSubmit});case i.UPDATE_ON_SAVE:return l(o({},t),{onSave:e.payload.onSave});case i.UPDATE_ON_PAGE_CHANGE:return l(o({},t),{onPageChange:e.payload.onPageChange});case i.SET_PREDICT_RESULT:return l(o({},t),{predictionResult:e.payload.result});case i.SET_PREDICT_RESULT_VISIBLE:return l(o({},t),{predictionResultVisible:e.payload.visible});case i.UPDATE_ON_STEP_CHANGE:return l(o({},t),{onStepChange:e.payload.onStepChange});case i.UPDATE_GET_FILE_DATA:return l(o({},t),{getFileData:e.payload.getFileData});case i.UPDATE_PAGE_SIZE:return l(o({},t),{pageSize:e.payload.pageSize});case i.UPDATE_LOAD_FILE_LIST:return l(o({},t),{loadFileList:e.payload.loadFileList});case i.UPDATE_BEFORE_ROTATE:return l(o({},t),{beforeRotate:e.payload.beforeRotate});case i.UPDATE_PRE_DATA_PROCESS:return l(o({},t),{preDataProcess:e.payload.preDataProcess});case i.SKIP_BEFORE_PAGE_TURNING:return l(o({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case i.SET_FILE_DATA:{const{fileData:n,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=o(o({},a[s]),n),l(o({},t),{imgList:a})}case i.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:s}=t;return s&&s()===!1||n==null||n.updateRotate(),t}case i.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=t,s=(Q=n==null?void 0:n.valid)!=null?Q:!0;return ut.destroyAll(),ut.confirm({content:x.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!s)},okText:x.t("Confirm"),cancelText:x.t("Cancel")}),t}case i.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:s,imgList:u,step:a}=t;if(!n)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const d=u[s-1].result;if(!d)return t;const c=W.copyResultChange(d,a,(tt=u[s].result)!=null?tt:"");u[s]=l(o({},u[s]),{result:c});const _=b(c)[`step_${a}`],g=(_==null?void 0:_.result)||[];return n==null||n.setResult(g),n==null||n.history.pushHistory(g),(et=n==null?void 0:n.asyncData)==null||et.call(n,u[s]),l(o({},t),{imgList:[...u]})}case i.SET_STEP:{const{stepList:n,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=U(n,u);return s==null||s.setToolName(a.tool,a.config),l(o({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case i.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=e.payload;return l(o({},t),{loadPCDFileLoading:!!n})}case i.SET_LOADING:{const{loading:n}=e.payload;return l(o({},t),{loading:!!n})}case i.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=e.payload;return l(o({},t),{pointCloudLoading:!!n})}case i.SET_CHECK_MODE:{const{checkMode:n}=e.payload;return l(o({},t),{checkMode:!!n})}case i.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=e.payload;return l(o({},t),{highlightAttribute:n})}case i.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:d,onSubmit:c}=t,T=[],_=a.map((g,I)=>{if(it.isInRange(I,u)){const L=l(o({},g),{result:rt.batchUpdateTrackID({id:n,newID:s,result:g.result})});return T.push({imgIndex:I,newInfo:L}),L}return g});return c&&c([_[d]],K.BatchUpdateTrackID,d,_,{updateImgList:T}),l(o({},t),{imgList:_})}case i.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:d,onSubmit:c}=t,T=[],_=a.map((g,I)=>{if(it.isInRange(I,u)){const L=l(o({},g),{result:rt.batchUpdateResultByTrackID({id:n,newData:s,result:g.result})});return T.push({imgIndex:I,newInfo:L}),L}return g});return c&&c([_[d]],K.BatchUpdateTrackID,d,_,{updateImgList:T}),l(o({},t),{imgList:_})}case i.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:s,stepList:u,step:a,predictionResult:d}=t,c={};d.forEach(I=>{const{index:L}=I;c[L]=ct.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const T=`step_${a}`,_=[],g=s.map((I,L)=>{if(c[L]){const A=I.result==="{}"?b(Y("",{step:a,stepList:u},{rect:[]},{})):b(I.result);A[T].result.push(c[L]);const R=l(o({},I),{result:JSON.stringify(A)});return _.push({imgIndex:L,newInfo:R}),R}return I});return n==null||n(g,K.BatchUpdateImgList,-1,g,{updateImgList:_}),l(o({},t),{imgList:g})}default:return t}};export{Nt as LoadFileAndFileData,jt as annotationReducer,Ft as composeResultByToolInstance,U as getStepConfig,bt as getTotalPage};
|
|
1
|
+
import{getFormatSize as Et}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import St from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as i}from"../Actions.js";import{jsonParser as U}from"../../utils/index.js";import W from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as At}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as lt,composeResult as Y}from"../../utils/data.js";import N from"../../utils/StepUtils.js";import J from"../../utils/ToolUtils.js";import{MathUtils as it,CommonToolUtils as Dt,AnnotationEngine as vt,ImgUtils as yt}from"@labelbee/lb-annotation";import{PointCloudUtils as rt,i18n as F}from"@labelbee/lb-utils";import{Modal as ut}from"antd";import{message as at}from"antd/es";import ct from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as dt}from"../../data/enums/ToolType.js";var Rt=Object.defineProperty,Pt=Object.defineProperties,Ct=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,gt=(t,e,r)=>e in t?Rt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))ht.call(e,r)&>(t,r,e[r]);if(pt)for(var r of pt(e))Ot.call(e,r)&>(t,r,e[r]);return t},l=(t,e)=>Pt(t,Ct(e)),_t=(t,e,r)=>new Promise((E,d)=>{var f=m=>{try{A(r.next(m))}catch(y){d(y)}},S=m=>{try{A(r.throw(m))}catch(y){d(y)}},A=m=>m.done?E(m.value):Promise.resolve(m.value).then(f,S);A((r=r.apply(t,e)).next())});const B=(t,e)=>t.find(r=>r.step===e),It={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:""},bt=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},mt=(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,Ut=(t,e)=>{const{step:r,stepList:E}=t,d=N.getCurrentStepInfo(r,E),f=At.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)||dt.LLM===(d==null?void 0:d.tool))return;const S=document.getElementById("toolContainer");if(!S)throw"Not exist dom named id-toolContainer";const A=Et({width:window.innerWidth,height:window.innerHeight}),m=new vt({container:S,toolName:d.tool,size:A,imgNode:e,config:f,style:JSON.parse(St)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},Nt=(t,e)=>(r,E)=>_t(void 0,null,function*(){var d;const{stepList:f,step:S}=E().annotation,A=N.currentToolIsVideo(S,f),m=N.currentToolIsPointCloud(S,f),y=((d=N.getCurrentStepInfo(S,f))==null?void 0:d.tool)===dt.LLM,h=N.currentToolIsAudio(S,f);if($(r,!0),yield r(Bt(t)),A||m||y||h){r(wt(t));return}r(xt(t,e))}),Bt=t=>(e,r)=>_t(void 0,null,function*(){const{getFileData:E,imgList:d}=r().annotation;if(E){const f=yield E(d[t],t);e({type:i.SET_FILE_DATA,payload:{fileData:f,index:t}})}}),wt=t=>e=>{$(e,!1),e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},xt=(t,e)=>(r,E)=>{var d;const{toolInstance:f,imgList:S}=E().annotation,A=(d=S==null?void 0:S[t])==null?void 0:d.url;yt.load(A).then(m=>{$(r,!1),r({type:i.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),f==null||f.setErrorImg(),r({type:i.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Ft=({toolInstance:t,imgList:e,imgIndex:r,stepList:E,step:d=1})=>{var f,S,A,m;const y=((f=e[r])==null?void 0:f.result)||"",[h,j,G]=(S=t==null?void 0:t.exportData())!=null?S:[],V=(m=(A=t==null?void 0:t.exportCustomData)==null?void 0:A.call(t))!=null?m:{},M=lt(y,j),k=Y(M,{step:d,stepList:E},{rect:h},V);return e.map((w,H)=>H===r?n(l(n({},w),{result:k}),G):n({},w))},jt=(t=n({},It),e)=>{var r,E,d,f,S,A,m,y,h,j,G,V,M,k,w,H,X,q,Z,Q,tt,et,ot;switch(e.type){case i.INIT_ALL_STATE:return n(n({},t),It);case i.UPDATE_TOOL_INSTANCE:return l(n({},t),{toolInstance:e.payload.toolInstance});case i.UPDATE_IMG_LIST:return l(n({},t),{imgList:e.payload.imgList});case i.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=mt(o,s);return l(n({},t),{stepProgress:u})}case i.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 _=((r=o[s])==null?void 0:r.result)||"",[,g,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=lt(_,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,_,u,a);return n(l(n({},C),{result:x}),I)}return C});if(((S=e.payload)==null?void 0:S.submitType)===K.SyncImgList)return l(n({},t),{imgList:v});c&&c([v[s]],(A=e.payload)==null?void 0:A.submitType,s,v);const O=mt(v,u);return l(n({},t),{stepProgress:O,imgList:v})}case i.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case i.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 _=(y=p[s])==null?void 0:y.id,g=c.map(I=>l(n({},I),{sourceID:_}));T=ct.cloneDeep(u).filter(I=>I.sourceID!==_),T.push(...g)}return l(n({},t),{resultList:T,imgList:o})}case i.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:T,basicResultList:_}=t;if(!o||!c)return t;const g=e.payload.basicIndex,I=(h=_[g])==null?void 0:h.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:O}=R,C=B(p,v);let P=[];return v&&O&&(P=(G=L[`step_${v}`])==null?void 0:G.result,(P==null?void 0:P.length)>0?(c==null||c.setBasicInfo(C.tool,P[g]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),at.info(F.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),l(n({},t),{basicIndex:g})}case i.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return l(n({},t),{triggerEventAfterIndexChanged:!!o})}case i.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return l(n({},t),{imgIndex:e.payload.nextIndex});const c=N.getCurrentStepInfo(s,p),{nextIndex:T,imgNode:_,nextBasicIndex:g,imgError:I}=e.payload,L=g!=null?g:0,D=U((V=o[T])==null?void 0:V.result),R=D[`step_${c.step}`],v=!R,O={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};_&&I!==!0?a==null||a.setImgNode(_,O):u==null||u.setValid(O.valid);const C=B(p,c.step),{dataSourceStep:P,tool:x}=C,nt=B(p,P),st=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(),st&&((b==null?void 0:b.length)>0?a==null||a.setBasicInfo(nt.tool,b[L]):(a==null||a.setBasicInfo(nt.tool),a==null||a.forbidOperation(),at.info(F.t("NoDependency")))),c.tool!=="check"){const ft=(q=(X=b[L])==null?void 0:X.id)!=null?q:"",Tt=st?z.filter(Lt=>Dt.isSameSourceID(Lt.sourceID,ft)):z;u==null||u.history.initRecord(z,!0),u==null||u.setResult(Tt)}return l(n({},t),{imgIndex:T,basicIndex:L,basicResultList:b,resultList:z})}case i.UPDATE_ANNOTATION_CONFIG:return l(n({},t),{config:(Z=e.payload.config)!=null?Z:"{}"});case i.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return l(n({},t),{stepList:o})}case i.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return l(n({},t),{stepList:o,step:s})}case i.INIT_TOOL:{const{imgNode:o}=t,s=Ut(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return l(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case i.SET_TOOL:{const o=(Q=e.payload)==null?void 0:Q.instance;return o?l(n({},t),{toolInstance:o}):n({},t)}case i.UPDATE_ON_SUBMIT:return l(n({},t),{onSubmit:e.payload.onSubmit});case i.UPDATE_ON_SAVE:return l(n({},t),{onSave:e.payload.onSave});case i.UPDATE_ON_PAGE_CHANGE:return l(n({},t),{onPageChange:e.payload.onPageChange});case i.SET_PREDICT_RESULT:return l(n({},t),{predictionResult:e.payload.result});case i.SET_PREDICT_RESULT_VISIBLE:return l(n({},t),{predictionResultVisible:e.payload.visible});case i.UPDATE_ON_STEP_CHANGE:return l(n({},t),{onStepChange:e.payload.onStepChange});case i.UPDATE_GET_FILE_DATA:return l(n({},t),{getFileData:e.payload.getFileData});case i.UPDATE_PAGE_SIZE:return l(n({},t),{pageSize:e.payload.pageSize});case i.UPDATE_LOAD_FILE_LIST:return l(n({},t),{loadFileList:e.payload.loadFileList});case i.UPDATE_BEFORE_ROTATE:return l(n({},t),{beforeRotate:e.payload.beforeRotate});case i.UPDATE_PRE_DATA_PROCESS:return l(n({},t),{preDataProcess:e.payload.preDataProcess});case i.SKIP_BEFORE_PAGE_TURNING:return l(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case i.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),l(n({},t),{imgList:a})}case i.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||o==null||o.updateRotate(),t}case i.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(tt=o==null?void 0:o.valid)!=null?tt:!0;return ut.destroyAll(),ut.confirm({content:F.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:F.t("Confirm"),cancelText:F.t("Cancel")}),t}case i.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,(et=u[s].result)!=null?et:"");u[s]=l(n({},u[s]),{result:c});const _=U(c)[`step_${a}`],g=(_==null?void 0:_.result)||[];return o==null||o.setResult(g),o==null||o.history.pushHistory(g),(ot=o==null?void 0:o.asyncData)==null||ot.call(o,u[s]),l(n({},t),{imgList:[...u]})}case i.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),l(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case i.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return l(n({},t),{loadPCDFileLoading:!!o})}case i.SET_LOADING:{const{loading:o}=e.payload;return l(n({},t),{loading:!!o})}case i.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return l(n({},t),{pointCloudLoading:!!o})}case i.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return l(n({},t),{checkMode:!!o})}case i.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return l(n({},t),{highlightAttribute:o})}case i.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,T=[],_=a.map((g,I)=>{if(it.isInRange(I,u)){const L=l(n({},g),{result:rt.batchUpdateTrackID({id:o,newID:s,result:g.result})});return T.push({imgIndex:I,newInfo:L}),L}return g});return c&&c([_[p]],K.BatchUpdateTrackID,p,_,{updateImgList:T}),l(n({},t),{imgList:_})}case i.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,T=[],_=a.map((g,I)=>{if(it.isInRange(I,u)){const L=l(n({},g),{result:rt.batchUpdateResultByTrackID({id:o,newData:s,result:g.result})});return T.push({imgIndex:I,newInfo:L}),L}return g});return c&&c([_[p]],K.BatchUpdateTrackID,p,_,{updateImgList:T}),l(n({},t),{imgList:_})}case i.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]=ct.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=l(n({},I),{result:JSON.stringify(D)});return _.push({imgIndex:L,newInfo:R}),R}return I});return o==null||o(g,K.BatchUpdateImgList,-1,g,{updateImgList:_}),l(n({},t),{imgList:g})}default:return t}};export{Nt as LoadFileAndFileData,jt as annotationReducer,Ft as composeResultByToolInstance,B as getStepConfig,bt as getTotalPage};
|
package/es/utils/StepUtils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EStepType as
|
|
1
|
+
import{EStepType as u}from"../constant/index.js";import r from"./ToolUtils.js";class n{static getCurrentStepInfo(e,o){const t=this.getStepInfo(e,o);return[u.QUALITY_INSPECTION,u.MANUAL_CORRECTION].includes(t==null?void 0:t.type)?this.getStepInfo(t.dataSourceStep,o):t}static getStepInfo(e,o){return o==null?void 0:o.filter(t=>t.step===e)[0]}static currentToolIsVideo(e,o){const t=n.getCurrentStepInfo(e,o);return r.isVideoTool(t==null?void 0:t.tool)}static currentToolIsAudio(e,o){const t=n.getCurrentStepInfo(e,o);return r.isAudioTool(t==null?void 0:t.tool)}static currentToolIsPointCloud(e,o){const t=n.getCurrentStepInfo(e,o);return r.isPointCloudTool(t==null?void 0:t.tool)}}export{n as default};
|
package/es/utils/ToolUtils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cTool as r}from"@labelbee/lb-annotation";const{EVideoToolName:
|
|
1
|
+
import{cTool as r}from"@labelbee/lb-annotation";const{EVideoToolName:u,EPointCloudName:h,EToolName:l,EAudioToolName:M}=r;class T{static isVideoTool(t){return t?Object.values(u).includes(t):!1}static isAudioTool(t){return t?Object.values(M).includes(t):!1}static isPointCloudTool(t){return t?Object.values(h).includes(t):!1}static getPointCloudToolList(){return[l.Point,l.Line,l.PointCloudPolygon]}static getPointToLineDistance(t,o,a){const i=Math.abs(Math.sqrt(Math.pow(t.x-o.x,2)+Math.pow(t.y-o.y,2))),n=Math.abs(Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))),e=Math.abs(Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2))),s=(i+n+e)/2,c=Math.abs(Math.sqrt(s*(s-i)*(s-n)*(s-e)));return 2*c/e}}export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"antd";import{cStyle as b}from"@labelbee/lb-annotation";import"lodash";import l from"decimal.js";import c from"moment";const{COLORS_ARRAY:a,ICON_ARRAY:$,INVALID_ICON:F,NULL_COLOR:d,NULL_ICON:k,WHITE_FONT_COLOR_ARRAY:h}=b,C={label:"\u6587\u672C",key:"text",required:!1,default:"",maxLength:1e3},I=(t,e)=>{var r,n;try{const o=i(t,e);return(n=(r=e[o])==null?void 0:r.key)!=null?n:t}catch(o){return t}},i=(t,e)=>{try{return e.findIndex(n=>n.value===t)}catch(r){return-1}},m=(t,e)=>{try{const r=i(t,e);return r===-1?d:a[r%a.length]}catch(r){return d}},p=(t,e)=>{try{const r=m(t,e);return h.includes(r)?"#fff":"#333"}catch(r){return"#333"}},g=(t,e)=>{var r;try{const n=((r=t.match(/\((.*)\)/))==null?void 0:r[1].split(","))||[];return n.splice(3,1,e.toString()),`rgba(${n.join(",")})`}catch(n){return t}},A=(t,e)=>new l(Number(t)||0).minus(Number(e)||0).toNumber(),_=(t,e)=>new l(t).add(e).toNumber(),v=t=>{let e=null;return n=>e?n.target===(e==null?void 0:e.target):(e=n,setTimeout(()=>{e=null},t),!1)},x=v(300),N=t=>{const e=Math.floor(t*1e3),r=c.duration(e);return`${Math.floor(r.asMinutes())}:${c.utc(e).format("ss")}`},O=(t,e="ss.S")=>{const r=Math.floor(t*1e3),n=c.duration(r);return`${E(Math.floor(n.asMinutes()))}:${c.utc(r).format(e)}`},E=t=>t<10?`0${t}`:t,R=(t,e)=>{let r=null,n=null;const o=t.length;if(o===0)return{min:r,max:n};let u=0;return e<t[u]?n=t[u]:(t.forEach((s,f)=>{e>s&&(r=s,u=f)}),r&&u<o-1&&(n=t[u+1])),{min:r,max:n}},y=()=>{const t=document.createEvent("Event");t.initEvent("resize",!0,!0),window.dispatchEvent(t)};export{C as DEFAULT_TEXT_CONFIG_ITEM,y as dispatchResizeEvent,N as formatTime,m as getAttributeColor,p as getAttributeFontColor,i as getAttributeIndex,I as getAttributeShowText,R as getCanMoveRange,x as isDoubleClick,_ as precisionAdd,A as precisionMinus,O as timeFormat,g as updateColorOpacity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as
|
|
1
|
+
import{ViewportProvider as S}from"../../components/customResizeHook/index.js";import{prefix as b}from"../../constant/index.js";import{Spin as C}from"antd";import{Layout as _}from"antd/es";import t,{useState as O}from"react";import M from"./annotationOperation/index.js";import V from"./annotationTips/index.js";import k from"./sidebar/index.js";import g 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 y 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 p from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as B}from"../../store/ctx.js";import{EToolName as s}from"../../data/enums/ToolType.js";import D from"./LLMLayout/index.js";import U from"../../components/audioAnnotate/index.js";import{LoadingOutlined as z}from"@ant-design/icons";import{useTranslation as q}from"react-i18next";import{EAudioToolName as h}from"@labelbee/lb-annotation";var G=Object.defineProperty,x=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,j=(e,o,n)=>o in e?G(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,r=(e,o)=>{for(var n in o||(o={}))J.call(o,n)&&j(e,n,o[n]);if(x)for(var n of x(o))K.call(o,n)&&j(e,n,o[n]);return e};const{Sider:Q,Content:X}=_,u=`${b}-layout`,Y=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(V,{path:e.path,tips:e.tips}),t.createElement(M,r({},e)),t.createElement(g,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},Z=e=>{var o;return t.createElement(t.Fragment,null,t.createElement(H,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit}),t.createElement(g,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},ee=e=>{var o;const{stepList:n,step:i}=e,a=(o=E(n,i))==null?void 0:o.tool,d=y.isVideoTool(a),l=y.isPointCloudTool(a);return d?t.createElement(I,r({},e)):l?t.createElement(Z,r({},e)):t.createElement(Y,r({},e))},T=e=>{var o,n,i;const{t:a}=q(),{stepList:d,step:l}=e,m=(o=E(d,l))==null?void 0:o.tool,c=![s.LLM,h.AudioTextTool].includes(m),f=![s.LLM].includes(m),v=![s.LLM,h.AudioTextTool].includes(m);return t.createElement(S,null,t.createElement(C,{spinning:e.loading,indicator:t.createElement(z,null),tip:t.createElement("span",{style:{marginTop:200}},a("LoadingTips")),delay:500},t.createElement(_,{className:W([u,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${u}__header`,style:(i=e.style)==null?void 0:i.header},t.createElement(F,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:c,hasHeaderOption:f,hasPredictTrackingIcon:v})),e.children)))},te=e=>{var o,n,i,a,d,l,m;const[c,f]=O(void 0),v=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:w,step:P}=e,L=(i=E(w,P))==null?void 0:i.tool,A=s.LLM===L,N=y.isAudioTool(L);return A?t.createElement(T,r({},e),t.createElement(D,r({},e))):N?t.createElement(T,r({},e),t.createElement(U,r({},e))):t.createElement(T,r({},e),t.createElement(_,{className:R("layout","container")},e==null?void 0:e.leftSider,t.createElement(X,{className:`${u}__content`},t.createElement(ee,r({},e)),t.createElement(p,null)),t.createElement(Q,{className:`${u}__side`,width:(a=c!=null?c:v)!=null?a:240,style:(d=e.style)==null?void 0:d.sider},t.createElement(k,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:f,propsSiderWidth:(m=(l=e.style)==null?void 0:l.sider)==null?void 0:m.width}))))},oe=({annotation:e})=>{var o,n,i;const{imgList:a,loading:d}=e,l=(o=a[e.imgIndex])!=null?o:{};return{path:(i=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?i:"",loading:d}};var ne=$(oe,null,null,{context:B})(te);export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Slider as
|
|
1
|
+
import{Slider as f}from"antd/es";import o from"react";import g from"../../../../assets/toolStyle/icon_border.svg.js";import b from"../../../../assets/toolStyle/icon_borderColor.svg.js";import S from"../../../../assets/toolStyle/icon_opacityStroke.svg.js";import h from"../../../../assets/toolStyle/icon_opacityFill.svg.js";import{connect as k}from"react-redux";import{UpdateToolStyleConfig as O}from"../../../../store/toolStyle/actionCreators.js";import{store as w}from"../../../../index.js";import{LabelBeeContext as C}from"../../../../store/ctx.js";import{useTranslation as x}from"react-i18next";const T=(e,a)=>{const l=[{step:1,value:"1"},{step:2,value:"2"},{step:3,value:"3"},{step:4,value:"4"},{step:5,value:"5"}],n=[{step:1,value:"Blue"},{step:3,value:"Cyan"},{step:5,value:"Green"},{step:7,value:"Yellow"},{step:9,value:"Pink"}],i=[{step:1,value:"0.2"},{step:3,value:"0.4"},{step:5,value:"0.6"},{step:7,value:"0.8"},{step:9,value:"1.0"}],u=[{step:1,value:"0"},{step:3,value:"0.2"},{step:5,value:"0.4"},{step:7,value:"0.6"},{step:9,value:"0.8"}];let r=[];const s={};switch(e){case"width":r=l;break;case"color":r=n;break;case"borderOpacity":r=i;break;case"fillOpacity":r=u;break}return r.forEach(({step:c,value:p})=>{s[c]={style:{color:"#999999",fontSize:"12px"},label:o.createElement("span",null,a(p))}}),s},j=e=>{switch(e){case"width":return"BorderThickness";case"color":return"Color";case"borderOpacity":return"BorderOpacity";case"fillOpacity":return"FillOpacity";default:return""}},E=e=>{switch(e){case"width":return g;case"color":return b;case"borderOpacity":return S;case"fillOpacity":return h}},_=e=>{switch(e){case"width":return 2;case"color":return 1;case"borderOpacity":return 9;case"fillOpacity":return 9}},y=e=>["width"].includes(e),M=e=>{const{toolStyle:a}=e,{width:l,color:n,borderOpacity:i,fillOpacity:u}=a,r={width:l,color:n,borderOpacity:i,fillOpacity:u},{t:s}=x(),c=e.config,p=m=>{w.dispatch(O(m))};return o.createElement("div",{className:"toolStyle"},Object.entries(r).map(m=>{var d;const t=m[0];return(c==null?void 0:c.attributeConfigurable)===!0&&t==="color"?null:o.createElement("div",{id:`style-${t}`,className:"styleSlider",key:t},o.createElement("span",{className:"title"},o.createElement("img",{src:E(t),className:"icon"}),s(j(t))),o.createElement("span",{className:"slider"},o.createElement(f,{tipFormatter:null,max:y(t)?5:10,min:y(t)?1:0,step:y(t)?1:null,value:(d=a[t])!=null?d:_(t),marks:T(t,s),onChange:v=>p({[t]:v})})))}))},N=({toolStyle:e,annotation:a})=>{var l;return{toolStyle:e,config:(l=a.toolInstance)==null?void 0:l.config}};var $=k(N,null,null,{context:C})(M);export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"lodash";import{forward as a,backward as c,rewind as i,forwardForward as l,speed as r,tag as e,toggleTagMode as d,period as s,clipSelected as u,saveResult as p,attributeLock as m,attributeClickLock as g,playPause as k,setValid as D,fullScreen as f,deleteRemark as T,preRemark as w,nextRemark as C}from"../common/index.js";import{preLine as x,nextLine as b}from"../line/index.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js";import y from"../../../../../../assets/annotation/toolHotKeyIcon/icon_polygonCut_kj.svg.js";const A=o.cloneDeep(a),F=o.cloneDeep(c),R=o.cloneDeep(i),_=o.cloneDeep(l),h=o.cloneDeep(r),v=o.cloneDeep(e),I=o.cloneDeep(d),L=o.cloneDeep(s),M=o.cloneDeep(e),S=o.cloneDeep(u),P=o.cloneDeep(x),B=o.cloneDeep(b),t={name:"\u5408\u5E76\u533A\u95F4",icon:j,noticeInfo:"",shortCut:["Alt","Z"]},n={name:"\u5206\u5272\u533A\u95F4",icon:y,noticeInfo:"",shortCut:["Alt","X"]},H=[p,I,L,M,S,v,m,g,k,h,_,R,D,f,F,A,T,w,C,P,B,t,n];export{t as combineAudio,H as default,n as splitAudio};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../../../../../../assets/annotation/toolHotKeyIcon/icon_cencel_kj.svg.js";import i from"../../../../../../assets/annotation/toolHotKeyIcon/icon_reform_kj.svg.js";import a from"../../../../../../assets/annotation/toolHotKeyIcon/icon_loupe_kj.svg.js";import c from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_middle_kj.svg.js";import r from"../../../../../../assets/annotation/toolHotKeyIcon/icon_fullView_kj.svg.js";import m from"../../../../../../assets/annotation/toolHotKeyIcon/icon_reload_kj.svg.js";import u from"../../../../../../assets/annotation/toolHotKeyIcon/setValid.svg.js";import g from"../../../../../../assets/annotation/toolHotKeyIcon/icon_last_kj.svg.js";import l from"../../../../../../assets/annotation/toolHotKeyIcon/icon_next_kj.svg.js";import t from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import n from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import f from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_alttab_kj.svg.js";import p from"../../../../../../assets/annotation/toolHotKeyIcon/icon_save_kj.svg.js";import _ from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineSpecial_kj.svg.js";import h from"../../../../../../assets/annotation/toolHotKeyIcon/icon_noDisplay.svg.js";import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_eyeLock_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_playPause.svg.js";import v from"../../../../../../assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js";import d from"../../../../../../assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js";import k from"../../../../../../assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js";import I from"../../../../../../assets/annotation/audio/tag.svg.js";import y from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tag_kj.svg.js";import H from"../../../../../../assets/annotation/video/icon_clip.svg.js";import $ from"../../../../../../assets/annotation/toolHotKeyIcon/icon_frameActive_kj.svg.js";import K from"../../../../../../assets/annotation/toolHotKeyIcon/deleteRemark.svg.js";import S from"../../../../../../assets/annotation/toolHotKeyIcon/preRemark.svg.js";import b from"../../../../../../assets/annotation/toolHotKeyIcon/nextRemark.svg.js";const E={name:"Undo",icon:e,shortCut:["Ctrl","Z"]},R={name:"Redo",icon:i,shortCut:["Ctrl","Shift","Z"]},F={name:"Scale",icon:a,shortCut:[c]},T={name:"Fullscreen",icon:r,shortCut:["F11"]},D={name:"Rotate",icon:m,shortCut:["R"],noticeInfo:"ToOriginalStep"},w={name:"ToggleEffectiveness",icon:u,shortCut:["Y"]},A={name:"PreviousImage",icon:g,shortCut:["A"]},B={name:"NextImage",icon:l,shortCut:["D"]},L={name:"Drag",icon:t,shortCut:[n],noticeInfo:"Press"},P={name:"Drag",icon:t,shortCut:["Space",o]},x={name:"SpecifiedAttributesOnly",icon:s,shortCut:["Shift","Number"]},U={name:"SpecifiedAttributesOnly",icon:s,shortCut:["Shift",o]},O={name:"ToggleSelected",icon:f,shortCut:["Tab"]},V={name:"ToggleSelectedReverse",icon:j,shortCut:["Shift","Tab"]},Z={name:"HideGraphics",icon:h,noticeInfo:"",shortCut:["Z"]},N={name:"ToggleLineParticularity",icon:_,noticeInfo:"ToSide",shortCut:["Shift",o]},W={name:"Save",icon:p,shortCut:["Ctrl","S"]},q={name:"Speed",icon:k,shortCut:["↑","↓"],shortCutUseHtml:!0},G={name:"PlayPause",icon:C,shortCut:["Space"]},M={name:"FastForward",icon:v,shortCut:["→"],shortCutUseHtml:!0},X={name:"Rewind",icon:d,shortCut:["←"],shortCutUseHtml:!0},Y={name:"\u5207\u6362\u6807\u7B7E\u6A21\u5F0F",icon:I,shortCut:["L"]},z={name:"\u6253\u6807\u7B7E",icon:y,shortCut:[o],noticeInfo:"\u5DE6\u51FB"},J={name:"\u622A\u53D6\u7247\u6BB5",icon:H,noticeInfo:"\u4E24\u6B21",shortCut:["X"]},Q={name:"\u622A\u53D6\u9009\u4E2D",icon:$,shortCut:[n],noticeInfo:"\u53F3\u51FB"},oo={name:"\u5220\u9664\u6279\u6CE8",icon:K,shortCut:["Delete"],noticeInfo:"\u9009\u4E2D\u65F6"},to={name:"\u4E0B\u4E00\u6761\u6279\u6CE8",icon:b,shortCut:["Tab"]},no={name:"\u4E0A\u4E00\u6761\u6279\u6CE8",icon:S,shortCut:["Shift","Tab"]};export{U as attributeClickLock,x as attributeLock,A as backward,N as changeSpecialLine,Q as clipSelected,P as dargWithLeftClick,L as dargWithRightClick,oo as deleteRemark,B as forward,M as forwardForward,T as fullScreen,Z as hidden,to as nextRemark,J as period,G as playPause,no as preRemark,R as restore,E as revoke,X as rewind,D as rotate,W as saveResult,F as scale,w as setValid,q as speed,O as tabChangeSelected,V as tabReverseChangeSelected,z as tag,Y as toggleTagMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useContext as
|
|
1
|
+
import e,{useContext as v}from"react";import k from"../../../../../assets/annotation/toolHotKeyIcon/icon_kj1.svg.js";import w from"../../../../../assets/annotation/toolHotKeyIcon/icon_kj_h.svg.js";import{EToolName as a}from"../../../../../data/enums/ToolType.js";import L from"./rectToolShortCutTable/index.js";import N 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"./audioText/index.js";import{footerCls as B}from"../../index.js";import{useTranslation as D}from"react-i18next";import{EAudioToolName as F,cTool as z}from"@labelbee/lb-annotation";import{PointCloudContext as U}from"../../../../../components/pointCloudView/PointCloudContext.js";import q from"../../FooterPopover.js";import{EPointCloudPattern as T}from"@labelbee/lb-utils";var J=Object.defineProperty,C=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,b=(o,r,t)=>r in o?J(o,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[r]=t,Z=(o,r)=>{for(var t in r||(r={}))Q.call(r,t)&&b(o,t,r[t]);if(C)for(var t of C(r))X.call(r,t)&&b(o,t,r[t]);return o};const{EVideoToolName:ee,EPointCloudName:u}=z,f={[a.Rect]:L,[a.Tag]:H,[a.Point]:N,[a.Polygon]:O,[a.Line]:I,[a.Text]:R,[ee.VideoTagTool]:G,[u.PointCloud]:M,[u.PointCloud+"_POLYGON"]:K,[u.PointCloud+"_SEGMENT"]:V,[a.ScribbleTool]:A,[a.Cuboid]:W,[a.LLM]:Y,[F.AudioTextTool]:$},te=({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}=D(),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=(l,c)=>e.createElement("div",{style:d,key:c},e.createElement("span",{style:{display:"flex",alignItems:"center"}},e.createElement(te,{icon:l.icon}),e.createElement("span",{style:{marginLeft:l.icon?16:0}},m(l.name))),e.createElement("span",{style:{display:"flex",alignItems:"center"}},l.noticeInfo&&e.createElement("span",{style:{marginRight:"5px",color:"#CCCCCC"}},m(l.noticeInfo)),x(l.shortCut,l.shortCutUseHtml,l.linkSymbol))),x=(l,c=!1,_="+")=>{if(!l)return null;const j=l.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<l.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:`${B}__hotkey-content`},t==null?void 0:t.map((l,c)=>y(l,c))),P=r||{};return e.createElement(q,{hoverIcon:w,icon:k,title:m("Hotkeys"),content:S,containerStyle:P})},oe=({style:o,title:r,toolName:t})=>{const{pointCloudPattern:m,globalPattern:d}=v(U);if(!t||!f[t])return null;let s=t;switch(d){case T.Detection:switch(m){case a.Polygon:s+="_POLYGON";break;case a.Line:s=a.Line;break;case a.Point:s=a.Point;break}break;case T.Segmentation:s=u.PointCloud+"_SEGMENT";break}const y={style:o,title:r,shortCutList:f[s]};return e.createElement(E,Z({},y))};export{E as ToolHotKeyCom,oe as default,f as shortCutTable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _ from"../../../../../../assets/annotation/toolHotKeyIcon/icon_line_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import f from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineNull_kj.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_straightLine_kj.svg.js";import h from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineActive_kj.svg.js";import t from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import p from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineChange_kj.svg.js";import
|
|
1
|
+
import _ from"../../../../../../assets/annotation/toolHotKeyIcon/icon_line_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import f from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineNull_kj.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_straightLine_kj.svg.js";import h from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineActive_kj.svg.js";import t from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import p from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineChange_kj.svg.js";import u from"../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineCont_kj.svg.js";import I from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineInsert_kj.svg.js";import d from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineDel_kj.svg.js";import v from"../../../../../../assets/annotation/toolHotKeyIcon/icon_unGrip_kj.svg.js";import k from"../../../../../../assets/annotation/toolHotKeyIcon/icon_up.svg.js";import L from"../../../../../../assets/annotation/toolHotKeyIcon/icon_down.svg.js";import{changeSpecialLine as H,revoke as y,restore as K,rotate as $,scale as S,backward as b,forward as A,setValid as P,dargWithRightClick as D,dargWithLeftClick as x,hidden as T,tabChangeSelected as w,tabReverseChangeSelected as O}from"../common/index.js";const n={name:"AnnotateLine",icon:_,shortCut:[o]},e={name:"AnnotateInvalidLine",icon:f,shortCut:["Ctrl",o]},i={name:"HorizontalOrVertical",icon:j,shortCut:["Shift",o]},s={name:"SelectLine",icon:h,shortCut:[t]},a={name:"ToggleLineEffectiveness",icon:p,shortCut:["F"]},c={name:"DeleteLine",icon:u,noticeInfo:"SelectAndDoubleClick",shortCut:[t]},r={name:"ContinueToLabel",icon:C,noticeInfo:"Select",shortCut:["Space"]},l={name:"InsertPoint",icon:I,noticeInfo:"ClickOnLine",shortCut:[o]},m={name:"DeletePoint",icon:d,noticeInfo:"DblClickOnPoint",shortCut:[t]},g={name:"StopAdsorption",icon:v,noticeInfo:"Press",shortCut:["Alt"]},W={name:"PreviousLine",icon:k,shortCut:["W"]},z={name:"NextLine",icon:L,shortCut:["S"]},N=[n,e,i,s,a,c,r,H,l,m,g,y,K,$,S,b,A,P,D,x,T,w,O];export{a as changeLineAttribute,N as default,c as deleteLine,m as deletePoint,i as horizontalLine,l as insertPoint,e as invalidLine,r as keepLine,n as line,z as nextLine,W as preLine,s as selectLine,g as suspendAbsorption};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Switch as
|
|
1
|
+
import{Switch as s}from"antd";import t,{useContext as a}from"react";import{useTranslation as u}from"react-i18next";import{PointCloudContext as m}from"../../../../components/pointCloudView/PointCloudContext.js";import{useStatus as l}from"../../../../components/pointCloudView/hooks/useStatus.js";const d=()=>{const{cuboidBoxIn2DView:o,setCuboidBoxIn2DView:n}=a(m),{t:e}=u(),{isPointCloudSegmentationPattern:i}=l(),r=c=>{n(c)};return i?null:t.createElement(t.Fragment,null,t.createElement("span",{style:{marginRight:10}},e("ImageLabels")),t.createElement(s,{checkedChildren:e("3DRect"),unCheckedChildren:e("2DRect"),checked:o,onChange:r}))};export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r,{useState as j,useContext as k,useCallback as d}from"react";import{useDispatch as h,useSelector as E}from"../../../../store/ctx.js";import _ from"../../../../assets/annotation/common/icon_r.svg.js";import A from"../../../../assets/annotation/common/icon_next.svg.js";import H from"../../../../assets/annotation/common/icon_back.svg.js";import P from"../../../../assets/annotation/common/icon_rA.svg.js";import $ from"../../../../assets/annotation/common/icon_nextA.svg.js";import w from"../../../../assets/annotation/common/icon_backA.svg.js";import R from"../../../../assets/annotation/common/icon_save.svg.js";import V from"../../../../assets/annotation/common/icon_saveA.svg.js";import{prefix as z}from"../../../../constant/index.js";import{EToolName as B}from"../../../../data/enums/ToolType.js";import{ChangeSave as D}from"../../../../store/annotation/actionCreators.js";import{useTranslation as I}from"react-i18next";import{EAudioToolName as L,cTool as M}from"@labelbee/lb-annotation";import{PointCloudContext as O}from"../../../../components/pointCloudView/PointCloudContext.js";import{EPointCloudPattern as v}from"@labelbee/lb-utils";const{EVideoToolName:g,EPointCloudName:K}=M;var e;(function(a){a.Hover="#666fff",a.Normal="#999999"})(e||(e={}));const U=a=>{const[l,c]=j(""),{stepInfo:t}=a,p=h(),{annotation:{toolInstance:n,onSave:f}}=E(o=>({annotation:o.annotation,imgAttribute:o.imgAttribute})),{globalPattern:S}=k(O),{t:N}=I(),m=[B.Tag,g.VideoTagTool].includes(t==null?void 0:t.tool),u=[g.VideoTagTool].includes(t==null?void 0:t.tool),T=[K.PointCloud].includes(t==null?void 0:t.tool),x=[L.AudioTextTool].includes(t==null?void 0:t.tool),i=a.isBegin||m,b=()=>{t.dataSourceStep!==0&&t.dataSourceStep!==void 0||n==null||n.updateRotate()},y=d(()=>{n==null||n.undo()},[n]),C=d(()=>{n==null||n.redo()},[n]);let s=[{toolName:"save",title:"Save",show:!!f,commonSvg:R,selectedSvg:V,click:()=>{p(D)},style:{fontSize:"12px",color:!i&&l==="save"?e.Hover:e.Normal}},{toolName:"revocation",title:"Undo",show:!0,commonSvg:H,selectedSvg:w,click:()=>{m||y()},style:{opacity:i===!0?.4:1,fontSize:"12px",color:!i&&l==="revocation"?e.Hover:e.Normal}},{toolName:"restore",title:"Redo",show:!0,commonSvg:A,selectedSvg:$,click:()=>{m||C()},style:{opacity:i===!0?.4:1,fontSize:"12px",color:!i&&l==="restore"?e.Hover:e.Normal}},{toolName:"rotate",title:"Rotate",show:!0,selectedSvg:P,commonSvg:_,click:()=>{u||b()},style:{opacity:u===!0?.4:1,fontSize:"12px",color:!i&&l==="rotate"?e.Hover:e.Normal}}];if(T)switch(S){case v.Segmentation:s=s.slice(0,1);break;case v.Detection:s=s.slice(0,3);break}return x&&(s=s.slice(0,1)),r.createElement("div",{className:`${z}-header__hotKey`},s.map(o=>o.show&&r.createElement("div",{key:o.toolName,className:"item",onMouseEnter:()=>c(o.toolName),onMouseLeave:()=>c("")},r.createElement("a",{className:"item",onClick:o.click},r.createElement("img",{className:"singleTool",src:l===o.toolName?o.selectedSvg:o.commonSvg,style:o.style}),r.createElement("div",{style:o.style},N(o.title))))))};export{U as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.16.0-alpha.
|
|
3
|
+
"version": "1.16.0-alpha.10",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,19 +43,22 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.19.0-alpha.
|
|
47
|
-
"@labelbee/lb-utils": "1.12.0-alpha.
|
|
46
|
+
"@labelbee/lb-annotation": "1.19.0-alpha.4",
|
|
47
|
+
"@labelbee/lb-utils": "1.12.0-alpha.2",
|
|
48
|
+
"@labelbee/wavesurfer": "1.0.0-alpha.3",
|
|
49
|
+
"@types/react-dom": "^18.2.7",
|
|
48
50
|
"ahooks": "^3.4.0",
|
|
49
51
|
"classnames": "^2.3.0",
|
|
52
|
+
"decimal.js": "^10.4.3",
|
|
50
53
|
"lodash": "^4.17.21",
|
|
51
54
|
"postcss-url": "^10.1.3",
|
|
55
|
+
"react-colorful": "^5.6.1",
|
|
52
56
|
"react-i18next": "^11.12.0",
|
|
53
57
|
"react-redux": "^7.2.3",
|
|
54
58
|
"redux": "^4.0.5",
|
|
55
59
|
"redux-actions": "^2.6.5",
|
|
56
60
|
"redux-thunk": "^2.3.0",
|
|
57
|
-
"resize-observer-polyfill": "^1.5.1"
|
|
58
|
-
"react-colorful": "^5.6.1"
|
|
61
|
+
"resize-observer-polyfill": "^1.5.1"
|
|
59
62
|
},
|
|
60
63
|
"peerDependencies": {
|
|
61
64
|
"antd": ">=4.15.0",
|
|
@@ -78,6 +81,7 @@
|
|
|
78
81
|
"commitizen": "^4.2.4",
|
|
79
82
|
"cross-env": "^7.0.3",
|
|
80
83
|
"cz-conventional-changelog": "^3.3.0",
|
|
84
|
+
"debounce": "^1.2.1",
|
|
81
85
|
"esbuild": "^0.11.0",
|
|
82
86
|
"eslint": "7.20.0",
|
|
83
87
|
"eslint-config-airbnb": "18.2.1",
|