@labelbee/lb-components 1.24.0-alpha.6 → 1.24.0-alpha.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/2DViewWorker.js +1 -1
- package/dist/assets/annotation/rectTool/three_points_rect.svg.js +1 -0
- package/dist/assets/annotation/rectTool/two_points_rect.svg.js +1 -0
- package/dist/components/DynamicResizer/DynamicResizer.js +1 -1
- package/dist/components/DynamicResizer/hooks/useDrag.js +1 -1
- package/dist/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
- package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
- package/dist/components/DynamicResizer/utils/index.js +1 -0
- package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -1
- package/dist/components/LLMMultiWheelView/index.js +1 -1
- package/dist/components/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/modelAPIView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/audioView/index.js +1 -0
- package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/dist/components/LLMToolView/questionView/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/attributeInputEditor/index.js +1 -0
- package/dist/components/attributeList/index.js +1 -1
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/longText/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/components/TitleButton/index.js +1 -1
- package/dist/components/pointCloudView/components/UnifyParamsModal/index.js +1 -1
- package/dist/components/pointCloudView/components/sideAndBackOverView/index.js +1 -1
- package/dist/components/pointCloudView/hooks/useConfig.js +1 -1
- package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudAttribute.js +1 -0
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/tagList/index.js +1 -1
- package/dist/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -1
- package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -1
- package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +2 -1
- package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -1
- package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -1
- package/dist/components/videoAnnotate/videoClipTool/index.js +2 -1
- package/dist/components/videoPlayer/components/SpeedController/index.js +1 -1
- package/dist/components/videoPlayer/index.js +1 -1
- package/dist/constant/index.js +1 -1
- package/dist/index.css +161 -96
- package/dist/store/Actions.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/store/toolConfig/pointCloudToolConfig.js +1 -1
- package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +3 -3
- package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +24 -7
- package/dist/types/components/DynamicResizer/hooks/useDraggingAllowed.d.ts +12 -0
- package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +10 -21
- package/dist/types/components/DynamicResizer/types/interface.d.ts +14 -6
- package/dist/types/components/DynamicResizer/utils/index.d.ts +4 -0
- package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +2 -0
- package/dist/types/components/LLMMultiWheelView/index.d.ts +2 -0
- package/dist/types/components/LLMToolView/questionView/components/audioView/index.d.ts +8 -0
- package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +3 -1
- package/dist/types/components/attributeInputEditor/index.d.ts +8 -0
- package/dist/types/components/attributeList/components/limitPopover/index.d.ts +2 -2
- package/dist/types/components/longText/index.d.ts +1 -1
- package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +0 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +4 -0
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -0
- package/dist/types/components/pointCloudView/hooks/useConfig.d.ts +2 -1
- package/dist/types/components/pointCloudView/hooks/usePointCloudAttribute.d.ts +3 -0
- package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +1 -2
- package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +1 -2
- package/dist/types/components/pointCloudView/index.d.ts +2 -0
- package/dist/types/components/videoAnnotate/videoClipTool/VideoClipToolContext.d.ts +1 -0
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +32 -1
- package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/components/videoAnnotate/videoTextTool/index.d.ts +1 -1
- package/dist/types/components/videoPlayer/index.d.ts +1 -1
- package/dist/types/constant/index.d.ts +4 -2
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/annotation/actionCreators.d.ts +9 -1
- package/dist/types/store/annotation/map.d.ts +1 -0
- package/dist/types/store/annotation/reducer.d.ts +5 -1
- package/dist/types/store/annotation/types.d.ts +4 -2
- package/dist/types/store/toolConfig/types.d.ts +2 -0
- package/dist/types/utils/LLM.d.ts +6 -0
- package/dist/types/views/MainView/index.d.ts +2 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +9 -0
- package/dist/types/views/MainView/sidebar/GlobalTagList/index.d.ts +9 -0
- package/dist/types/views/MainView/sidebar/VideoClipToolAttributeList/index.d.ts +11 -0
- package/dist/types/views/MainView/sidebar/index.d.ts +2 -0
- package/dist/utils/LLM.js +1 -0
- package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/GlobalTagList/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/ToolIcons.js +1 -1
- package/dist/views/MainView/sidebar/VideoClipToolAttributeList/index.js +1 -0
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/es/_virtual/2DViewWorker.js +1 -1
- package/es/assets/annotation/rectTool/three_points_rect.svg.js +1 -0
- package/es/assets/annotation/rectTool/two_points_rect.svg.js +1 -0
- package/es/components/DynamicResizer/DynamicResizer.js +1 -1
- package/es/components/DynamicResizer/hooks/useDrag.js +1 -1
- package/es/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
- package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
- package/es/components/DynamicResizer/utils/index.js +1 -0
- package/es/components/LLMMultiWheelView/dialogView/index.js +1 -1
- package/es/components/LLMMultiWheelView/index.js +1 -1
- package/es/components/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/modelAPIView/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/audioView/index.js +1 -0
- package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/es/components/LLMToolView/questionView/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/attributeInputEditor/index.js +1 -0
- package/es/components/attributeList/index.js +1 -1
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/longText/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/components/TitleButton/index.js +1 -1
- package/es/components/pointCloudView/components/UnifyParamsModal/index.js +1 -1
- package/es/components/pointCloudView/components/sideAndBackOverView/index.js +1 -1
- package/es/components/pointCloudView/hooks/useConfig.js +1 -1
- package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudAttribute.js +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/tagList/index.js +1 -1
- package/es/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -1
- package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -1
- package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +2 -1
- package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -1
- package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -1
- package/es/components/videoAnnotate/videoClipTool/index.js +2 -1
- package/es/components/videoPlayer/components/SpeedController/index.js +1 -1
- package/es/components/videoPlayer/index.js +1 -1
- package/es/constant/index.js +1 -1
- package/es/index.css +161 -96
- package/es/store/Actions.js +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/toolConfig/pointCloudToolConfig.js +1 -1
- package/es/utils/LLM.js +1 -0
- package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/es/views/MainView/sidebar/GlobalTagList/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/ToolIcons.js +1 -1
- package/es/views/MainView/sidebar/VideoClipToolAttributeList/index.js +1 -0
- package/es/views/MainView/sidebar/index.js +1 -1
- package/package.json +8 -8
- package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
- package/dist/components/DynamicResizer/assets/divider.svg.js +0 -1
- package/dist/components/DynamicResizer/assets/topToZero.svg.js +0 -1
- package/es/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
- package/es/components/DynamicResizer/assets/divider.svg.js +0 -1
- package/es/components/DynamicResizer/assets/topToZero.svg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ANNOTATION_ACTIONS as
|
|
1
|
+
import{ANNOTATION_ACTIONS as o}from"../Actions.js";import{LoadFileAndFileData as G,getStepConfig as b}from"./reducer.js";import{ESubmitType as E}from"../../constant/index.js";import{EPageTurningOperation as y}from"../../data/enums/AnnotationSize.js";import J from"../../utils/PageOperator.js";import{jsonParser as X}from"../../utils/index.js";import{i18n as W}from"@labelbee/lb-utils";import{EVideoToolName as q}from"@labelbee/lb-annotation";import{getBoxesByTrackID as z}from"../../components/predictTracking/previewResult/util.js";import{Modal as Z}from"antd";var I=(t,n,e)=>new Promise((a,r)=>{var i=l=>{try{u(e.next(l))}catch(p){r(p)}},s=l=>{try{u(e.throw(l))}catch(p){r(p)}},u=l=>l.done?a(l.value):Promise.resolve(l.value).then(i,s);u((e=e.apply(t,n)).next())});const w=(t,n)=>n.map(e=>t(e)),$=t=>t===y.Forward?E.Forward:t===y.Backward?E.Backward:t===y.Jump?E.Jump:E.Forward,Q=(t,n)=>{var e,a,r;const{imgList:i,imgIndex:s}=t,{dataSourceStep:u}=b(t.stepList,t.step);return((r=(a=X((e=i[s-1])==null?void 0:e.result)[`step_${u}`])==null?void 0:a.result)==null?void 0:r.length)-1||n};function tt(t){return{type:o.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function k({stepList:t}){return{type:o.SET_TASK_STEP_LIST,payload:{stepList:t}}}function F({stepList:t,step:n}){return{type:o.SET_TASK_CONFIG,payload:{stepList:t,step:n}}}function U(t){return{type:o.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function L(t){return{type:o.UPDATE_ON_SAVE,payload:{onSave:t}}}function D(t){return{type:o.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function C(t){return{type:o.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function R(t){return{type:o.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function g(t){return{type:o.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function B(t){return{type:o.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function nt(){return{type:o.UPDATE_ROTATE}}function H(t){return{type:o.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function h(t){return{type:o.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function v(t){return{type:o.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function et(){return{type:o.COPY_BACKWARD_RESULT}}function M(t){return{type:o.UPDATE_IMG_INDEX_BY_EXTERNAL,payload:{getImgIndexByExternal:t}}}function ot({id:t,newID:n,rangeIndex:e,imgList:a}){return{type:o.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:n,rangeIndex:e,imgList:a}}}function at(t,n,e,a){return{type:o.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:n,rangeIndex:e,imgList:a}}}function rt(){return{type:o.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const j=t=>({type:o.SET_CHECK_MODE,payload:{checkMode:t}}),N=t=>({type:o.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function it({onSubmit:t,onSave:n,onPageChange:e,onStepChange:a,getFileData:r,pageSize:i,loadFileList:s,step:u,stepList:l,skipBeforePageTurning:p,beforeRotate:T,checkMode:d,highlightAttribute:f,preDataProcess:_,getImgIndexByExternal:A}){const c=[];return t&&c.push(U(t)),n&&c.push(L(n)),e&&c.push(D(e)),a&&c.push(C(a)),r&&c.push(R(r)),s&&c.push(B(s)),i&&c.push(g(i)),p&&c.push(H(p)),T&&c.push(h(T)),_&&c.push(v(_)),typeof d=="boolean"&&c.push(j(d)),A&&c.push(M(A)),c.push(N(f)),c.push(F({stepList:l,step:u})),c.push({type:o.CALC_STEP_PROGRESS}),c.push({type:o.INIT_TOOL}),x=>w(x,c)}function ut({onSubmit:t,onSave:n,onPageChange:e,onStepChange:a,getFileData:r,pageSize:i,loadFileList:s,stepList:u,beforeRotate:l,highlightAttribute:p,preDataProcess:T}){const d=[];return t&&d.push(U(t)),n&&d.push(L(n)),e&&d.push(D(e)),a&&d.push(C(a)),r&&d.push(R(r)),s&&d.push(B(s)),i&&d.push(g(i)),l&&d.push(h(l)),T&&d.push(v(T)),d.push(N(p)),d.push(k({stepList:u})),f=>w(f,d)}const st=(t,n)=>{var e;const a=n==null?void 0:n.findIndex(r=>(r==null?void 0:r.step)===t);return(e=n[a+1])==null?void 0:e.step},lt=t=>(n,e)=>{const{annotation:a}=e(),{step:r,stepList:i}=a,s=st(r,i);return[n(K(s,t))]},K=(t,n)=>(e,a)=>{var r,i;const{annotation:s}=a();(r=s==null?void 0:s.onStepChange)==null||r.call(s,t);const u=(i=s==null?void 0:s.imgIndex)!=null?i:0;return[e({type:o.SUBMIT_RESULT}),e({type:o.SUBMIT_FILE_DATA,payload:{submitType:E.StepChanged}}),e({type:o.SET_STEP,payload:{toStep:t}}),e({type:o.CALC_STEP_PROGRESS}),e(G(n!=null?n:u,0))]},P=t=>n=>[n({type:o.SUBMIT_RESULT}),n({type:o.SUBMIT_FILE_DATA,payload:{submitType:t}})],pt=(t,n,e,a)=>I(void 0,null,function*(){S(t,!0),t(P(e)),yield t(Y(e)),t(G(n,a))}),dt=(t,n)=>[t({type:o.SUBMIT_RESULT}),t({type:o.SET_BASIC_INDEX,payload:{basicIndex:n}})],ct=(t,n)=>{t({type:o.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:n}})},Tt=(t=!1)=>(n,e)=>m(n,e,y.Backward,t),_t=(t=!1)=>(n,e)=>m(n,e,y.Forward,t),ft=(t,n=!1)=>(e,a)=>{if(t!==a().imgIndex)return m(e,a,y.Jump,n,t)},V=(t,n,e,a)=>I(void 0,null,function*(){var r;const{loadFileList:i,imgList:s,pageSize:u}=n().annotation,l=Math.floor(e/u);S(t,!0);try{const p=yield i(l,u);if(S(t,!1),!((r=p==null?void 0:p.fileList)==null?void 0:r.length)||!(p==null?void 0:p.total))throw new Error("fileList and total are required");const T=a?new Array(p.total):[...s];return T.splice(l*u,u,...p.fileList),t({type:o.UPDATE_IMG_LIST,payload:{imgList:T}}),!0}catch(p){S(t,!1),console.error(p)}}),m=(t,n,e,a=!1,r)=>I(void 0,null,function*(){t({type:o.CHANGE_PAGE_CHECK});const{t:i}=W,s=n(),{confirmPageTurning:u,stepList:l,step:p}=s.annotation||!1,T=b(l,p),{confirm:d,destroyAll:f}=Z;return!u||T.tool!==q.VideoTagTool?O(t,n,e,a,r):new Promise(_=>{f(),d({centered:!0,title:i("TheCurrentImageHasNotBeenAnnotatedYetAreYouSureToTurnThePage"),onCancel:()=>_(!1),onOk:()=>_(!0)})}).then(_=>_?O(t,n,e,a,r):Promise.resolve())}),O=(t,n,e,a=!1,r)=>I(void 0,null,function*(){var i,s;const u=n().annotation,l=$(e);let{fileIndexChanged:p,fileIndex:T,basicIndexChanged:d,basicIndex:f}=J.getNextPageInfo(e,u,r);const _=(i=u==null?void 0:u.getImgIndexByExternal)==null?void 0:i.call(u,u.imgIndex,l);if(_!==void 0&&(p=!0,T=_),ct(t,a),p){if(u.loading||!u.imgList[T]&&!(yield V(t,n,T)))return;const A=n();(s=u.onPageChange)==null||s.call(u,T);const c=l===E.Backward?Q(A.annotation,f):f;return pt(t,T,l,c)}return d?dt(t,f):t(P(l))}),Et=t=>{t(P(E.Save)),t({type:o.SAVE_RESULT})},S=(t,n)=>{t({type:o.SET_LOADING,payload:{loading:n}})},yt=(t,n)=>{t({type:o.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:n}})},It=t=>{t({type:o.INIT_ALL_STATE,payload:{}})},St=(t,n)=>{t({type:o.SET_PREDICT_RESULT,payload:{result:n}})},At=(t,n)=>{t({type:o.SET_PREDICT_RESULT_VISIBLE,payload:{visible:n}})},Pt=(t,n)=>(e,a)=>{const{imgList:r,step:i}=a().annotation;return z(r,i,t,n)},mt=t=>(n,e)=>{var a,r;const{annotation:i}=e();return(r=(a=i==null?void 0:i.preDataProcess)==null?void 0:a.call(i,t))!=null?r:t.dataList},Y=t=>(n,e)=>I(void 0,null,function*(){const{annotation:a}=e(),{onSubmit:r,imgIndex:i,imgList:s}=a;!r||(yield r([s[i]],t,i,s))});export{rt as BatchUpdateImgListResultByPredictResult,at as BatchUpdateResultByTrackID,ot as BatchUpdateTrackID,Et as ChangeSave,m as CheckExecutePageTurning,et as CopyBackWordResult,O as DispatcherTurning,Pt as GetBoxesByID,It as InitAnnotationState,it as InitTaskData,Tt as PageBackward,_t as PageForward,ft as PageJump,mt as PreDataProcess,S as SetAnnotationLoading,yt as SetLoadPCDFileLoading,St as SetPredictResult,At as SetPredictResultVisible,F as SetTaskConfig,k as SetTaskStepList,Y as SubmitHandler,lt as ToNextStep,P as ToSubmitFileData,h as UpdateBeforeRotate,j as UpdateCheckMode,R as UpdateGetFileData,B as UpdateGetFileList,N as UpdateHighlightAttribute,M as UpdateImgIndexByExternal,ut as UpdateInjectFunc,D as UpdateOnPageChange,L as UpdateOnSave,C as UpdateOnStepChange,U as UpdateOnSubmit,g as UpdatePageSize,v as UpdatePreDataProcess,K as UpdateProcessingStep,nt as UpdateRotate,H as UpdateSkipBeforePageTurning,tt as UpdateToolInstance,V as loadImgList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFormatSize as yt}from"../../components/customResizeHook/index.js";import{ESubmitType as W}from"../../constant/index.js";import Rt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as i}from"../Actions.js";import{jsonParser as x}from"../../utils/index.js";import Y from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as Pt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as dt,composeResult as J}from"../../utils/data.js";import h from"../../utils/StepUtils.js";import q from"../../utils/ToolUtils.js";import{MathUtils as pt,CommonToolUtils as Ct,AnnotationEngine as ht,ImgUtils as Ot}from"@labelbee/lb-annotation";import{PointCloudUtils as gt,i18n as M}from"@labelbee/lb-utils";import{Modal as _t}from"antd";import{message as It}from"antd/es";import mt from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as w}from"../../data/enums/ToolType.js";var bt=Object.defineProperty,Nt=Object.defineProperties,Ut=Object.getOwnPropertyDescriptors,ft=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable,Lt=(t,e,u)=>e in t?bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,o=(t,e)=>{for(var u in e||(e={}))Bt.call(e,u)&&Lt(t,u,e[u]);if(ft)for(var u of ft(e))xt.call(e,u)&&Lt(t,u,e[u]);return t},s=(t,e)=>Nt(t,Ut(e)),Tt=(t,e,u)=>new Promise((S,d)=>{var A=m=>{try{E(u.next(m))}catch(y){d(y)}},T=m=>{try{E(u.throw(m))}catch(y){d(y)}},E=m=>m.done?S(m.value):Promise.resolve(m.value).then(A,T);E((u=u.apply(t,e)).next())});const F=(t,e)=>t.find(u=>u.step===e),Et={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:""},wt=t=>{const{imgList:e,imgPageSize:u}=t;return Math.ceil(e.length/u)},St=(t,e)=>t.reduce((u,S)=>{if(S){const d=S.result;if(x(d)[`step_${e}`])return u+1}return u},0)/t.length,Ft=(t,e)=>{const{step:u,stepList:S}=t,d=h.getCurrentStepInfo(u,S),A=Pt.jsonParser(d.config);if(q.isVideoTool(d==null?void 0:d.tool)||q.isAudioTool(d==null?void 0:d.tool)||q.isPointCloudTool(d==null?void 0:d.tool)||[w.LLM,w.NLP,w.LLMMultiWheel].includes(d==null?void 0:d.tool))return;const T=document.getElementById("toolContainer");if(!T)throw"Not exist dom named id-toolContainer";const E=yt({width:window.innerWidth,height:window.innerHeight}),m=new ht({container:T,toolName:d.tool,size:E,imgNode:e,config:A,style:JSON.parse(Rt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},jt=(t,e)=>(u,S)=>Tt(void 0,null,function*(){var d,A;const{stepList:T,step:E}=S().annotation,m=h.currentToolIsVideo(E,T),y=h.currentToolIsPointCloud(E,T),O=[w.LLM,w.LLMMultiWheel].includes((d=h.getCurrentStepInfo(E,T))==null?void 0:d.tool),b=((A=h.getCurrentStepInfo(E,T))==null?void 0:A.tool)===w.NLP,N=h.currentToolIsAudio(E,T);if($(u,!0),yield u(Gt(t)),m){u(Mt(t));return}if(y||O||N||b){u(Vt(t));return}u(kt(t,e))}),Gt=t=>(e,u)=>Tt(void 0,null,function*(){const{getFileData:S,imgList:d}=u().annotation;if(S){const A=yield S(d[t],t);e({type:i.SET_FILE_DATA,payload:{fileData:A,index:t}})}}),Mt=t=>e=>{e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},Vt=t=>e=>{$(e,!1),e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},kt=(t,e)=>(u,S)=>{var d;const{toolInstance:A,imgList:T}=S().annotation,E=(d=T==null?void 0:T[t])==null?void 0:d.url;Ot.load(E).then(m=>{$(u,!1),u({type:i.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(u,!1),A==null||A.setErrorImg(),u({type:i.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Ht=({toolInstance:t,imgList:e,imgIndex:u,stepList:S,step:d=1})=>{var A,T,E,m;const y=((A=e[u])==null?void 0:A.result)||"",[O,b,N]=(T=t==null?void 0:t.exportData())!=null?T:[],V=(m=(E=t==null?void 0:t.exportCustomData)==null?void 0:E.call(t))!=null?m:{},k=dt(y,b),H=J(k,{step:d,stepList:S},{rect:O},V);return e.map((j,z)=>z===u?o(s(o({},j),{result:H}),N):o({},j))},zt=(t=o({},Et),e)=>{var u,S,d,A,T,E,m,y,O,b,N,V,k,H,j,z,Z,Q,tt,et,nt,ot,lt,st,it,rt,ut,at;switch(e.type){case i.INIT_ALL_STATE:return o(o({},t),Et);case i.UPDATE_TOOL_INSTANCE:return s(o({},t),{toolInstance:e.payload.toolInstance});case i.UPDATE_IMG_LIST:return s(o({},t),{imgList:e.payload.imgList});case i.CALC_STEP_PROGRESS:{const{imgList:n,step:l}=t,r=St(n,l);return s(o({},t),{stepProgress:r})}case i.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:l,step:r,stepList:a,toolInstance:p,onSubmit:c,resultList:f}=t;if(!p||!n[l])return t;const I=((u=n[l])==null?void 0:u.result)||"",[,_,g]=(S=p==null?void 0:p.exportData())!=null?S:[],L=(A=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?A:{},D=dt(I,_),v=J(D,{step:r,stepList:a},{rect:f},L),P=t.imgList.map((C,R)=>{if(R===l){const G=Y.dataCorrection(v,I,r,a);return o(s(o({},C),{result:G}),g)}return C});if(((T=e.payload)==null?void 0:T.submitType)===W.SyncImgList)return s(o({},t),{imgList:P});const U=St(P,r);return s(o({},t),{stepProgress:U,imgList:P})}case i.SAVE_RESULT:{const{imgList:n,imgIndex:l,onSave:r}=t;return r==null||r(n[l],l,n),o({},t)}case i.SUBMIT_RESULT:{const{imgList:n,basicIndex:l,resultList:r,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(E=a==null?void 0:a.exportData())!=null?E:[];let f=c;if((p==null?void 0:p.length)>0){const I=(m=p[l])==null?void 0:m.id,_=c.map(g=>s(o({},g),{sourceID:I}));f=mt.cloneDeep(r).filter(g=>g.sourceID!==I),f.push(..._)}return s(o({},t),{resultList:f,imgList:n})}case i.SET_BASIC_INDEX:{const{toolInstance:n,step:l,imgList:r,imgIndex:a,stepList:p,annotationEngine:c,resultList:f,basicResultList:I}=t;if(!n||!c)return t;const _=e.payload.basicIndex,g=(y=I[_])==null?void 0:y.id,L=x((O=r[a])==null?void 0:O.result),D=(f||[]).filter(G=>G.sourceID===g),v=F(p,l),{dataSourceStep:P,tool:U}=v,C=F(p,P);let R=[];return P&&U&&(R=(b=L[`step_${P}`])==null?void 0:b.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(),It.info(M.t("NoDependency")))),n==null||n.setResult(D),n==null||n.history.initRecord(D,!0),s(o({},t),{basicIndex:_})}case i.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=e.payload;return s(o({},t),{triggerEventAfterIndexChanged:!!n})}case i.LOAD_FILE_DATA:{const{imgList:n,step:l,toolInstance:r,annotationEngine:a,stepList:p}=t;if(!r)return s(o({},t),{imgIndex:e.payload.nextIndex});const c=h.getCurrentStepInfo(l,p),{nextIndex:f,imgNode:I,nextBasicIndex:_,imgError:g}=e.payload,L=_!=null?_:0,D=x((N=n[f])==null?void 0:N.result),v=D[`step_${c.step}`],P=!v,U={rotate:(V=D.rotate)!=null?V:0,valid:(k=D.valid)!=null?k:!0};I&&g!==!0?a==null||a.setImgNode(I,U):r==null||r.setValid(U.valid);const C=F(p,c.step),{dataSourceStep:R,tool:G}=C,ct=F(p,R),X=R&&G,B=(j=(H=D[`step_${R}`])==null?void 0:H.result)!=null?j:[],K=Y.getInitialResultList(v==null?void 0:v.result,r,C,B,P);if(a==null||a.launchOperation(),X&&((B==null?void 0:B.length)>0?a==null||a.setBasicInfo(ct.tool,B[L]):(a==null||a.setBasicInfo(ct.tool),a==null||a.forbidOperation(),It.info(M.t("NoDependency")))),c.tool!=="check"&&X){const At=(Z=(z=B[L])==null?void 0:z.id)!=null?Z:"",Dt=X?K.filter(vt=>Ct.isSameSourceID(vt.sourceID,At)):K;(Q=r==null?void 0:r.history)==null||Q.initRecord(K,!0),r==null||r.setResult(Dt)}return s(o({},t),{imgIndex:f,basicIndex:L,basicResultList:B,resultList:K})}case i.UPDATE_ANNOTATION_CONFIG:return s(o({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case i.SET_TASK_STEP_LIST:{const{stepList:n}=e.payload;return s(o({},t),{stepList:n})}case i.SET_TASK_CONFIG:{const{stepList:n,step:l}=e.payload;return s(o({},t),{stepList:n,step:l})}case i.INIT_TOOL:{const{imgNode:n}=t,l=Ft(t,n);if(l){const{toolInstance:r,annotationEngine:a}=l;return s(o({},t),{toolInstance:r,annotationEngine:a})}return o({},t)}case i.SET_TOOL:{const n=(et=e.payload)==null?void 0:et.instance;return n?s(o({},t),{toolInstance:n}):o({},t)}case i.UPDATE_ON_SUBMIT:return s(o({},t),{onSubmit:e.payload.onSubmit});case i.UPDATE_ON_SAVE:return s(o({},t),{onSave:e.payload.onSave});case i.UPDATE_ON_PAGE_CHANGE:return s(o({},t),{onPageChange:e.payload.onPageChange});case i.SET_PREDICT_RESULT:return s(o({},t),{predictionResult:e.payload.result});case i.SET_PREDICT_RESULT_VISIBLE:return s(o({},t),{predictionResultVisible:e.payload.visible});case i.UPDATE_ON_STEP_CHANGE:return s(o({},t),{onStepChange:e.payload.onStepChange});case i.UPDATE_GET_FILE_DATA:return s(o({},t),{getFileData:e.payload.getFileData});case i.UPDATE_PAGE_SIZE:return s(o({},t),{pageSize:e.payload.pageSize});case i.UPDATE_LOAD_FILE_LIST:return s(o({},t),{loadFileList:e.payload.loadFileList});case i.UPDATE_BEFORE_ROTATE:return s(o({},t),{beforeRotate:e.payload.beforeRotate});case i.UPDATE_PRE_DATA_PROCESS:return s(o({},t),{preDataProcess:e.payload.preDataProcess});case i.UPDATE_IMG_INDEX_BY_EXTERNAL:return s(o({},t),{getImgIndexByExternal:e.payload.getImgIndexByExternal});case i.SKIP_BEFORE_PAGE_TURNING:return s(o({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case i.SET_FILE_DATA:{const{fileData:n,index:l}=e.payload,{imgList:r}=t,a=[...r];return a[l]=o(o({},a[l]),n),s(o({},t),{imgList:a})}case i.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:l}=t;return l&&l()===!1||(nt=n==null?void 0:n.updateRotate)==null||nt.call(n),t}case i.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=t,l=(ot=n==null?void 0:n.valid)!=null?ot:!0;return _t.destroyAll(),_t.confirm({content:M.t(l?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!l)},okText:M.t("Confirm"),cancelText:M.t("Cancel")}),t}case i.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:l,imgList:r,step:a,stepList:p}=t;if(!n)return t;if(l===0||l>=r.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const c=r[l-1].result;if(!c)return t;const f=h.getCurrentStepInfo(a,p),I=(lt=f==null?void 0:f.step)!=null?lt:a,_=(st=n==null?void 0:n.valid)!=null?st:!0,g=Y.copyResultChange({copyResult:c,step:I,currentResult:(it=r[l].result)!=null?it:"",preMappingImgList:(rt=r[l-1].mappingImgList)!=null?rt:[],mappingImgList:(ut=r[l].mappingImgList)!=null?ut:[],valid:_});r[l]=s(o({},r[l]),{result:g});const D=x(g)[`step_${a}`],v=(D==null?void 0:D.result)||[];return n==null||n.setResult(v),n==null||n.history.pushHistory(v),(at=n==null?void 0:n.asyncData)==null||at.call(n,r[l]),s(o({},t),{imgList:[...r]})}case i.SET_STEP:{const{stepList:n,annotationEngine:l}=t,{toStep:r}=e.payload;if(l){const a=F(n,r);return l==null||l.setToolName(a.tool,a.config),s(o({},t),{step:r,toolInstance:l==null?void 0:l.toolInstance})}return s(o({},t),{step:r})}case i.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=e.payload;return s(o({},t),{loadPCDFileLoading:!!n})}case i.SET_LOADING:{const{loading:n}=e.payload;return s(o({},t),{loading:!!n})}case i.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=e.payload;return s(o({},t),{pointCloudLoading:!!n})}case i.SET_CHECK_MODE:{const{checkMode:n}=e.payload;return s(o({},t),{checkMode:!!n})}case i.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=e.payload;return s(o({},t),{highlightAttribute:n})}case i.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:l,rangeIndex:r,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,f=[],I=a.map((_,g)=>{if(pt.isInRange(g,r)){const L=s(o({},_),{result:gt.batchUpdateTrackID({id:n,newID:l,result:_.result})});return f.push({imgIndex:g,newInfo:L}),L}return _});return c&&c([I[p]],W.BatchUpdateTrackID,p,I,{updateImgList:f}),s(o({},t),{imgList:I})}case i.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:l,rangeIndex:r}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,f=[],I=a.map((_,g)=>{if(pt.isInRange(g,r)){const L=s(o({},_),{result:gt.batchUpdateResultByTrackID({id:n,newData:l,result:_.result})});return f.push({imgIndex:g,newInfo:L}),L}return _});return c&&c([I[p]],W.BatchUpdateTrackID,p,I,{updateImgList:f}),s(o({},t),{imgList:I})}case i.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:l,stepList:r,step:a,predictionResult:p}=t,c={};p.forEach(g=>{const{index:L}=g;c[L]=mt.pick(g,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const f=`step_${a}`,I=[],_=l.map((g,L)=>{if(c[L]){const D=g.result==="{}"?x(J("",{step:a,stepList:r},{rect:[]},{})):x(g.result);D[f].result.push(c[L]);const v=s(o({},g),{result:JSON.stringify(D)});return I.push({imgIndex:L,newInfo:v}),v}return g});return n==null||n(_,W.BatchUpdateImgList,-1,_,{updateImgList:I}),s(o({},t),{imgList:_})}default:return t}};export{jt as LoadFileAndFileData,zt as annotationReducer,Ht as composeResultByToolInstance,F as getStepConfig,wt as getTotalPage};
|
|
1
|
+
import{getFormatSize as Ct}from"../../components/customResizeHook/index.js";import{ESubmitType as W}from"../../constant/index.js";import ht from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as r}from"../Actions.js";import{jsonParser as j}from"../../utils/index.js";import Y from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as pt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as gt,composeResult as J}from"../../utils/data.js";import h from"../../utils/StepUtils.js";import q from"../../utils/ToolUtils.js";import{MathUtils as _t,CommonToolUtils as Ot,AnnotationEngine as bt,ImgUtils as Nt}from"@labelbee/lb-annotation";import{PointCloudUtils as It,i18n as M}from"@labelbee/lb-utils";import{Modal as mt}from"antd";import{message as ft}from"antd/es";import Tt from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as O}from"../../data/enums/ToolType.js";var Ut=Object.defineProperty,Bt=Object.defineProperties,xt=Object.getOwnPropertyDescriptors,Lt=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable,Et=(t,e,u)=>e in t?Ut(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,o=(t,e)=>{for(var u in e||(e={}))wt.call(e,u)&&Et(t,u,e[u]);if(Lt)for(var u of Lt(e))Ft.call(e,u)&&Et(t,u,e[u]);return t},l=(t,e)=>Bt(t,xt(e)),At=(t,e,u)=>new Promise((A,d)=>{var S=f=>{try{E(u.next(f))}catch(y){d(y)}},L=f=>{try{E(u.throw(f))}catch(y){d(y)}},E=f=>f.done?A(f.value):Promise.resolve(f.value).then(S,L);E((u=u.apply(t,e)).next())});const b=(t,e)=>t.find(u=>u.step===e),St={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:"",confirmPageTurning:!1},jt=t=>{const{imgList:e,imgPageSize:u}=t;return Math.ceil(e.length/u)},Dt=(t,e)=>t.reduce((u,A)=>{if(A){const d=A.result;if(j(d)[`step_${e}`])return u+1}return u},0)/t.length,Gt=(t,e)=>{const{step:u,stepList:A}=t,d=h.getCurrentStepInfo(u,A),S=pt.jsonParser(d.config);if(q.isVideoTool(d==null?void 0:d.tool)||q.isAudioTool(d==null?void 0:d.tool)||q.isPointCloudTool(d==null?void 0:d.tool)||[O.LLM,O.NLP,O.LLMMultiWheel].includes(d==null?void 0:d.tool))return;const L=document.getElementById("toolContainer");if(!L)throw"Not exist dom named id-toolContainer";const E=Ct({width:window.innerWidth,height:window.innerHeight}),f=new bt({container:L,toolName:d.tool,size:E,imgNode:e,config:S,style:JSON.parse(ht)});return{toolInstance:f==null?void 0:f.toolInstance,annotationEngine:f}},Mt=(t,e)=>(u,A)=>At(void 0,null,function*(){var d,S;const{stepList:L,step:E}=A().annotation,f=h.currentToolIsVideo(E,L),y=h.currentToolIsPointCloud(E,L),N=[O.LLM,O.LLMMultiWheel].includes((d=h.getCurrentStepInfo(E,L))==null?void 0:d.tool),U=((S=h.getCurrentStepInfo(E,L))==null?void 0:S.tool)===O.NLP,B=h.currentToolIsAudio(E,L);if($(u,!0),yield u(Vt(t)),f){u(kt(t));return}if(y||N||B||U){u(Ht(t));return}u(zt(t,e))}),Vt=t=>(e,u)=>At(void 0,null,function*(){const{getFileData:A,imgList:d}=u().annotation;if(A){const S=yield A(d[t],t);e({type:r.SET_FILE_DATA,payload:{fileData:S,index:t}})}}),kt=t=>e=>{e({type:r.LOAD_FILE_DATA,payload:{nextIndex:t}})},Ht=t=>e=>{$(e,!1),e({type:r.LOAD_FILE_DATA,payload:{nextIndex:t}})},zt=(t,e)=>(u,A)=>{var d;const{toolInstance:S,imgList:L}=A().annotation,E=(d=L==null?void 0:L[t])==null?void 0:d.url;Nt.load(E).then(f=>{$(u,!1),u({type:r.LOAD_FILE_DATA,payload:{imgNode:f,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(u,!1),S==null||S.setErrorImg(),u({type:r.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Kt=({toolInstance:t,imgList:e,imgIndex:u,stepList:A,step:d=1})=>{var S,L,E,f;const y=((S=e[u])==null?void 0:S.result)||"",[N,U,B]=(L=t==null?void 0:t.exportData())!=null?L:[],V=(f=(E=t==null?void 0:t.exportCustomData)==null?void 0:E.call(t))!=null?f:{},k=gt(y,U),H=J(k,{step:d,stepList:A},{rect:N},V);return e.map((G,z)=>z===u?o(l(o({},G),{result:H}),B):o({},G))},Wt=(t=o({},St),e)=>{var u,A,d,S,L,E,f,y,N,U,B,V,k,H,G,z,Z,Q,tt,et,nt,ot,st,lt,it,rt,ut,at,ct;switch(e.type){case r.INIT_ALL_STATE:return o(o({},t),St);case r.UPDATE_TOOL_INSTANCE:return l(o({},t),{toolInstance:e.payload.toolInstance});case r.UPDATE_IMG_LIST:return l(o({},t),{imgList:e.payload.imgList});case r.CALC_STEP_PROGRESS:{const{imgList:n,step:s}=t,i=Dt(n,s);return l(o({},t),{stepProgress:i})}case r.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:s,step:i,stepList:a,toolInstance:p,onSubmit:c,resultList:m}=t;if(!p||!n[s])return t;const _=((u=n[s])==null?void 0:u.result)||"",[,I,g]=(A=p==null?void 0:p.exportData())!=null?A:[],T=(S=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?S:{},D=gt(_,I),v=J(D,{step:i,stepList:a},{rect:m},T),R=t.imgList.map((C,P)=>{if(P===s){const w=Y.dataCorrection(v,_,i,a);return o(l(o({},C),{result:w}),g)}return C});if(((L=e.payload)==null?void 0:L.submitType)===W.SyncImgList)return l(o({},t),{imgList:R});const x=Dt(R,i);return l(o({},t),{stepProgress:x,imgList:R})}case r.SAVE_RESULT:{const{imgList:n,imgIndex:s,onSave:i}=t;return i==null||i(n[s],s,n),o({},t)}case r.SUBMIT_RESULT:{const{imgList:n,basicIndex:s,resultList:i,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(E=a==null?void 0:a.exportData())!=null?E:[];let m=c;if((p==null?void 0:p.length)>0){const _=(f=p[s])==null?void 0:f.id,I=c.map(g=>l(o({},g),{sourceID:_}));m=Tt.cloneDeep(i).filter(g=>g.sourceID!==_),m.push(...I)}return l(o({},t),{resultList:m,imgList:n})}case r.SET_BASIC_INDEX:{const{toolInstance:n,step:s,imgList:i,imgIndex:a,stepList:p,annotationEngine:c,resultList:m,basicResultList:_}=t;if(!n||!c)return t;const I=e.payload.basicIndex,g=(y=_[I])==null?void 0:y.id,T=j((N=i[a])==null?void 0:N.result),D=(m||[]).filter(w=>w.sourceID===g),v=b(p,s),{dataSourceStep:R,tool:x}=v,C=b(p,R);let P=[];return R&&x&&(P=(U=T[`step_${R}`])==null?void 0:U.result,(P==null?void 0:P.length)>0?(c==null||c.setBasicInfo(C.tool,P[I]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),ft.info(M.t("NoDependency")))),n==null||n.setResult(D),n==null||n.history.initRecord(D,!0),l(o({},t),{basicIndex:I})}case r.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=e.payload;return l(o({},t),{triggerEventAfterIndexChanged:!!n})}case r.LOAD_FILE_DATA:{const{imgList:n,step:s,toolInstance:i,annotationEngine:a,stepList:p}=t;if(!i)return l(o({},t),{imgIndex:e.payload.nextIndex});const c=h.getCurrentStepInfo(s,p),{nextIndex:m,imgNode:_,nextBasicIndex:I,imgError:g}=e.payload,T=I!=null?I:0,D=j((B=n[m])==null?void 0:B.result),v=D[`step_${c.step}`],R=!v,x={rotate:(V=D.rotate)!=null?V:0,valid:(k=D.valid)!=null?k:!0};_&&g!==!0?a==null||a.setImgNode(_,x):i==null||i.setValid(x.valid);const C=b(p,c.step),{dataSourceStep:P,tool:w}=C,dt=b(p,P),X=P&&w,F=(G=(H=D[`step_${P}`])==null?void 0:H.result)!=null?G:[],K=Y.getInitialResultList(v==null?void 0:v.result,i,C,F,R);a==null||a.launchOperation();const vt=[O.Cuboid,O.ScribbleTool].includes(w);if(X&&((F==null?void 0:F.length)>0?a==null||a.setBasicInfo(dt.tool,F[T]):(a==null||a.setBasicInfo(dt.tool),a==null||a.forbidOperation(),ft.info(M.t("NoDependency")))),c.tool!=="check"&&(vt||X)){const yt=(Z=(z=F[T])==null?void 0:z.id)!=null?Z:"",Pt=X?K.filter(Rt=>Ot.isSameSourceID(Rt.sourceID,yt)):K;(Q=i==null?void 0:i.history)==null||Q.initRecord(K,!0),i==null||i.setResult(Pt)}return l(o({},t),{imgIndex:m,basicIndex:T,basicResultList:F,resultList:K})}case r.UPDATE_ANNOTATION_CONFIG:return l(o({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case r.SET_TASK_STEP_LIST:{const{stepList:n}=e.payload;return l(o({},t),{stepList:n})}case r.SET_TASK_CONFIG:{const{stepList:n,step:s}=e.payload;return l(o({},t),{stepList:n,step:s})}case r.INIT_TOOL:{const{imgNode:n}=t,s=Gt(t,n);if(s){const{toolInstance:i,annotationEngine:a}=s;return l(o({},t),{toolInstance:i,annotationEngine:a})}return o({},t)}case r.SET_TOOL:{const n=(et=e.payload)==null?void 0:et.instance;return n?l(o({},t),{toolInstance:n}):o({},t)}case r.UPDATE_ON_SUBMIT:return l(o({},t),{onSubmit:e.payload.onSubmit});case r.UPDATE_ON_SAVE:return l(o({},t),{onSave:e.payload.onSave});case r.UPDATE_ON_PAGE_CHANGE:return l(o({},t),{onPageChange:e.payload.onPageChange});case r.SET_PREDICT_RESULT:return l(o({},t),{predictionResult:e.payload.result});case r.SET_PREDICT_RESULT_VISIBLE:return l(o({},t),{predictionResultVisible:e.payload.visible});case r.UPDATE_ON_STEP_CHANGE:return l(o({},t),{onStepChange:e.payload.onStepChange});case r.UPDATE_GET_FILE_DATA:return l(o({},t),{getFileData:e.payload.getFileData});case r.UPDATE_PAGE_SIZE:return l(o({},t),{pageSize:e.payload.pageSize});case r.UPDATE_LOAD_FILE_LIST:return l(o({},t),{loadFileList:e.payload.loadFileList});case r.UPDATE_BEFORE_ROTATE:return l(o({},t),{beforeRotate:e.payload.beforeRotate});case r.UPDATE_PRE_DATA_PROCESS:return l(o({},t),{preDataProcess:e.payload.preDataProcess});case r.UPDATE_IMG_INDEX_BY_EXTERNAL:return l(o({},t),{getImgIndexByExternal:e.payload.getImgIndexByExternal});case r.SKIP_BEFORE_PAGE_TURNING:return l(o({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case r.SET_FILE_DATA:{const{fileData:n,index:s}=e.payload,{imgList:i}=t,a=[...i];return a[s]=o(o({},a[s]),n),l(o({},t),{imgList:a})}case r.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:s}=t;return s&&s()===!1||(nt=n==null?void 0:n.updateRotate)==null||nt.call(n),t}case r.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=t,s=(ot=n==null?void 0:n.valid)!=null?ot:!0;return mt.destroyAll(),mt.confirm({content:M.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!s)},okText:M.t("Confirm"),cancelText:M.t("Cancel")}),t}case r.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:s,imgList:i,step:a,stepList:p}=t;if(!n)return t;if(s===0||s>=i.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const c=i[s-1].result;if(!c)return t;const m=h.getCurrentStepInfo(a,p),_=(st=m==null?void 0:m.step)!=null?st:a,I=(lt=n==null?void 0:n.valid)!=null?lt:!0,g=Y.copyResultChange({copyResult:c,step:_,currentResult:(it=i[s].result)!=null?it:"",preMappingImgList:(rt=i[s-1].mappingImgList)!=null?rt:[],mappingImgList:(ut=i[s].mappingImgList)!=null?ut:[],valid:I});i[s]=l(o({},i[s]),{result:g});const D=j(g)[`step_${a}`],v=(D==null?void 0:D.result)||[];return n==null||n.setResult(v),n==null||n.history.pushHistory(v),(at=n==null?void 0:n.asyncData)==null||at.call(n,i[s]),l(o({},t),{imgList:[...i]})}case r.SET_STEP:{const{stepList:n,annotationEngine:s}=t,{toStep:i}=e.payload;if(s){const a=b(n,i);return s==null||s.setToolName(a.tool,a.config),l(o({},t),{step:i,toolInstance:s==null?void 0:s.toolInstance})}return l(o({},t),{step:i})}case r.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=e.payload;return l(o({},t),{loadPCDFileLoading:!!n})}case r.SET_LOADING:{const{loading:n}=e.payload;return l(o({},t),{loading:!!n})}case r.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=e.payload;return l(o({},t),{pointCloudLoading:!!n})}case r.SET_CHECK_MODE:{const{checkMode:n}=e.payload;return l(o({},t),{checkMode:!!n})}case r.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=e.payload;return l(o({},t),{highlightAttribute:n})}case r.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:s,rangeIndex:i,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,m=[],_=a.map((I,g)=>{if(_t.isInRange(g,i)){const T=l(o({},I),{result:It.batchUpdateTrackID({id:n,newID:s,result:I.result})});return m.push({imgIndex:g,newInfo:T}),T}return I});return c&&c([_[p]],W.BatchUpdateTrackID,p,_,{updateImgList:m}),l(o({},t),{imgList:_})}case r.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const n=e,{id:s,newData:i,rangeIndex:a,imgList:p}=n.payload,{imgIndex:c,onSubmit:m}=t,_=[],I=p.map((g,T)=>{if(_t.isInRange(T,a)){const D=l(o({},g),{result:It.batchUpdateResultByTrackID({id:s,newData:i,result:g.result})});return _.push({imgIndex:T,newInfo:D}),D}return g});return m&&m([I[c]],W.BatchUpdateTrackID,c,I,{updateImgList:_}),l(o({},t),{imgList:I})}case r.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:s,stepList:i,step:a,predictionResult:p}=t,c={};p.forEach(g=>{const{index:T}=g;c[T]=Tt.pick(g,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const m=`step_${a}`,_=[],I=s.map((g,T)=>{if(c[T]){const D=g.result==="{}"?j(J("",{step:a,stepList:i},{rect:[]},{})):j(g.result);D[m].result.push(c[T]);const v=l(o({},g),{result:JSON.stringify(D)});return _.push({imgIndex:T,newInfo:v}),v}return g});return n==null||n(I,W.BatchUpdateImgList,-1,I,{updateImgList:_}),l(o({},t),{imgList:I})}case r.CHANGE_PAGE_CHECK:{const{toolInstance:n,step:s,stepList:i}=t;if(!n)return t;const[a]=(ct=n==null?void 0:n.exportData())!=null?ct:[],p=b(i,s),c=pt.jsonParser(p.config),m=a.some(_=>(_==null?void 0:_.result)&&Object.keys(_.result).length>0);return l(o({},t),{confirmPageTurning:c.showConfirm&&!m})}default:return t}};export{Mt as LoadFileAndFileData,Wt as annotationReducer,Kt as composeResultByToolInstance,b as getStepConfig,jt as getTotalPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i=(t,o)=>({selectBoxVisibleSwitch:!1,setSelectBoxVisibleSwitch:e=>t(()=>({selectBoxVisibleSwitch:e})),attrChangeTrigger:0,setAttrChangeTrigger:e=>t(()=>({attrChangeTrigger:e}))});export{i as default};
|
package/es/utils/LLM.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=r=>{try{return r.replace(/\\\((.+?)\\\)/gs,(o,e)=>`$${e}$`).replace(/\\\[(.+?)\\\]/gs,(o,e)=>`$$${e}$$`)}catch(n){return r}};export{t as convertLatexFormat};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCuboidFromPointCloudBox as l}from"@labelbee/lb-annotation";import{isEqual as
|
|
1
|
+
import{getCuboidFromPointCloudBox as l}from"@labelbee/lb-annotation";import{isEqual as I}from"lodash";var r;(function(t){t.Default="Default",t.UndoRedo="UndoRedo",t.ClearAll="ClearAll",t.Single="Single",t.SingleDelete="SingleDelete",t.SingleToggleValid="SingleToggleValid",t.SingleRotate="SingleRotate",t.MultiPaste="MultiPaste",t.MultiMove="MultiMove",t.MulitSelect="MulitSelect"})(r||(r={}));var d;(function(t){t.ChangeAttribute="ChangeAttribute",t.Move="Move",t.ChangeDepth="ChangeDepth",t.ChangeSize="ChangeSize",t.ToggleValid="ToggleValid"})(d||(d={}));const A=(t,o)=>{const s=u(t).concat(u(o));for(const e of s){const n=g(t,e),i=g(o,e);if(!y(n,i))return!1}return!0},u=t=>{const o=[];for(let s=0;s<t.length;s++){const e=t[s],n=t[(s+1)%t.length],i={x:n.x-e.x,y:n.y-e.y},c={x:-i.y,y:i.x};o.push(c)}return o},g=(t,o)=>{let s=h(t[0],o),e=s;for(const n of t){const i=h(n,o);i<s&&(s=i),i>e&&(e=i)}return{min:s,max:e}},y=(t,o)=>!(t.max<o.min||o.max<t.min),h=(t,o)=>t.x*o.x+t.y*o.y,M=(t,o)=>{const s=[];return o.forEach(e=>{const{polygonPointList:n}=l(e);A(t,n)&&s.push(e.id)}),s},S=(t,o)=>{const s=t.map(n=>n.id),e=o.map(n=>n.id);return s.find(n=>!e.includes(n))||""},v=(t,o)=>{const s=t.map(e=>e.id);return o.find(e=>!s.includes(e.id))},x=(t,o)=>t.find(e=>{const n=o.find(i=>i.id===e.id);return n&&n.valid!==e.valid}),m=(t,o)=>t.find(e=>{const n=o.find(i=>i.id===e.id);return n&&n.rotation!==e.rotation}),f=(t,o)=>{const{polygonPointList:s}=l(t);return{ids:M(s,o.filter(n=>n.id!==t.id)),rect:s}},D=(t,o)=>{const s=(e,n)=>e.attribute===n.attribute&&e.center.x===n.center.x&&e.center.y===n.center.y&&e.depth===n.depth&&e.width===n.width&&e.height===n.height;for(const e of t){const n=o.find(i=>i.id===e.id);if(n&&!s(e,n)){let i;if(n.attribute!==e.attribute?i=d.ChangeAttribute:n.center.x!==e.center.x||n.center.y!==e.center.y?i=d.Move:n.depth!==e.depth?i=d.ChangeDepth:(n.width!==e.width||n.height!==e.height)&&(i=d.ChangeSize),i!==void 0)return{modifiedType:i,box:e}}}},C=(t,o,s)=>{try{switch(t){case r.Single:if(o.length>s.length){const e=S(o,s);return e?{modifiedBoxIds:[e],resetAreas:[]}:{modifiedBoxIds:[],resetAreas:[]}}else{const e=[],n=[],i=D(o,s);if(i&&(e.push(i.box.id),i.modifiedType===d.ChangeSize||i.modifiedType===d.Move||i.modifiedType===d.ChangeDepth)){const c=s.find(p=>p.id===i.box.id),{ids:a,rect:B}=f(c,o);e.push(...a),n.push(B)}return{modifiedBoxIds:e,resetAreas:n}}case r.SingleDelete:if(o.length<s.length){const e=v(o,s);if(e){const i=[l(e).polygonPointList],c=[];if(o.length>1){const{ids:a}=f(e,o);a.length&&c.push(...a)}return{modifiedBoxIds:c,resetAreas:i}}return{modifiedBoxIds:[],resetAreas:[]}}return{modifiedBoxIds:[],resetAreas:[]};case r.SingleRotate:if(m(o,s)){const e=m(o,s);if(e){const n=s.find(a=>a.id===e.id),{ids:i,rect:c}=f(n,o);return{modifiedBoxIds:[e.id,...i],resetAreas:[c]}}}return{modifiedBoxIds:[],resetAreas:[]};case r.SingleToggleValid:if(x(o,s)){const e=x(o,s);return e?{modifiedBoxIds:[e.id],resetAreas:[]}:{modifiedBoxIds:[],resetAreas:[]}}return{modifiedBoxIds:[],resetAreas:[]};case r.MulitSelect:return{modifiedBoxIds:V(o,s),resetAreas:[]};case r.MultiPaste:case r.MultiMove:case r.Default:case r.UndoRedo:case r.ClearAll:default:return{modifiedBoxIds:[],resetAreas:[]}}}catch(e){return console.error("calcResetAreasAndBoxIds error:",e),{modifiedBoxIds:[],resetAreas:[]}}},V=(t,o)=>{const s=new Map;for(const e of o)s.set(e.id,e);return t.filter(e=>{const n=s.get(e.id);return!n||!I(e,n)}).map(e=>e.id)};export{r as EPointCloudBoxRenderTrigger,d as EPointCloudBoxSingleModifiedType,C as calcResetAreasAndBoxIds};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as
|
|
1
|
+
import{ViewportProvider as V}from"../../components/customResizeHook/index.js";import{prefix as b}from"../../constant/index.js";import{Spin as C}from"antd";import{Layout as y}from"antd/es";import t,{useState as A}from"react";import O from"./annotationOperation/index.js";import W from"./annotationTips/index.js";import B from"./sidebar/index.js";import g from"./toolFooter/index.js";import k from"./toolHeader/index.js";import{getStepConfig as E}from"../../store/annotation/reducer.js";import F from"../../components/videoAnnotate/index.js";import{connect as I}from"react-redux";import _ from"../../utils/ToolUtils.js";import R from"../../components/pointCloudView/index.js";import{getClassName as $}from"../../utils/dom.js";import{classnames as H}from"../../utils/index.js";import D from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as U}from"../../store/ctx.js";import{EToolName as d}from"../../data/enums/ToolType.js";import z from"./LLMLayout/index.js";import q from"./NLPLayout/index.js";import G from"../../components/audioAnnotate/index.js";import{LoadingOutlined as J}from"@ant-design/icons";import{useTranslation as K}from"react-i18next";import{EPointCloudName as Q}from"@labelbee/lb-annotation";import X from"./LLMMultiWheelLayout/index.js";var Y=Object.defineProperty,T=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,P=(e,o,n)=>o in e?Y(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,l=(e,o)=>{for(var n in o||(o={}))Z.call(o,n)&&P(e,n,o[n]);if(T)for(var n of T(o))p.call(o,n)&&P(e,n,o[n]);return e};const{Sider:ee,Content:te}=y,L=`${b}-layout`,oe=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(W,{path:e.path,tips:e.tips}),t.createElement(O,l({},e)),t.createElement(g,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},ne=e=>{var o;return t.createElement(t.Fragment,null,t.createElement(R,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible,setResourceLoading:e.setResourceLoading,setBatchSetValid:e==null?void 0:e.setBatchSetValid}),t.createElement(g,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},le=e=>{var o;const{stepList:n,step:a}=e,r=(o=E(n,a))==null?void 0:o.tool,m=_.isPointCloudTool(r),i=_.isVideoTool(r);return m?t.createElement(ne,l({},e)):i?t.createElement(F,{drawLayerSlot:e.drawLayerSlot,footer:e.footer,annotationBefore:e==null?void 0:e.annotationBefore}):t.createElement(oe,l({},e))},s=e=>{var o,n,a;const{t:r}=K(),{stepList:m,step:i}=e,c=(o=E(m,i))==null?void 0:o.tool,u=![d.LLM,d.NLP,d.LLMMultiWheel].includes(c),v=![d.LLM,d.NLP,d.LLMMultiWheel].includes(c),h=[Q.PointCloud].includes(c);return t.createElement(V,null,t.createElement(C,{spinning:e.loading,indicator:t.createElement(J,null),tip:t.createElement("span",{style:{marginTop:200}},r("LoadingTips")),delay:500},t.createElement(y,{className:H([L,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${L}__header`,style:(a=e.style)==null?void 0:a.header},t.createElement(k,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:u,hasHeaderOption:v,hasPredictTrackingIcon:h})),e.children)))},ie=e=>{var o,n,a,r,m,i,c;const[u,v]=A(void 0),h=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:x,step:j}=e,f=(a=E(x,j))==null?void 0:a.tool,M=d.LLM===f,N=d.NLP===f,w=d.LLMMultiWheel===f,S=_.isAudioTool(f);return w?t.createElement(s,l({},e),t.createElement(X,l({},e))):M?t.createElement(s,l({},e),t.createElement(z,l({},e))):N?t.createElement(s,l({},e),t.createElement(q,l({},e))):S?t.createElement(s,l({},e),t.createElement(G,l({},e))):t.createElement(s,l({},e),t.createElement(y,{className:$("layout","container")},e==null?void 0:e.leftSider,t.createElement(te,{className:`${L}__content`},t.createElement(le,l({},e)),t.createElement(D,null)),t.createElement(ee,{className:`${L}__side`,width:(r=u!=null?u:h)!=null?r:240,style:(m=e.style)==null?void 0:m.sider},t.createElement(B,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:v,propsSiderWidth:(c=(i=e.style)==null?void 0:i.sider)==null?void 0:c.width,setBatchSetValid:e.setBatchSetValid}))))},ae=({annotation:e})=>{var o,n,a;const{imgList:r,loading:m}=e,i=(o=r[e.imgIndex])!=null?o:{};return{path:(a=(n=i==null?void 0:i.path)!=null?n:i==null?void 0:i.url)!=null?a:"",loading:m}};var re=I(ae,null,null,{context:U})(ie);export{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r,{useRef as
|
|
1
|
+
import r,{useRef as p,useState as C}from"react";import{Col as y,Popconfirm as E}from"antd";import{useTranslation as i}from"react-i18next";import{prefix as g}from"../../../../constant/index.js";const k={color:"#CCCCCC"},f=({info:e})=>{const{t}=i();return e.key.startsWith("sure")?r.createElement("div",{key:e.key},`${t("ConfirmTo")}${e.name.slice(0)}\uFF1F`,(e==null?void 0:e.content)?e.content:""):r.createElement("span",null,e.name)},h=({icon:e})=>typeof e=="string"?r.createElement("img",{width:23,height:25,src:e}):e,u=({isHover:e,info:t})=>{const l=!!t.forbidOperation,a=t.key===e&&!l;let o={color:a?"#666fff":""};return l&&(o=k),r.createElement("div",{style:{cursor:l?"not-allowed":"default"},onClick:()=>{var c;return(t==null?void 0:t.forbidConfirm)&&!l&&((c=t==null?void 0:t.onClick)==null?void 0:c.call(t))}},r.createElement("div",{className:"icon"},r.createElement(h,{icon:a?t.hoverSvg:t.imgSvg})),r.createElement("div",{className:"toolName",style:o},t.name))},x=({allOperation:e,setBatchSetValid:t,valid:l})=>{const a=p(null),[o,c]=C(null),{t:m}=i(),d=Math.floor(24/e.length),v=n=>n.forbidConfirm?r.createElement(u,{info:n,isHover:o}):t&&n.key==="setValidity"?t({valid:l,isHover:!!o,singleSetQuestionImg:n.onClick}):r.createElement(E,{title:r.createElement(f,{info:n}),placement:"topRight",okText:m("Confirm"),cancelText:m("Cancel"),getPopupContainer:()=>{var s;return(s=a.current)!=null?s:document.body},onConfirm:n.onClick,overlayClassName:`${g}-pop-confirm`},r.createElement("div",null,r.createElement(u,{info:n,isHover:o})));return r.createElement("div",{className:"generalOperation",ref:a},e.map((n,s)=>r.createElement(y,{span:d,key:s,className:"generalOperation-col"},r.createElement("div",{key:n.key,className:"item",onMouseEnter:()=>{c(n.key)},onMouseLeave:()=>{c(null)}},v(n)))))};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s,{useState as
|
|
1
|
+
import s,{useState as f,useCallback as U}from"react";import{connect as g}from"react-redux";import w 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 T from"../../../../assets/annotation/pointCloudTool/unitAttribute.svg.js";import V from"../../../../assets/annotation/pointCloudTool/unitAttributeForbid.svg.js";import A from"../../../../assets/annotation/pointCloudTool/unitAttributeHover.svg.js";import{useTranslation as I}from"react-i18next";import E from"../../../../components/pointCloudView/components/UnifyParamsModal/index.js";import{useSingleBox as M}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{composeResultByToolInstance as _}from"../../../../store/annotation/reducer.js";import{useStatus as R}from"../../../../components/pointCloudView/hooks/useStatus.js";const x=o=>{var t,i;const n=w.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}},$=({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})},D=g(x,null,null,{context:S})(({toolInstance:o,stepInfo:t,imgList:i,stepList:n,imgIndex:r,setBatchSetValid:e})=>{const{t:P}=I(),{selectedBox:m}=M(),u=y(o),[j,c]=f(!1),[L,b]=f([]),{isPointCloudDetectionPattern:k,isPointCloudSegmentationPattern:h}=R(),p=v(t.config);let a=[u.copyPrevious,u.empty,u.setValidity];if(k&&p.trackConfigurable===!0){const l=!m,B={name:P("UnifyParams"),key:"UnifyParams",imgSvg:l?V:T,hoverSvg:A,onClick:()=>{b(_({toolInstance:o,imgList:i,imgIndex:r,stepList:n})),c(!0)},forbidConfirm:!0,forbidOperation:l};a.unshift(B)}const O=U(()=>{c(!1)},[]),d=m==null?void 0:m.info;return h&&(a=a.filter(l=>!["setValidity","copyPrevious"].includes(l.key))),s.createElement(s.Fragment,null,s.createElement(C,{allOperation:a,setBatchSetValid:e,valid:o==null?void 0:o.valid}),s.createElement(E,{id:d==null?void 0:d.trackID,visible:j,onCancel:O,config:p,imgList:L}))});var F=g(x,null,null,{context:S})($);export{D as PointCloudOperation,F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a,{useState as S}from"react";import{connect as C}from"react-redux";import E from"../../../../utils/StepUtils.js";import{jsonParser as h}from"../../../../utils/index.js";import{I18nextProvider as I,useTranslation as P}from"react-i18next";import{LabelBeeContext as G}from"../../../../store/ctx.js";import{Checkbox as w,Select as b,Divider as L}from"antd";import{i18n as O}from"@labelbee/lb-utils";import j from"../../../../components/attributeList/index.js";var k=Object.defineProperty,x=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,g=(t,l,n)=>l in t?k(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,M=(t,l)=>{for(var n in l||(l={}))A.call(l,n)&&g(t,n,l[n]);if(x)for(var n of x(l))R.call(l,n)&&g(t,n,l[n]);return t};const W={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"},B=t=>{var l,n,s;const[z,_]=S(0),{toolInstance:i}=t,{t:m}=P(),u=t.stepInfo?h(t.stepInfo.config):{},d=(l=u==null?void 0:u.globalTagList)!=null?l:[],y=(u==null?void 0:u.globalTagConfigurable)===!0,v=i==null?void 0:i.exportContext,f=(n=v==null?void 0:v.extraResult)!=null?n:{},T=(s=f==null?void 0:f.globalTag)!=null?s:{};if(!t.stepInfo||!y||d.length===0)return null;const c=(e,r)=>{i&&i.setGlobalTag&&(Array.isArray(r)?i.setGlobalTag(e,r.join(";")):i.setGlobalTag(e,r),_(o=>o+1))},p=e=>{const r=T[e.value];return(e==null?void 0:e.isMulti)?r?r==null?void 0:r.split(";"):[]:r};return a.createElement(a.Fragment,null,d.map(e=>{var r;return(e==null?void 0:e.subSelected)&&a.createElement("div",{style:{marginTop:12},key:e.value},a.createElement("div",{style:W},m("GlobalTag"),"-",e.key),((r=e.subSelected)==null?void 0:r.length)<5?(e==null?void 0:e.isMulti)?a.createElement(w.Group,{style:{padding:"0px 20px 16px 16px"},options:e.subSelected.map(o=>({label:o.key,value:o.value})),value:p(e),onChange:o=>c(e.value,o)}):a.createElement(j,{list:e.subSelected.map(o=>({label:o.key,value:o.value})),selectedAttribute:p(e),num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:o=>c(e.value,o),style:{marginBottom:12}}):a.createElement(b,{style:{margin:"0px 20px 16px 16px",width:"87%"},mode:(e==null?void 0:e.isMulti)?"multiple":void 0,value:p(e),placeholder:m("PleaseSelect"),onChange:o=>c(e.value,o),allowClear:!0},e.subSelected.map(o=>a.createElement(b.Option,{key:o.value,value:o.value},o.key))),a.createElement(L,{style:{margin:0}}))}))},D=t=>{var l,n;const s=E.getCurrentStepInfo((l=t.annotation)==null?void 0:l.step,(n=t.annotation)==null?void 0:n.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:s}},U=t=>a.createElement(I,{i18n:O},a.createElement(B,M({},t)));var V=C(D,null,null,{context:G})(U);export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useState as
|
|
1
|
+
import e,{useState as T,useContext as B,useMemo as rt,useEffect as V}from"react";import{EditFilled as lt}from"@ant-design/icons";import{ToolIcons as st}from"../ToolIcons.js";import{EToolName as at}from"../../../../data/enums/ToolType.js";import{cTool as ct}from"@labelbee/lb-annotation";import{PointCloudContext as N}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as D,Input as ut,message as j}from"antd";import mt from"../../../../utils/StepUtils.js";import{connect as dt}from"react-redux";import{jsonParser as pt,classnames as gt}from"../../../../utils/index.js";import{useStatus as H}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as W}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as O}from"react-i18next";import{LabelBeeContext as ft,useDispatch as vt}from"../../../../store/ctx.js";import St from"./components/batchUpdateModal/index.js";import bt from"./components/annotatedBox/index.js";import Ct from"./components/rectRotateSensitivitySlider/index.js";import xt from"./components/findTrackIDIndex/index.js";import _t from"./components/firstFrameDataSwitch/index.js";import yt from"./components/selectBoxVisibleSwitch/index.js";import{EPointCloudSegmentStatus as L,EPointCloudPattern as Et}from"@labelbee/lb-utils";import Pt from"../../../../components/attributeList/index.js";import{useAttribute as J}from"../../../../components/pointCloudView/hooks/useAttribute.js";import ht from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import wt from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import Tt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import Dt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import jt from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import Lt from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as I}from"../index.js";import{SetTaskStepList as It}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as At}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import kt from"../../../../components/subAttributeList/index.js";import Bt from"../../../../components/DynamicResizer/DynamicResizer.js";import{isNumber as Vt}from"lodash";import Nt from"../../../../store/toolConfig/index.js";var Ot=Object.defineProperty,Rt=Object.defineProperties,$t=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,zt=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable,X=(o,t,n)=>t in o?Ot(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,R=(o,t)=>{for(var n in t||(t={}))zt.call(t,n)&&X(o,n,t[n]);if(K)for(var n of K(t))Mt.call(t,n)&&X(o,n,t[n]);return o},$=(o,t)=>Rt(o,$t(t));const Ft=()=>{const[o,t]=T(!1),n=B(N),{pointCloudBoxList:c}=n,{selectedBox:u,updateSelectedBox:r}=W(),[m,d]=T(""),{t:f}=O(),g=u==null?void 0:u.info.trackID,l=rt(()=>Vt(g)&&g>=0,[g]),s=a=>!!c.find(v=>v.trackID===a&&v.id!==(u==null?void 0:u.info.id)),x=(a=!1)=>{const p=parseInt(m,10);if(a&&t(!1),isNaN(p)){j.error(f("PositiveIntegerCheck"));return}if(m.indexOf(".")>-1){j.error(f("NotAllowDecimalPointsInTrackID"));return}if(s(p)){j.error(f("DuplicateTrackIDsExist"));return}if(!(p>0)){j.error(f("PositiveIntegerCheck"));return}S(p)};V(()=>{t(!1)},[g]);const S=a=>{var p;const v=r({trackID:a});(p=n==null?void 0:n.topViewInstance)==null||p.updatePolygonList(v!=null?v:[]),n.mainViewInstance&&n.selectedPointCloudBox&&(n==null||n.mainViewInstance.generateBox(n==null?void 0:n.selectedPointCloudBox))};return e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,f("CurrentBoxTrackIDs")),l&&e.createElement(St,{id:g,updateCurrentPolygonList:a=>S(a)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&l?e.createElement(ut,{defaultValue:g,onChange:a=>{d(a.target.value)},disabled:!l,size:"small",onBlur:()=>{x()},onPressEnter:()=>{x(!0)}}):e.createElement("span",null,g),e.createElement(lt,{style:{color:"#999",marginLeft:16,cursor:typeof g!="undefined"?"pointer":"not-allowed"},onClick:()=>{l&&t(!o)}})))},Y=({segmentStatus:o,globalPattern:t})=>t===Et.Segmentation&&![L.Edit,L.Ready].includes(o),q=({attributeList:o,subAttributeList:t,toolInstance:n,config:c,stepList:u,stepInfo:r,enableColorPicker:m})=>{const[d,f]=T({segmentStatus:L.Ready}),{selectedBox:g}=W(),l=B(N),{ptSegmentInstance:s}=l,{t:x}=O(),{defaultAttribute:S}=J(),a=At(),{isPointCloudSegmentationPattern:p}=H(),v=vt(),{attrChangeTrigger:P,setAttrChangeTrigger:h}=Nt(),A={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};V(()=>{if(!!s)return s.on("syncPointCloudStatus",f),()=>{s.unbind("syncPointCloudStatus",f)}},[s]);const z=(i,b)=>{var _,y,E,M,F;const w=(_=c==null?void 0:c.attributeList)==null?void 0:_.map(C=>C.value===i?$(R({},C),{color:b}):C),U=$(R({},c),{attributeList:w}),nt=JSON.stringify(U),it=u==null?void 0:u.map(C=>(C==null?void 0:C.step)===(r==null?void 0:r.step)?$(R({},C),{config:nt}):C);(y=l==null?void 0:l.topViewInstance)==null||y.updateAttributeList(w),(E=l==null?void 0:l.sideViewInstance)==null||E.updateAttributeList(w),(M=l==null?void 0:l.backViewInstance)==null||M.updateAttributeList(w),(F=l==null?void 0:l.mainViewInstance)==null||F.setConfig(U),v(It({stepList:it}))},k=i=>{a.updateViewsByDefaultSize&&a.updateViewsByDefaultSize(i)},Q=i=>{if(Y({globalPattern:l.globalPattern,segmentStatus:d.segmentStatus}))return;const b=i===S?P+1:0;h(b),n.setAttrChangeTrigger(b),n.setDefaultAttribute(i)},Z=(i,b)=>{Y({globalPattern:l.globalPattern,segmentStatus:d.segmentStatus})||n.setSubAttribute(i,b)},tt=o.map(i=>({label:i.key,value:i.value,color:i==null?void 0:i.color,limit:i==null?void 0:i.limit,isDefault:i==null?void 0:i.isDefault})),et=g||d.cacheSegData&&d.segmentStatus===L.Edit,ot=p;return e.createElement("div",{style:{height:"100%",overflow:"auto",display:"flex",flexDirection:"column"}},e.createElement("div",{style:A},x("Attribute")),e.createElement("div",{style:{height:0,flex:1,overflowY:"auto",overflowX:"hidden"}},e.createElement(Pt,{list:tt,forbidDefault:!0,selectedAttribute:S!=null?S:"",attributeChanged:i=>Q(i),updateColorConfig:z,enableColorPicker:m,updateSize:k,forbidShowLimitPopover:ot}),e.createElement(D,{style:{margin:0}}),et&&e.createElement(kt,{subAttributeList:t,setSubAttribute:Z,getValue:i=>{var b,_,y,E;return((_=(b=l.selectedPointCloudBox)==null?void 0:b.subAttribute)==null?void 0:_[i.value])||((E=(y=d.cacheSegData)==null?void 0:y.subAttribute)==null?void 0:E[i.value])}})))},Ut=[{toolName:"LassoSelector",commonSvg:ht,selectedSvg:wt},{toolName:"RectSelector",commonSvg:jt,selectedSvg:Lt},{toolName:"CircleSelector",commonSvg:Tt,selectedSvg:Dt}],G=({toolInstance:o})=>{const{ptSegmentInstance:t}=B(N),[n,c]=T("LassoSelector"),{t:u}=O();return V(()=>{if(!t)return;const r=()=>{c("LassoSelector")},m=()=>{c("RectSelector")},d=()=>{c("CircleSelector")};return t.on("LassoSelector",r),t.on("RectSelector",m),t.on("CircleSelector",d),()=>{t.unbind("LassoSelector",r),t.unbind("RectSelector",m),t.unbind("CircleSelector",d)}},[t]),e.createElement("div",{className:`${I}__level`},Ut.map(r=>{const m=n===r.toolName;return e.createElement("span",{className:`${I}__toolOption`,key:r.toolName,onClick:()=>t==null?void 0:t.emit(r.toolName)},e.createElement("img",{className:`${I}__singleTool`,src:m?r==null?void 0:r.selectedSvg:r==null?void 0:r.commonSvg}),e.createElement("span",{className:gt({[`${I}__toolOption__selected`]:m})},u(r.toolName)))}))},Ht=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:c,stepList:u,enableColorPicker:r})=>{var m;const{updatePointCloudPattern:d,pointCloudPattern:f,isPointCloudSegmentationPattern:g}=H(),{defaultAttribute:l}=J(),s=pt(o.config),x=(m=s==null?void 0:s.attributeList)!=null?m:[],S=(()=>{var a,p,v;const P=(a=s==null?void 0:s.attributeMapping)!=null?a:{};if((s==null?void 0:s.secondaryAttributeConfigurable)!==!0||!l)return[];const h=(p=s==null?void 0:s.inputList)!=null?p:[],A=(v=P[l])!=null?v:[];return Object.keys(P).length===0?h:h.filter(k=>A.includes(k.value))})();return g?e.createElement(e.Fragment,null,e.createElement(G,{toolInstance:t}),e.createElement(q,{toolInstance:t,attributeList:x,subAttributeList:S,config:s,stepList:u,stepInfo:o,enableColorPicker:r})):e.createElement(e.Fragment,null,e.createElement(st,{toolName:ct.EPointCloudName.PointCloud,selectedToolName:f,onChange:a=>d==null?void 0:d(a)}),e.createElement("div",{style:{flex:1,overflow:"hidden"}},e.createElement(Bt,{minTopHeight:42,defaultHeight:400,localKey:"settingid:"+(o==null?void 0:o.id)+"taskID:"+(o==null?void 0:o.taskID)+"step:"+(o==null?void 0:o.step)+"type:"+(o==null?void 0:o.type)},e.createElement(q,{toolInstance:t,attributeList:x,subAttributeList:S,config:s,stepList:u,stepInfo:o,enableColorPicker:r}),(s==null?void 0:s.trackConfigurable)===!0&&f===at.Rect?e.createElement("div",{style:{height:"100%",overflow:"auto"}},e.createElement(Ft,null),e.createElement(D,{style:{margin:0}}),e.createElement(bt,{imgList:n,imgIndex:c}),e.createElement(D,{style:{margin:0}}),e.createElement(xt,{imgList:n,imgIndex:c}),e.createElement(D,{style:{margin:0}}),e.createElement(Ct,null),o.loadPreStep>0&&e.createElement(_t,null),e.createElement(yt,null)):e.createElement("div",null))))},Wt=o=>{var t,n,c,u;const r=mt.getCurrentStepInfo((t=o.annotation)==null?void 0:t.step,(n=o.annotation)==null?void 0:n.stepList),m=(c=o.annotation)==null?void 0:c.toolInstance,d=(u=o.annotation)==null?void 0:u.stepList;return{stepInfo:r,toolInstance:m,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:d}};var Jt=dt(Wt,null,null,{context:ft})(Ht);export{G as PointCloudSegToolIcon,Jt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import p,{useState as v,useRef as L,useEffect as A}from"react";import{connect as S}from"react-redux";import g from"../../../../components/attributeList/index.js";import I from"../../../../utils/StepUtils.js";import{jsonParser as h}from"../../../../utils/index.js";import{useTranslation as x}from"react-i18next";import{EToolName as T}from"../../../../data/enums/ToolType.js";import{LabelBeeContext as _}from"../../../../store/ctx.js";const j=e=>{var r;const[a,l]=v(0),u=L(null),{toolInstance:t}=e,{t:b}=x(),d=n=>{t==null||t.setAttributeLockList(n)};if(A(()=>(t&&t.singleOn("changeAttributeSidebar",n=>{var s;l(f=>f+1),!!u.current&&((s=u.current.children[n])==null||s.scrollIntoView({block:"center"}))}),()=>{t==null||t.unbindAll("changeAttributeSidebar")}),[t,u]),!e.stepInfo)return null;const i=h(e.stepInfo.config),c=e.stepInfo.tool===T.ScribbleTool;if(i.attributeConfigurable!==!0&&!c)return null;if((i.attributeConfigurable===!0||c)&&(i==null?void 0:i.attributeList)){const n=i.attributeList.map(o=>({label:o.key,value:o.value,color:o==null?void 0:o.color}));c||n.unshift({label:b("NoAttribute"),value:""});const s=o=>{t&&(t.setDefaultAttribute(o),l(m=>m+1))},f=(r=t==null?void 0:t.defaultAttribute)!=null?r:"";return p.createElement(g,{list:n,attributeChanged:s,selectedAttribute:f,ref:u,attributeLockChange:d})}return null},C=e=>{var r,a;const l=I.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 k=S(C,null,null,{context:_})(j);export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import K from"../../../../components/attributeList/index.js";import
|
|
1
|
+
import K from"../../../../components/attributeList/index.js";import w from"../../../../components/checkboxList/index.js";import{CaretRightOutlined as M}from"@ant-design/icons";import{Collapse as T,Tooltip as P,Badge as x}from"antd/es";import{cloneDeep as F}from"lodash";import n,{useState as v,useRef as H,useEffect as p,useCallback as U}from"react";import q from"../../../../assets/annotation/common/icon_clearSmall.svg.js";import z from"../../../../assets/annotation/common/icon_clearSmall_a.svg.js";import{TagUtils as G}from"@labelbee/lb-annotation";import{connect as J}from"react-redux";import{useTranslation as Q}from"react-i18next";import{LabelBeeContext as V}from"../../../../store/ctx.js";const{Panel:W}=T,$=({isActive:a})=>n.createElement(M,{rotate:a?90:0}),X=({toolInstance:a,imgIndex:N})=>{const[s,g]=v([]),u=H(null),[,j]=v(0),[O,f]=v(-1),{t:b}=Q();p(()=>{var r,l;a&&(g((l=(r=a.config)==null?void 0:r.inputList)==null?void 0:l.map(e=>e.value)),a.singleOn("render",()=>{j(e=>e+1)}))},[a]),p(()=>{var r;if(a&&(a.singleOn("expend",A),((r=a==null?void 0:a.labelSelectedList)==null?void 0:r.length)===1)){let l=0;for(let e=0;e<a.labelSelectedList[0];e++)l+=46,o[e]&&s[e]!==""&&o[e].subSelected.forEach(t=>{l+=40});u.current&&(u.current.children[0].scrollTop=l)}}),p(()=>{u.current&&(u.current.children[0].scrollTop=0)},[N]);const A=()=>{var r;const l=a.labelSelectedList[0],e=(r=o.filter((t,m)=>m===l)[0])==null?void 0:r.value;E(l,e,!0)},E=U((r,l,e)=>{const t=F(s);t[r]===""||e===!0?t[r]=l:t[r]="",g(t)},[s]);if(!a)return null;const{labelSelectedList:i,config:{inputList:o},currentTagResult:c,setLabel:y}=a,B=r=>i.length>0&&i[0]===r?n.createElement("span",{className:"keyDownIconActive"},r+1):n.createElement("span",{className:"keyDownIcon"},r+1),h=(r,l=-1)=>r?r.map((e,t)=>{var m,_,L,k,C;if(e.subSelected){const R=G.judgeResultIsInInputList(e.value,(m=c==null?void 0:c.result)==null?void 0:m[e.value],o);return n.createElement(T,{bordered:!1,expandIcon:$,key:`collapse_${t}_${l+1}`,onChange:()=>E(t,e.value),activeKey:[s[t]]},n.createElement(W,{header:n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flex:1}},n.createElement("span",null,e.key,n.createElement(P,{placement:"bottom",title:b("ClearThisOption")},n.createElement("img",{style:{marginLeft:5,cursor:"pointer"},onClick:D=>{D.stopPropagation(),a.clearResult(!0,e.value)},src:O===t||R?z:q,onMouseEnter:()=>{f(t)},onMouseLeave:()=>{f(-1)}})),R&&s[t]===""&&n.createElement(x,{color:"#87d068"})),(o==null?void 0:o.length)>1&&B(t)),key:e.value},n.createElement("div",{className:"level",style:{backgroundColor:i.length>0&&i[0]===t?"rgba(158, 158, 158, 0.18)":""}},h(e.subSelected,t))))}const d=(o==null?void 0:o[l])?o==null?void 0:o[l].value:0,S=((k=(L=(_=c==null?void 0:c.result)==null?void 0:_[d])==null?void 0:L.split(";"))==null?void 0:k.indexOf(e.value))>-1?e.value:"";return((C=o==null?void 0:o[l])==null?void 0:C.isMulti)===!0?n.createElement("div",{className:"singleBar",key:`${d}_${l}_${t}`},n.createElement(w,{attributeChanged:()=>y(l,t),selectedAttribute:[S],list:[{value:e.value,label:e.key}],num:t+1})):n.createElement("div",{className:"singleBar",key:`${d}_${l}_${t}`},n.createElement(K,{forbidColor:!0,attributeChanged:()=>y(l,t),selectedAttribute:S,list:[{value:e.value,label:e.key}],num:t+1}))}):null;return n.createElement("div",{className:"tagOperationMenu",ref:u},(o==null?void 0:o.length)===0?n.createElement("div",{style:{padding:20,textAlign:"center"}},b("NoConfiguration")):n.createElement("div",{className:"main"},h(o)))};function Y(a){return{toolInstance:a.annotation.toolInstance,imgIndex:a.annotation.imgIndex}}var Z=J(Y,null,null,{context:V})(X);export{Z as default,$ as expandIconFuc};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EToolName as
|
|
1
|
+
import{EToolName as t}from"../../../data/enums/ToolType.js";import e from"react";import{sidebarCls as n}from"./index.js";import E from"../../../assets/annotation/lineTool/icon_line.svg.js";import N from"../../../assets/annotation/lineTool/icon_line_a.svg.js";import S from"../../../assets/annotation/pointTool/icon_point.svg.js";import y from"../../../assets/annotation/pointTool/icon_point_a.svg.js";import P from"../../../assets/annotation/polygonTool/icon_polygon_a.svg.js";import R from"../../../assets/annotation/polygonTool/icon_polygon.svg.js";import{cTool as w}from"@labelbee/lb-annotation";import O from"classnames";import{useTranslation as $}from"react-i18next";import{Dropdown as j}from"antd";import{DownOutlined as C}from"@ant-design/icons";import{ReactComponent as c}from"../../../assets/annotation/rectTool/two_points_rect.svg.js";import{ReactComponent as u}from"../../../assets/annotation/rectTool/three_points_rect.svg.js";import{useLocalStorageState as M}from"ahooks";const{EPointCloudName:b,TOOL_NAME:h,TOOL_NAME_EN:k,ERectToolModeType:l,RECT_TOOL_MODE_NAME:L}=w,d=[{toolName:t.Rect,dropdownItems:[{key:l.ThreePoints,icon:e.createElement(u,null),label:"\u4E09\u70B9\u753B\u77E9\u5F62"},{key:l.TwoPoints,icon:e.createElement(c,null),label:"\u4E24\u70B9\u753B\u77E9\u5F62"}]},{toolName:t.Polygon,commonSvg:R,selectedSvg:P},{toolName:t.Line,commonSvg:E,selectedSvg:N},{toolName:t.Point,commonSvg:S,selectedSvg:y}],B=s=>s==="en"?k:h,x=({toolName:s,selectedToolName:p,onChange:r})=>{const{i18n:g}=$(),m=d==null?void 0:d.filter(o=>s===b.PointCloud?[t.Polygon,t.Rect,t.Point,t.Line].includes(o==null?void 0:o.toolName):(o==null?void 0:o.toolName)===s),_=m.length>1,[a,T]=M(L,{defaultValue:l.ThreePoints,serializer:o=>o!=null?o:"",deserializer:o=>o}),v=a===l.TwoPoints?c:u,f=o=>{T(o.key)};return e.createElement("div",{className:`${n}__level`},m.map(o=>{const i=_&&p===o.toolName;return e.createElement("span",{className:`${n}__toolOption`,key:o.toolName,onClick:()=>r==null?void 0:r(o.toolName)},o.dropdownItems?e.createElement(j,{overlayClassName:`${n}__dropdown`,menu:{items:o.dropdownItems,selectable:!0,defaultSelectedKeys:a?[a]:[],onClick:f}},e.createElement("div",{className:`${n}__multiBox`,style:{color:i?"#666fff":"#999999"}},e.createElement(v,null),e.createElement(C,null))):e.createElement("img",{className:`${n}__singleTool`,src:i?o==null?void 0:o.selectedSvg:o==null?void 0:o.commonSvg}),e.createElement("span",{className:O({[`${n}__toolOption__selected`]:i})},B(g.language)[o.toolName]))}))};export{x as ToolIcons};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n,{useState as V,useRef as k,useMemo as T,useEffect as y}from"react";import{connect as D}from"react-redux";import R from"../../../../components/attributeList/index.js";import F from"../../../../components/attributeInputEditor/index.js";import w from"../../../../utils/StepUtils.js";import{jsonParser as P}from"../../../../utils/index.js";import{useTranslation as U}from"react-i18next";import{LabelBeeContext as B}from"../../../../store/ctx.js";import E from"../../../../components/subAttributeList/index.js";import{Divider as C}from"antd";const M=i=>{var u,l;const[A,d]=V(0),a=k(null),{toolInstance:t}=i,{t:h}=U(),r=i.stepInfo?P(i.stepInfo.config):{},m=(u=t==null?void 0:t.defaultAttribute)!=null?u:"",c=t==null?void 0:t.exportContext,s=c==null?void 0:c.selectedID,f=c==null?void 0:c.result,p=(l=r==null?void 0:r.inputList)!=null?l:[],b=T(()=>{if(s&&f)return f.find(e=>e.id===s)},[s,f]),_=e=>{t==null||t.setAttributeLockList(e)};if(y(()=>(t&&t.singleOn("changeAttributeSidebar",e=>{var o;d(v=>v+1),!!a.current&&((o=a.current.children[e])==null||o.scrollIntoView({block:"center"}))}),()=>{t==null||t.unbindAll("changeAttributeSidebar")}),[t,a]),!i.stepInfo||r.attributeConfigurable!==!0)return null;const g=e=>{t&&(t.setDefaultAttribute(e),d(o=>o+1))},L=(e,o)=>{t&&t.setSubAttribute&&(t.setSubAttribute(e,o),d(v=>v+1))},I=e=>{if(b==null?void 0:b.subAttribute)return b.subAttribute[e.value]},S=m&&s&&b&&p.length>0&&(r==null?void 0:r.secondaryAttributeConfigurable)===!0,j=()=>n.createElement(n.Fragment,null,s&&n.createElement(F,{selectedAttribute:m,attributeChanged:g}),S&&n.createElement(n.Fragment,null,n.createElement(C,{style:{margin:0}}),n.createElement(E,{subAttributeList:p,setSubAttribute:L,getValue:I,lang:"cn"})));if(r.customAttributeInput)return j();if(!(r==null?void 0:r.attributeList))return null;const x=r.attributeList.map(e=>({label:e.key,value:e.value,color:e==null?void 0:e.color}));return x.unshift({label:h("NoAttribute"),value:""}),n.createElement("div",null,n.createElement(R,{list:x,attributeChanged:g,selectedAttribute:m,ref:a,attributeLockChange:_}),S&&n.createElement(n.Fragment,null,n.createElement(C,{style:{margin:0}}),n.createElement(E,{subAttributeList:p,setSubAttribute:L,getValue:I,lang:"cn"})))},N=i=>{var u,l;const A=w.getCurrentStepInfo((u=i.annotation)==null?void 0:u.step,(l=i.annotation)==null?void 0:l.stepList);return{toolInstance:i.annotation.toolInstance,stepInfo:A}};var O=D(N,null,null,{context:B})(M);export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{prefix as
|
|
1
|
+
import{prefix as z}from"../../../constant/index.js";import{EToolName as n}from"../../../data/enums/ToolType.js";import D from"../../../utils/StepUtils.js";import{Collapse as b}from"antd/es";import e,{useState as U}from"react";import{useTranslation as q}from"react-i18next";import H from"./AnnotationText/index.js";import J from"./ClearIcon/index.js";import Q,{PointCloudOperation as _}from"./GeneralOperation/index.js";import X from"./ImgAttributeInfo/index.js";import $ from"./SwitchAttributeList/index.js";import E,{expandIconFuc as A}from"./TagSidebar/index.js";import x from"./TextToolSidebar/index.js";import I from"./PointCloudToolSidebar/index.js";import Y from"./ToolStyle/index.js";import{cTool as Z}from"@labelbee/lb-annotation";import ee from"./ScribbleSidebar/index.js";import{ToolIcons as te}from"./ToolIcons.js";import{useSelector as oe}from"../../../store/ctx.js";import{Tabs as P}from"antd";import{classnames as ne}from"../../../utils/index.js";import w from"../../../assets/annotation/common/icon_menu_fold.svg.js";import re from"../../../components/LLMToolView/sidebar/index.js";import ie from"../../../components/LLMMultiWheelView/sidebar/index.js";import le from"./NLPSidebar/index.js";import ae from"../../../components/videoAnnotate/videoClipTool/components/annotatedList/index.js";import se from"./VideoClipToolAttributeList/index.js";import ce from"./GlobalTagList/index.js";const{EVideoToolName:m,EPointCloudName:me}=Z,{Panel:M}=b,t=`${z}-sidebar`,de=i=>{var a;return i?(a={[m.VideoClipTool]:e.createElement(se,null)}[i])!=null?a:e.createElement($,null):e.createElement($,null)},ue=({sider:i,enableColorPicker:a,setSiderWidth:d,propsSiderWidth:pe,checkMode:u,setBatchSetValid:V})=>{const T=oe(r=>D.getCurrentStepInfo(r.annotation.step,r.annotation.stepList)),[p,B]=U(!0),o=T==null?void 0:T.tool,{t:S}=q();if(!o)return null;const G=r=>{const c=e.createElement(Y,null);return e.createElement(M,{header:S("Style"),className:"panel",key:r},c)},g=e.createElement(te,{toolName:o,onChange:()=>{}}),s=de(o),L=e.createElement(H,null),C=e.createElement(b,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:A},G("1")),h=e.createElement(b,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:A},e.createElement(M,{header:e.createElement("div",null,S("Adjust"),e.createElement(J,null)),className:"panel",key:"imgAttribute"},e.createElement(X,null))),l=e.createElement(Q,null),O=e.createElement(E,null),k=r=>e.createElement(x,{disabled:r}),v=e.createElement(ee,{onChange:(r,c)=>{}}),N=e.createElement(ae,null),F=e.createElement(ce,null),j=e.createElement(re,{checkMode:u}),K=e.createElement(ie,{checkMode:u}),y=e.createElement(le,{checkMode:u}),f=e.createElement("div",{className:`${t}__horizontal`}),R=e.createElement(I,{enableColorPicker:a}),W=e.createElement(_,{setBatchSetValid:V});if(i)return typeof i=="function"?e.createElement("div",{className:`${t}`},i({toolIcon:g,attributeList:s,annotationText:L,toolStyle:C,imageAttributeInfo:h,operation:l,tagToolSideBar:O,textToolSideBar:k,horizontal:f,pointCloudToolSidebar:R,pointCloudOperation:W,scribbleSidebar:v,LLMSidebar:j,LLMMultiWheelSidebar:K,videoClipSidebar:N,NLPSidebar:y,globalTagList:F})):i;if([n.Rect,n.Point,n.Line,n.Rect,n.Polygon,n.Cuboid].includes(o))return e.createElement("div",{className:`${t}`},g,f,s,L,f,e.createElement("div",{className:`${t}__content`},C,h),l);if(o===n.Tag)return e.createElement("div",{className:`${t}`},e.createElement(E,null));if(o===m.VideoClipTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},N,s),l);if(o===m.VideoTagTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(E,null)),l);if(o===m.VideoTextTool)return e.createElement("div",{className:`${t}`},e.createElement(x,null));if(o===n.Text)return e.createElement("div",{className:`${t}`},"s",e.createElement(x,null));if(o===me.PointCloud){const r=()=>{B(!p),d&&d(p?48:void 0)},c=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:w})));return p?e.createElement(P,{type:"card",activeKey:"1",className:ne({[`${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:w}))}},e.createElement(P.TabPane,{tab:"\u5DE5\u5177\u9762\u677F",key:"1",style:{height:"100%",display:"flex",flexDirection:"column"}},e.createElement("div",{className:`${t}__content`},e.createElement(I,null)),e.createElement(_,null))):c}return o===n.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},v,s),l):o===n.LLM?j:o===n.NLP?y:null};export{ue as default,t as sidebarCls};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.24.0-alpha.
|
|
3
|
+
"version": "1.24.0-alpha.60",
|
|
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,19 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.28.0-alpha.
|
|
47
|
-
"@labelbee/lb-utils": "1.
|
|
46
|
+
"@labelbee/lb-annotation": "1.28.0-alpha.32",
|
|
47
|
+
"@labelbee/lb-utils": "1.20.0-alpha.9",
|
|
48
48
|
"@labelbee/wavesurfer": "1.1.0",
|
|
49
|
-
"@types/react-dom": "
|
|
49
|
+
"@types/react-dom": "18.3.1",
|
|
50
50
|
"@types/react-transition-group": "^4.4.9",
|
|
51
|
-
"ahooks": "
|
|
51
|
+
"ahooks": "3.8.5",
|
|
52
52
|
"classnames": "^2.3.0",
|
|
53
53
|
"decimal.js": "^10.4.3",
|
|
54
54
|
"diff-match-patch": "^1.0.5",
|
|
55
55
|
"github-markdown-css": "^5.2.0",
|
|
56
56
|
"lodash": "^4.17.21",
|
|
57
57
|
"postcss-url": "^10.1.3",
|
|
58
|
-
"re-resizable": "
|
|
58
|
+
"re-resizable": "6.9.17",
|
|
59
59
|
"react-colorful": "^5.6.1",
|
|
60
60
|
"react-draggable": "^4.4.6",
|
|
61
61
|
"react-i18next": "^11.12.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@svgr/rollup": "^8.1.0",
|
|
90
90
|
"@types/diff-match-patch": "^1.0.36",
|
|
91
91
|
"@types/lodash": "^4.14.168",
|
|
92
|
-
"@types/react": "
|
|
92
|
+
"@types/react": "16.14.62",
|
|
93
93
|
"@types/react-redux": "^7.1.16",
|
|
94
94
|
"@types/react-syntax-highlighter": "^15.5.0",
|
|
95
95
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"rollup-plugin-esbuild": "^3.0.2",
|
|
115
115
|
"rollup-plugin-postcss": "^4.0.2",
|
|
116
116
|
"rollup-plugin-terser": "^7.0.2",
|
|
117
|
-
"rollup-plugin-web-worker-loader": "
|
|
117
|
+
"rollup-plugin-web-worker-loader": "1.6.1",
|
|
118
118
|
"sass": "^1.53.0",
|
|
119
119
|
"typescript": "^4.2.3"
|
|
120
120
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";module.exports=img;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";module.exports=img;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";module.exports=img;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"react";var t="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"react";var a="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"react";var t="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";export{t as default};
|