@labelbee/lb-components 1.23.0-alpha.2 → 1.23.0-alpha.20
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/App.js +1 -1
- package/dist/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/dist/components/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/LLMToolView/utils/data.js +1 -1
- package/dist/components/NLPToolView/index.js +1 -1
- package/dist/components/NLPToolView/textContent/extraMask.js +1 -1
- package/dist/components/NLPToolView/textContent/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/clipSidebar/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/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/subAttributeList/index.js +1 -0
- package/dist/index.css +13 -7
- 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/types/App.d.ts +2 -1
- package/dist/types/components/LLMToolView/utils/data.d.ts +1 -1
- package/dist/types/components/audioAnnotate/audioContext/index.d.ts +1 -1
- package/dist/types/components/audioPlayer/index.d.ts +3 -1
- package/dist/types/components/longText/index.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +6 -1
- package/dist/types/components/subAttributeList/index.d.ts +9 -0
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/annotation/actionCreators.d.ts +3 -2
- package/dist/types/store/annotation/reducer.d.ts +1 -0
- package/dist/types/store/annotation/types.d.ts +9 -2
- package/dist/types/utils/index.d.ts +4 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- package/dist/views/MainView/sidebar/NLPSidebar/indicatorDetermine.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/App.js +1 -1
- package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/es/components/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/LLMToolView/utils/data.js +1 -1
- package/es/components/NLPToolView/index.js +1 -1
- package/es/components/NLPToolView/textContent/extraMask.js +1 -1
- package/es/components/NLPToolView/textContent/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/clipSidebar/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/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/hooks/useStatus.js +1 -1
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/subAttributeList/index.js +1 -0
- package/es/index.css +13 -7
- 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/utils/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- package/es/views/MainView/sidebar/NLPSidebar/indicatorDetermine.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EPointCloudPattern as
|
|
1
|
+
import{EPointCloudPattern as E}from"@labelbee/lb-utils";import it,{useState as n,useRef as zt,useMemo as st,useEffect as N}from"react";import{ActionsHistory as lt,EToolName as G}from"@labelbee/lb-annotation";import{useDispatch as Et}from"../../store/ctx.js";import{ChangeSave as Nt}from"../../store/annotation/actionCreators.js";import Gt from"../../store/annotatedBox/index.js";import Ft from"lodash";var Mt=Object.defineProperty,kt=Object.defineProperties,Tt=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,Zt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,at=(s,o,i)=>o in s?Mt(s,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[o]=i,Jt=(s,o)=>{for(var i in o||(o={}))Zt.call(o,i)&&at(s,i,o[i]);if(rt)for(var i of rt(o))qt.call(o,i)&&at(s,i,o[i]);return s},Kt=(s,o)=>kt(s,Tt(o)),Qt=(s,o,i)=>new Promise((b,S)=>{var D=u=>{try{C(i.next(u))}catch(I){S(I)}},_=u=>{try{C(i.throw(u))}catch(I){S(I)}},C=u=>u.done?b(u.value):Promise.resolve(u.value).then(D,_);C((i=i.apply(s,o)).next())});const ct=s=>Ft.pick(s,["id","attribute","width","height","x","y","imageName"]),dt=it.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lt,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:G.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:E.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:s=>{},imageSizes:{},cacheImageNodeSize:()=>{}}),Ut=({children:s})=>{const[o,i]=n([]),[b,S]=n([]),[D,_]=n([]),[C,u]=n([]),[I,ut]=n([]),[h,x]=n([]),[y,R]=n([]),[F,pt]=n(!0),[M,gt]=n(!0),[k,ht]=n(1),[a,T]=n(),[Z,q]=n(),[J,K]=n(),[l,Q]=n(),[U,vt]=n(""),[B,ft]=n(G.Rect),Pt=zt(new lt).current,[p,O]=n([]),[W,mt]=n(""),[H,It]=n(E.Detection),[w,X]=n(void 0),[j,bt]=n([]),[z,Ct]=n([]),g=Gt(),[Y,wt]=n({}),Lt=Et(),St=r=>{const{imgNode:c,path:d}=r;d&&c&&wt(P=>Kt(Jt({},P),{[d]:{width:c.width,height:c.height}}))},$=st(()=>h.length===1?h[0]:"",[h]),V=st(()=>{const r=o.find(t=>t.id===$),c=t=>{const e=o.concat(t);return i(e),e},d=t=>{const e=b.concat(t);return S(e),e},P=t=>{pt(t!==!1)},v=t=>{t===void 0&&x([]),typeof t=="string"&&x([t]),Array.isArray(t)&&x(Array.from(new Set(t)))},yt=t=>{h.includes(t)?v(h.filter(e=>e!==t)):v([...h,t])},At=t=>{const e=ct(t);u(f=>[...f,e])},Vt=t=>{const e=ct(t);u(f=>f.map(m=>m.id===t.id?e:m))},_t=t=>{u(e=>e.filter(f=>!t.find(m=>m.id===f.id)))},xt=t=>{y.includes(t)?R([]):R([t])},Rt=()=>{if(B===G.Rect){const t=o.map(e=>e.id);v(t),a==null||a.pointCloud2dOperation.setSelectedIDs(t)}},Bt=t=>{v(o.filter(e=>e.attribute===t).map(e=>e.id))},tt=o.filter(t=>!p.includes(t.attribute)),et=b.filter(t=>!p.includes(t.attribute)),ot=I.filter(t=>t.attribute&&!p.includes(t.attribute)),Ot=t=>{if(p.includes(t))O(p.filter(e=>e!==t));else{const e=p.concat(t);O(e)}},Ht=(t=tt,e=D,f=et,m=ot,A=j)=>{var L;l==null||l.clearAllBox(),l==null||l.clearAllSphere(),a==null||a.updatePolygonList(t,e),a==null||a.updatePointList(f),a==null||a.updateLineList(m),l==null||l.generateBoxes(t),l==null||l.generateSpheres(f),(L=w==null?void 0:w.store)==null||L.updateCurrentSegment(A),nt(t)},jt=()=>{T(void 0),q(void 0),K(void 0),Q(void 0)},nt=(t,e)=>Qt(void 0,null,function*(){var f;if(!l)return;const m=l.pointCloudObject;if(!!m)try{const A=yield l.getHighlightIndexByMappingImgList({mappingImgList:e!=null?e:z,points:m.geometry.attributes.position.array}),L=yield l==null?void 0:l.highlightOriginPointCloud(t,A);return L&&((f=a==null?void 0:a.pointCloudInstance)==null||f.updateColor(L)),L}catch(A){console.error(A)}});return{selectedID:$,pointCloudBoxList:o,pointCloudSphereList:b,displayPointCloudList:tt,displaySphereList:et,displayLineList:ot,selectedIDs:h,setPointCloudResult:i,setSelectedIDs:v,addPointCloudBox:c,addPointCloudSphere:d,setPointCloudSphereList:S,valid:F,selectedPointCloudBox:r,setPointCloudValid:P,addSelectedID:yt,addHighlightID:xt,selectedAllBoxes:Rt,topViewInstance:a,setTopViewInstance:T,sideViewInstance:Z,setSideViewInstance:q,backViewInstance:J,setBackViewInstance:K,mainViewInstance:l,setMainViewInstance:Q,polygonList:D,setPolygonList:_,rectList:C,setRectList:u,addRectIn2DView:At,removeRectIn2DView:_t,updateRectIn2DView:Vt,lineList:I,setLineList:ut,zoom:k,setZoom:ht,history:Pt,toggleAttributesVisible:Ot,hideAttributes:p,setHideAttributes:O,reRender:Ht,attrPanelLayout:W,setAttrPanelLayout:mt,syncAllViewPointCloudColor:nt,defaultAttribute:U,setDefaultAttribute:vt,pointCloudPattern:B,setPointCloudPattern:ft,selectSpecAttr:Bt,globalPattern:H,setGlobalPattern:t=>{H!==t&&(Lt(Nt),It(t),t===E.Detection&&X(void 0))},ptSegmentInstance:w,setPtSegmentInstance:X,segmentation:j,setSegmentation:bt,clearAllDetectionInstance:jt,highlight2DDataList:z,setHighlight2DDataList:Ct,cuboidBoxIn2DView:M,setCuboidBoxIn2DView:gt,imageSizes:Y,cacheImageNodeSize:St,highlightIDs:y,setHighlightIDs:R}},[F,h,o,b,D,I,C,a,Z,J,l,k,p,W,U,B,H,w,j,z,M,Y,y]);N(()=>{var r,c,d;(r=g==null?void 0:g.setPointCloudBoxList)==null||r.call(g,o),(c=g==null?void 0:g.setHighlightIDs)==null||c.call(g,y),(d=g==null?void 0:g.setSelectedIDs)==null||d.call(g,h)},[o,h,y]),N(()=>{var r;(r=g==null?void 0:g.setPtCtx)==null||r.call(g,V)},[V]);const Dt=()=>{const r=o.filter(v=>p.includes(v.attribute)),{setSelectedIDs:c,reRender:d}=V,P=r.map(v=>v.id);P.length>0&&c(h.filter(v=>!P.includes(v))),d()};return N(()=>{var r,c,d,P;Dt(),(c=(r=a==null?void 0:a.toolInstance)==null?void 0:r.setHiddenAttributes)==null||c.call(r,p),(P=(d=w==null?void 0:w.store)==null?void 0:d.setHiddenAttributes)==null||P.call(d,p)},[p]),it.createElement(dt.Provider,{value:V},s)};export{dt as PointCloudContext,Ut as PointCloudProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as
|
|
1
|
+
import{useContext as I,useMemo as P}from"react";import{PointCloudContext as E}from"../PointCloudContext.js";import{cTool as x}from"@labelbee/lb-annotation";import{useHistory as A}from"./useHistory.js";import{EPointCloudPattern as C}from"@labelbee/lb-utils";const{EToolName:o,EPolygonPattern:p}=x,T=()=>{const{topViewInstance:r,sideViewInstance:a,backViewInstance:u,mainViewInstance:e,setPointCloudResult:v,setPointCloudSphereList:h,setPolygonList:m,setRectList:b,pointCloudPattern:c,setPointCloudPattern:n,syncAllViewPointCloudColor:L,globalPattern:l,setLineList:w}=I(E),{pushHistoryWithList:y}=A(),f=()=>{e==null||e.clearAllBox(),e==null||e.clearAllSphere(),e==null||e.render(),v([]),m([]),h([]),w([]),b([]),r==null||r.toolScheduler.clearStatusAndResult(),L([]),y({pointCloudBoxList:[],polygonList:[],pointCloudSphereList:[]})},i=()=>{a==null||a.toolInstance.clearResult(),u==null||u.toolInstance.clearResult()},g=d=>{if(d===c)return;const s=[r,a,u];switch(d){case o.Rect:i(),s.forEach(t=>{t==null||t.switchToCanvas(o.PointCloudPolygon),t==null||t.toolInstance.setPattern(p.Rect)}),n(o.Rect);break;case o.Polygon:i(),s.forEach(t=>{t==null||t.switchToCanvas(o.PointCloudPolygon),t==null||t.toolInstance.setPattern(p.Normal)}),n(o.Polygon);break;case o.Point:i(),s.forEach(t=>{t==null||t.switchToCanvas(o.Point)}),n(o.Point);break;case o.Line:i(),s.forEach(t=>{t==null||t.switchToCanvas(o.Line)}),n(o.Line);break}},R=P(()=>l===C.Detection,[l]),S=P(()=>l===C.Segmentation,[l]);return{clearAllResult:f,updatePointCloudPattern:g,pointCloudPattern:c,isPointCloudDetectionPattern:R,isPointCloudSegmentationPattern:S}};export{T as useStatus};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as n}from"../../utils/dom.js";import t,{useContext as
|
|
1
|
+
import{getClassName as n}from"../../utils/dom.js";import t,{useContext as T,useState as y,useEffect as C}from"react";import _ from"./PointCloud3DView.js";import k from"./PointCloudBackView.js";import B from"./PointCloudTopView.js";import F from"./PointCloudSideView.js";import R from"./PointCloud2DView.js";import M from"./PointCloudListener.js";import G from"./PointCloudSegmentListener.js";import O from"./PointCloudSegment.js";import Z from"./PointCloudSegmentStatus.js";import U from"./PointCloudSegmentToolbar.js";import W from"./PointCloudSegment2DView.js";import{connect as $}from"react-redux";import{LabelBeeContext as q,useDispatch as z}from"../../store/ctx.js";import{AnnotatedAttributesPanelFixedLeft as H,AnnotatedAttributesPanelFixedRight as J}from"../../views/MainView/toolFooter/AnnotatedAttributes/index.js";import{PointCloudContext as K}from"./PointCloudContext.js";import{PointCloudUtils as Q,EPointCloudPattern as X}from"@labelbee/lb-utils";import{useCustomToolInstance as Y}from"../../hooks/annotation.js";import{jsonParser as tt}from"../../utils/index.js";import{a2MapStateToProps as et}from"../../store/annotation/map.js";import L from"classnames";import ot from"./components/sideAndBackOverView/index.js";import{SetLoadPCDFileLoading as nt}from"../../store/annotation/actionCreators.js";const it=E=>{const{currentData:a,imgList:S,drawLayerSlot:d,checkMode:i,intelligentFit:w,imgIndex:x,config:b,measureVisible:j}=E,e=T(K),{globalPattern:p,setGlobalPattern:v,selectedIDs:P}=e,V=z(),[l,f]=y(!1),h=(P==null?void 0:P.length)>0&&l,D=tt(a.result),{toolInstanceRef:r,clearToolInstance:A}=Y({basicInfo:D});if(C(()=>{r.current.setPointCloudGlobalPattern=o=>{o!==p&&(v(o),e.clearAllDetectionInstance(),A())}},[p]),C(()=>{var o;if(nt(V,!0),a){const{boxParamsList:s,polygonList:m,lineList:u,sphereParamsList:c,segmentation:N,rectList:I}=Q.parsePointCloudCurrentResult((o=a==null?void 0:a.result)!=null?o:"");e.setPointCloudResult(s),e.setPolygonList(m),e.setLineList(u),e.setPointCloudSphereList(c),e.setRectList(I),e.setSegmentation(N)}},[x]),C(()=>{r.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],r.current.exportCustomData=()=>{var o,s,m,u,c;return{resultPolygon:(o=e.polygonList)!=null?o:[],resultLine:(s=e.lineList)!=null?s:[],resultPoint:(m=e.pointCloudSphereList)!=null?m:[],resultRect:(u=e.rectList)!=null?u:[],segmentation:(c=e.segmentation)!=null?c:[]}}},[e.pointCloudBoxList,e.rectList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),S.length===0)return null;if(p===X.Segmentation)return t.createElement(t.Fragment,null,t.createElement(G,{checkMode:i,toolInstanceRef:r}),t.createElement(U,null),t.createElement("div",{className:n("point-cloud-layout")},t.createElement(O,{checkMode:i}),t.createElement(W,null)),t.createElement(Z,{config:b}),d==null?void 0:d({direct:!0}));let g=t.createElement("div",{className:n("point-cloud-container","left-bottom")},t.createElement(k,{checkMode:i}),t.createElement(F,{checkMode:i}));return l&&(g=t.createElement(ot,{selectAndEnlarge:h,checkMode:i})),t.createElement(t.Fragment,null,t.createElement(M,{checkMode:i,toolInstanceRef:r}),t.createElement("div",{className:n("point-cloud-layout"),onContextMenu:o=>o.preventDefault()},t.createElement("div",{className:n("point-cloud-wrapper")},t.createElement(H,null),t.createElement("div",{className:n("point-cloud-content")},t.createElement("div",{className:n("point-cloud-container","left")},t.createElement(_,null),g),t.createElement("div",{className:L({[n("point-cloud-container","right")]:!0,[n("point-cloud-container","rightZoom")]:l})},t.createElement(B,{drawLayerSlot:d,checkMode:i,intelligentFit:w,setIsEnlargeTopView:f,onExitZoom:()=>{f(!1)},isEnlargeTopView:l}),t.createElement("div",{className:L({[n("point-cloud-container","right-bottom")]:!l,[n("point-cloud-container","right-bottom-floatLeft")]:l})},t.createElement(R,{isEnlargeTopView:l,thumbnailWidth:l?300:455,checkMode:i,measureVisible:j})))),t.createElement(J,null))))};var lt=$(et,null,null,{context:q})(it);export{lt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import l from"react";import{Select as i,Divider as d}from"antd";import{useTranslation as p}from"react-i18next";import u from"../attributeList/index.js";const s={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"},v=m=>{const{subAttributeList:c,setSubAttribute:a,getValue:r}=m,{t:n}=p();return l.createElement(l.Fragment,null,c.map(e=>{var o;return(e==null?void 0:e.subSelected)&&l.createElement("div",{style:{marginTop:12},key:e.value},l.createElement("div",{style:s},n("SubAttribute"),"-",e.key),((o=e.subSelected)==null?void 0:o.length)<5?l.createElement(u,{list:e.subSelected.map(t=>({label:t.key,value:t.value})),selectedAttribute:r(e),num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:t=>a(e.value,t),style:{marginBottom:12}}):l.createElement(i,{style:{margin:"0px 21px 17px 16px",width:"87%"},value:r(e),placeholder:n("PleaseSelect"),onChange:t=>a(e.value,t),allowClear:!0},e.subSelected.map(t=>l.createElement(i.Option,{key:t.value,value:t.value},t.key))),l.createElement(d,{style:{margin:0}}))}))};export{v as default};
|
package/es/index.css
CHANGED
|
@@ -132,6 +132,12 @@
|
|
|
132
132
|
.index-module_outputDisplay__5dS48 .index-module_content__Iml6l .markdown-body {
|
|
133
133
|
font-size: 14px;
|
|
134
134
|
}
|
|
135
|
+
|
|
136
|
+
.index-module_tip__NFru6 {
|
|
137
|
+
margin-bottom: 8px;
|
|
138
|
+
color: rgba(0, 0, 0, 0.45);
|
|
139
|
+
font-size: 14px;
|
|
140
|
+
}
|
|
135
141
|
.index-module_tagList__cvWor {
|
|
136
142
|
padding: 0px 16px 16px 16px;
|
|
137
143
|
}
|
|
@@ -1870,11 +1876,14 @@
|
|
|
1870
1876
|
-ms-user-select: none;
|
|
1871
1877
|
user-select: none;
|
|
1872
1878
|
}
|
|
1879
|
+
.generalOperation .generalOperation-col {
|
|
1880
|
+
display: flex;
|
|
1881
|
+
justify-content: center;
|
|
1882
|
+
}
|
|
1873
1883
|
.generalOperation .item {
|
|
1874
1884
|
text-align: center;
|
|
1875
|
-
flex: 1;
|
|
1876
1885
|
box-sizing: border-box;
|
|
1877
|
-
width:
|
|
1886
|
+
width: 100px;
|
|
1878
1887
|
height: 100%;
|
|
1879
1888
|
display: flex;
|
|
1880
1889
|
flex-direction: column;
|
|
@@ -3077,15 +3086,12 @@
|
|
|
3077
3086
|
display: block;
|
|
3078
3087
|
}
|
|
3079
3088
|
.bee-sidebar__content__NLPList__item__text {
|
|
3080
|
-
flex: 1 1;
|
|
3081
|
-
padding: 16px;
|
|
3082
3089
|
font-weight: 400;
|
|
3083
3090
|
font-size: 12px;
|
|
3084
3091
|
line-height: 20px;
|
|
3085
3092
|
color: #666666;
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
white-space: nowrap;
|
|
3093
|
+
padding: 16px;
|
|
3094
|
+
width: 100%;
|
|
3089
3095
|
}
|
|
3090
3096
|
.bee-sidebar__content__NLPList__item__active {
|
|
3091
3097
|
background-color: #eeefff;
|
package/es/store/Actions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const T={INIT_ALL_STATE:"@@INIT_ALL_STATE",UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",UPDATE_BEFORE_ROTATE:"@@UPDATE_BEFORE_ROTATE",SET_LOADING:"@@SET_LOADING",SET_LOADPCDFILE_LOADING:"@@SET_LOADPCDFILE_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_CHECK_MODE:"@@SET_CHECK_MODE",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST",UPDATE_ANNOTATION_VALID:"@@UPDATE_ANNOTATION_VALID",BATCH_UPDATE_TRACK_ID:"@@BATCH_UPDATE_TRACK_ID",BATCH_UPDATE_RESULT_BY_TRACK_ID:"@@BATCH_UPDATE_RESULT_BY_TRACK_ID",BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:"@@BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT",SET_PREDICT_RESULT_VISIBLE:"@@SET_PREDICT_RESULT_VISIBLE",SET_PREDICT_RESULT:"@@SET_PREDICT_RESULT",SET_HIGHLIGHT_ATTRIBUTE:"@@SET_HIGHLIGHT_ATTRIBUTE",UPDATE_PRE_DATA_PROCESS:"@@UPDATE_PRE_DATA_PROCESS"},_={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},E={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};export{T as ANNOTATION_ACTIONS,_ as IMAGE_ATTRIBUTE_ACTIONS,E as TOOL_STYLE_ACTIONS};
|
|
1
|
+
const T={INIT_ALL_STATE:"@@INIT_ALL_STATE",UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",UPDATE_BEFORE_ROTATE:"@@UPDATE_BEFORE_ROTATE",SET_LOADING:"@@SET_LOADING",SET_LOADPCDFILE_LOADING:"@@SET_LOADPCDFILE_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_CHECK_MODE:"@@SET_CHECK_MODE",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST",UPDATE_ANNOTATION_VALID:"@@UPDATE_ANNOTATION_VALID",BATCH_UPDATE_TRACK_ID:"@@BATCH_UPDATE_TRACK_ID",BATCH_UPDATE_RESULT_BY_TRACK_ID:"@@BATCH_UPDATE_RESULT_BY_TRACK_ID",BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:"@@BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT",SET_PREDICT_RESULT_VISIBLE:"@@SET_PREDICT_RESULT_VISIBLE",SET_PREDICT_RESULT:"@@SET_PREDICT_RESULT",SET_HIGHLIGHT_ATTRIBUTE:"@@SET_HIGHLIGHT_ATTRIBUTE",UPDATE_PRE_DATA_PROCESS:"@@UPDATE_PRE_DATA_PROCESS",UPDATE_IMG_INDEX_BY_EXTERNAL:"@@UPDATE_IMG_INDEX_BY_EXTERNAL"},_={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},E={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};export{T as ANNOTATION_ACTIONS,_ as IMAGE_ATTRIBUTE_ACTIONS,E as TOOL_STYLE_ACTIONS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ANNOTATION_ACTIONS as a}from"../Actions.js";import{LoadFileAndFileData as O,getStepConfig as
|
|
1
|
+
import{ANNOTATION_ACTIONS as a}from"../Actions.js";import{LoadFileAndFileData as O,getStepConfig as K}from"./reducer.js";import{ESubmitType as E}from"../../constant/index.js";import{EPageTurningOperation as y}from"../../data/enums/AnnotationSize.js";import V from"../../utils/PageOperator.js";import{jsonParser as J}from"../../utils/index.js";import{getBoxesByTrackID as X}from"../../components/predictTracking/previewResult/util.js";var x=(t,e,n)=>new Promise((o,r)=>{var u=p=>{try{i(n.next(p))}catch(l){r(l)}},s=p=>{try{i(n.throw(p))}catch(l){r(l)}},i=p=>p.done?o(p.value):Promise.resolve(p.value).then(u,s);i((n=n.apply(t,e)).next())});const N=(t,e)=>e.map(n=>t(n)),Y=t=>t===y.Forward?E.Forward:t===y.Backward?E.Backward:t===y.Jump?E.Jump:E.Forward,W=(t,e)=>{var n,o,r;const{imgList:u,imgIndex:s}=t,{dataSourceStep:i}=K(t.stepList,t.step);return((r=(o=J((n=u[s-1])==null?void 0:n.result)[`step_${i}`])==null?void 0:o.result)==null?void 0:r.length)-1||e};function q(t){return{type:a.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function G({stepList:t}){return{type:a.SET_TASK_STEP_LIST,payload:{stepList:t}}}function w({stepList:t,step:e}){return{type:a.SET_TASK_CONFIG,payload:{stepList:t,step:e}}}function U(t){return{type:a.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function L(t){return{type:a.UPDATE_ON_SAVE,payload:{onSave:t}}}function D(t){return{type:a.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function R(t){return{type:a.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function m(t){return{type:a.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function g(t){return{type:a.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function C(t){return{type:a.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function z(){return{type:a.UPDATE_ROTATE}}function F(t){return{type:a.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function h(t){return{type:a.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function B(t){return{type:a.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function Z(){return{type:a.COPY_BACKWARD_RESULT}}function k(t){return{type:a.UPDATE_IMG_INDEX_BY_EXTERNAL,payload:{getImgIndexByExternal:t}}}function $({id:t,newID:e,rangeIndex:n,imgList:o}){return{type:a.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:e,rangeIndex:n,imgList:o}}}function Q(t,e,n){return{type:a.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:e,rangeIndex:n}}}function tt(){return{type:a.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const b=t=>({type:a.SET_CHECK_MODE,payload:{checkMode:t}}),v=t=>({type:a.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function et({onSubmit:t,onSave:e,onPageChange:n,onStepChange:o,getFileData:r,pageSize:u,loadFileList:s,step:i,stepList:p,skipBeforePageTurning:l,beforeRotate:_,checkMode:c,highlightAttribute:T,preDataProcess:f,getImgIndexByExternal:I}){const d=[];return t&&d.push(U(t)),e&&d.push(L(e)),n&&d.push(D(n)),o&&d.push(R(o)),r&&d.push(m(r)),s&&d.push(C(s)),u&&d.push(g(u)),l&&d.push(F(l)),_&&d.push(h(_)),f&&d.push(B(f)),typeof c=="boolean"&&d.push(b(c)),I&&d.push(k(I)),d.push(v(T)),d.push(w({stepList:p,step:i})),d.push({type:a.CALC_STEP_PROGRESS}),d.push({type:a.INIT_TOOL}),j=>N(j,d)}function nt({onSubmit:t,onSave:e,onPageChange:n,onStepChange:o,getFileData:r,pageSize:u,loadFileList:s,stepList:i,beforeRotate:p,highlightAttribute:l,preDataProcess:_}){const c=[];return t&&c.push(U(t)),e&&c.push(L(e)),n&&c.push(D(n)),o&&c.push(R(o)),r&&c.push(m(r)),s&&c.push(C(s)),u&&c.push(g(u)),p&&c.push(h(p)),_&&c.push(B(_)),c.push(v(l)),c.push(G({stepList:i})),T=>N(T,c)}const at=(t,e)=>{var n;const o=e==null?void 0:e.findIndex(r=>(r==null?void 0:r.step)===t);return(n=e[o+1])==null?void 0:n.step},ot=t=>(e,n)=>{const{annotation:o}=n(),{step:r,stepList:u}=o,s=at(r,u);return[e(H(s,t))]},H=(t,e)=>(n,o)=>{var r,u;const{annotation:s}=o();(r=s==null?void 0:s.onStepChange)==null||r.call(s,t);const i=(u=s==null?void 0:s.imgIndex)!=null?u:0;return[n({type:a.SUBMIT_RESULT}),n({type:a.SUBMIT_FILE_DATA,payload:{submitType:E.StepChanged}}),n({type:a.SET_STEP,payload:{toStep:t}}),n({type:a.CALC_STEP_PROGRESS}),n(O(e!=null?e:i,0))]},S=t=>e=>[e({type:a.SUBMIT_RESULT}),e({type:a.SUBMIT_FILE_DATA,payload:{submitType:t}})],rt=(t,e,n,o)=>[t(S(n)),t(O(e,o))],it=(t,e)=>[t({type:a.SUBMIT_RESULT}),t({type:a.SET_BASIC_INDEX,payload:{basicIndex:e}})],ut=(t,e)=>{t({type:a.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:e}})},st=(t=!1)=>(e,n)=>A(e,n,y.Backward,t),pt=(t=!1)=>(e,n)=>A(e,n,y.Forward,t),lt=(t,e=!1)=>(n,o)=>{if(t!==o().imgIndex)return A(n,o,y.Jump,e,t)},M=(t,e,n,o)=>x(void 0,null,function*(){var r;const{loadFileList:u,imgList:s,pageSize:i}=e().annotation,p=Math.floor(n/i);P(t,!0);try{const l=yield u(p,i);if(P(t,!1),!((r=l==null?void 0:l.fileList)==null?void 0:r.length)||!(l==null?void 0:l.total))throw new Error("fileList and total are required");const _=o?new Array(l.total):[...s];return _.splice(p*i,i,...l.fileList),t({type:a.UPDATE_IMG_LIST,payload:{imgList:_}}),!0}catch(l){P(t,!1),console.error(l)}}),A=(t,e,n,o=!1,r)=>x(void 0,null,function*(){var u,s;const i=e().annotation,p=Y(n);let{fileIndexChanged:l,fileIndex:_,basicIndexChanged:c,basicIndex:T}=V.getNextPageInfo(n,i,r);const f=(u=i==null?void 0:i.getImgIndexByExternal)==null?void 0:u.call(i,i.imgIndex,p);if(f!==void 0&&(l=!0,_=f),ut(t,o),l){if(i.loading||!i.imgList[_]&&!(yield M(t,e,_)))return;(s=i.onPageChange)==null||s.call(i,_);const I=p===E.Backward?W(e().annotation,T):T;return rt(t,_,p,I)}return c?it(t,T):t(S(p))}),dt=t=>{t(S(E.Save)),t({type:a.SAVE_RESULT})},P=(t,e)=>{t({type:a.SET_LOADING,payload:{loading:e}})},ct=(t,e)=>{t({type:a.SET_LOADING,payload:{loading:e}})},_t=(t,e)=>{t({type:a.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:e}})},Tt=t=>{t({type:a.INIT_ALL_STATE,payload:{}})},Et=(t,e)=>{t({type:a.SET_PREDICT_RESULT,payload:{result:e}})},yt=(t,e)=>{t({type:a.SET_PREDICT_RESULT_VISIBLE,payload:{visible:e}})},ft=(t,e)=>(n,o)=>{const{imgList:r,step:u}=o().annotation;return X(r,u,t,e)},It=t=>(e,n)=>{var o,r;const{annotation:u}=n();return(r=(o=u==null?void 0:u.preDataProcess)==null?void 0:o.call(u,t))!=null?r:t.dataList};export{tt as BatchUpdateImgListResultByPredictResult,Q as BatchUpdateResultByTrackID,$ as BatchUpdateTrackID,dt as ChangeSave,Z as CopyBackWordResult,A as DispatcherTurning,ft as GetBoxesByID,Tt as InitAnnotationState,et as InitTaskData,st as PageBackward,pt as PageForward,lt as PageJump,It as PreDataProcess,P as SetAnnotationLoading,_t as SetLoadPCDFileLoading,ct as SetPointCloudLoading,Et as SetPredictResult,yt as SetPredictResultVisible,w as SetTaskConfig,G as SetTaskStepList,ot as ToNextStep,S as ToSubmitFileData,h as UpdateBeforeRotate,b as UpdateCheckMode,m as UpdateGetFileData,C as UpdateGetFileList,v as UpdateHighlightAttribute,k as UpdateImgIndexByExternal,nt as UpdateInjectFunc,D as UpdateOnPageChange,L as UpdateOnSave,R as UpdateOnStepChange,U as UpdateOnSubmit,g as UpdatePageSize,B as UpdatePreDataProcess,H as UpdateProcessingStep,z as UpdateRotate,F as UpdateSkipBeforePageTurning,q as UpdateToolInstance,M as loadImgList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFormatSize as At}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Dt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as l}from"../Actions.js";import{jsonParser as w}from"../../utils/index.js";import Y from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as vt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as ut,composeResult as J}from"../../utils/data.js";import O from"../../utils/StepUtils.js";import X from"../../utils/ToolUtils.js";import{MathUtils as at,CommonToolUtils as yt,AnnotationEngine as Pt,ImgUtils as Rt}from"@labelbee/lb-annotation";import{PointCloudUtils as ct,i18n as G}from"@labelbee/lb-utils";import{Modal as dt}from"antd";import{message as pt}from"antd/es";import _t from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as W}from"../../data/enums/ToolType.js";var Ct=Object.defineProperty,Ot=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,It=(t,e,r)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))bt.call(e,r)&&It(t,r,e[r]);if(gt)for(var r of gt(e))Nt.call(e,r)&&It(t,r,e[r]);return t},i=(t,e)=>Ot(t,ht(e)),mt=(t,e,r)=>new Promise((S,d)=>{var A=m=>{try{T(r.next(m))}catch(y){d(y)}},f=m=>{try{T(r.throw(m))}catch(y){d(y)}},T=m=>m.done?S(m.value):Promise.resolve(m.value).then(A,f);T((r=r.apply(t,e)).next())});const x=(t,e)=>t.find(r=>r.step===e),ft={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},Ut=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},Tt=(t,e)=>t.reduce((r,S)=>{if(S){const d=S.result;if(w(d)[`step_${e}`])return r+1}return r},0)/t.length,Bt=(t,e)=>{const{step:r,stepList:S}=t,d=O.getCurrentStepInfo(r,S),A=vt.jsonParser(d.config);if(X.isVideoTool(d==null?void 0:d.tool)||X.isAudioTool(d==null?void 0:d.tool)||X.isPointCloudTool(d==null?void 0:d.tool)||[W.LLM,W.NLP].includes(d==null?void 0:d.tool))return;const f=document.getElementById("toolContainer");if(!f)throw"Not exist dom named id-toolContainer";const T=At({width:window.innerWidth,height:window.innerHeight}),m=new Pt({container:f,toolName:d.tool,size:T,imgNode:e,config:A,style:JSON.parse(Dt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},wt=(t,e)=>(r,S)=>mt(void 0,null,function*(){var d,A;const{stepList:f,step:T}=S().annotation,m=O.currentToolIsVideo(T,f),y=O.currentToolIsPointCloud(T,f),h=((d=O.getCurrentStepInfo(T,f))==null?void 0:d.tool)===W.LLM,b=((A=O.getCurrentStepInfo(T,f))==null?void 0:A.tool)===W.NLP,N=O.currentToolIsAudio(T,f);if($(r,!0),yield r(xt(t)),m){r(Ft(t));return}if(y||h||N||b){r(jt(t));return}r(Gt(t,e))}),xt=t=>(e,r)=>mt(void 0,null,function*(){const{getFileData:S,imgList:d}=r().annotation;if(S){const A=yield S(d[t],t);e({type:l.SET_FILE_DATA,payload:{fileData:A,index:t}})}}),Ft=t=>e=>{e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},jt=t=>e=>{$(e,!1),e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},Gt=(t,e)=>(r,S)=>{var d;const{toolInstance:A,imgList:f}=S().annotation,T=(d=f==null?void 0:f[t])==null?void 0:d.url;Rt.load(T).then(m=>{$(r,!1),r({type:l.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),A==null||A.setErrorImg(),r({type:l.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Vt=({toolInstance:t,imgList:e,imgIndex:r,stepList:S,step:d=1})=>{var A,f,T,m;const y=((A=e[r])==null?void 0:A.result)||"",[h,b,N]=(f=t==null?void 0:t.exportData())!=null?f:[],V=(m=(T=t==null?void 0:t.exportCustomData)==null?void 0:T.call(t))!=null?m:{},M=ut(y,b),k=J(M,{step:d,stepList:S},{rect:h},V);return e.map((F,H)=>H===r?n(i(n({},F),{result:k}),N):n({},F))},Mt=(t=n({},ft),e)=>{var r,S,d,A,f,T,m,y,h,b,N,V,M,k,F,H,q,Z,Q,tt,et,ot,nt,st,lt;switch(e.type){case l.INIT_ALL_STATE:return n(n({},t),ft);case l.UPDATE_TOOL_INSTANCE:return i(n({},t),{toolInstance:e.payload.toolInstance});case l.UPDATE_IMG_LIST:return i(n({},t),{imgList:e.payload.imgList});case l.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=Tt(o,s);return i(n({},t),{stepProgress:u})}case l.SUBMIT_FILE_DATA:{const{imgList:o,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:L}=t;if(!p||!o[s])return t;const g=((r=o[s])==null?void 0:r.result)||"",[,_,I]=(S=p==null?void 0:p.exportData())!=null?S:[],E=(A=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?A:{},D=ut(g,_),P=J(D,{step:u,stepList:a},{rect:L},E),v=t.imgList.map((C,R)=>{if(R===s){const j=Y.dataCorrection(P,g,u,a);return n(i(n({},C),{result:j}),I)}return C});if(((f=e.payload)==null?void 0:f.submitType)===K.SyncImgList)return i(n({},t),{imgList:v});c&&c([v[s]],(T=e.payload)==null?void 0:T.submitType,s,v);const U=Tt(v,u);return i(n({},t),{stepProgress:U,imgList:v})}case l.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case l.SUBMIT_RESULT:{const{imgList:o,basicIndex:s,resultList:u,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let L=c;if((p==null?void 0:p.length)>0){const g=(y=p[s])==null?void 0:y.id,_=c.map(I=>i(n({},I),{sourceID:g}));L=_t.cloneDeep(u).filter(I=>I.sourceID!==g),L.push(..._)}return i(n({},t),{resultList:L,imgList:o})}case l.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:L,basicResultList:g}=t;if(!o||!c)return t;const _=e.payload.basicIndex,I=(h=g[_])==null?void 0:h.id,E=w((b=u[a])==null?void 0:b.result),D=(L||[]).filter(j=>j.sourceID===I),P=x(p,s),{dataSourceStep:v,tool:U}=P,C=x(p,v);let R=[];return v&&U&&(R=(N=E[`step_${v}`])==null?void 0:N.result,(R==null?void 0:R.length)>0?(c==null||c.setBasicInfo(C.tool,R[_]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),pt.info(G.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),i(n({},t),{basicIndex:_})}case l.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return i(n({},t),{triggerEventAfterIndexChanged:!!o})}case l.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return i(n({},t),{imgIndex:e.payload.nextIndex});const c=O.getCurrentStepInfo(s,p),{nextIndex:L,imgNode:g,nextBasicIndex:_,imgError:I}=e.payload,E=_!=null?_:0,D=w((V=o[L])==null?void 0:V.result),P=D[`step_${c.step}`],v=!P,U={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};g&&I!==!0?a==null||a.setImgNode(g,U):u==null||u.setValid(U.valid);const C=x(p,c.step),{dataSourceStep:R,tool:j}=C,it=x(p,R),rt=R&&j,B=(H=(F=D[`step_${R}`])==null?void 0:F.result)!=null?H:[],z=Y.getInitialResultList(P==null?void 0:P.result,u,C,B,v);if(a==null||a.launchOperation(),rt&&((B==null?void 0:B.length)>0?a==null||a.setBasicInfo(it.tool,B[E]):(a==null||a.setBasicInfo(it.tool),a==null||a.forbidOperation(),pt.info(G.t("NoDependency")))),c.tool!=="check"){const Lt=(Z=(q=B[E])==null?void 0:q.id)!=null?Z:"",Et=rt?z.filter(St=>yt.isSameSourceID(St.sourceID,Lt)):z;(Q=u==null?void 0:u.history)==null||Q.initRecord(z,!0),u==null||u.setResult(Et)}return i(n({},t),{imgIndex:L,basicIndex:E,basicResultList:B,resultList:z})}case l.UPDATE_ANNOTATION_CONFIG:return i(n({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case l.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return i(n({},t),{stepList:o})}case l.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return i(n({},t),{stepList:o,step:s})}case l.INIT_TOOL:{const{imgNode:o}=t,s=Bt(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return i(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case l.SET_TOOL:{const o=(et=e.payload)==null?void 0:et.instance;return o?i(n({},t),{toolInstance:o}):n({},t)}case l.UPDATE_ON_SUBMIT:return i(n({},t),{onSubmit:e.payload.onSubmit});case l.UPDATE_ON_SAVE:return i(n({},t),{onSave:e.payload.onSave});case l.UPDATE_ON_PAGE_CHANGE:return i(n({},t),{onPageChange:e.payload.onPageChange});case l.SET_PREDICT_RESULT:return i(n({},t),{predictionResult:e.payload.result});case l.SET_PREDICT_RESULT_VISIBLE:return i(n({},t),{predictionResultVisible:e.payload.visible});case l.UPDATE_ON_STEP_CHANGE:return i(n({},t),{onStepChange:e.payload.onStepChange});case l.UPDATE_GET_FILE_DATA:return i(n({},t),{getFileData:e.payload.getFileData});case l.UPDATE_PAGE_SIZE:return i(n({},t),{pageSize:e.payload.pageSize});case l.UPDATE_LOAD_FILE_LIST:return i(n({},t),{loadFileList:e.payload.loadFileList});case l.UPDATE_BEFORE_ROTATE:return i(n({},t),{beforeRotate:e.payload.beforeRotate});case l.UPDATE_PRE_DATA_PROCESS:return i(n({},t),{preDataProcess:e.payload.preDataProcess});case l.SKIP_BEFORE_PAGE_TURNING:return i(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case l.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),i(n({},t),{imgList:a})}case l.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||(ot=o==null?void 0:o.updateRotate)==null||ot.call(o),t}case l.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(nt=o==null?void 0:o.valid)!=null?nt:!0;return dt.destroyAll(),dt.confirm({content:G.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:G.t("Confirm"),cancelText:G.t("Cancel")}),t}case l.COPY_BACKWARD_RESULT:{const{toolInstance:o,imgIndex:s,imgList:u,step:a}=t;if(!o)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const p=u[s-1].result;if(!p)return t;const c=Y.copyResultChange(p,a,(st=u[s].result)!=null?st:"");u[s]=i(n({},u[s]),{result:c});const g=w(c)[`step_${a}`],_=(g==null?void 0:g.result)||[];return o==null||o.setResult(_),o==null||o.history.pushHistory(_),(lt=o==null?void 0:o.asyncData)==null||lt.call(o,u[s]),i(n({},t),{imgList:[...u]})}case l.SET_STEP:{const{stepList:o,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=x(o,u);return s==null||s.setToolName(a.tool,a.config),i(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case l.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return i(n({},t),{loadPCDFileLoading:!!o})}case l.SET_LOADING:{const{loading:o}=e.payload;return i(n({},t),{loading:!!o})}case l.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return i(n({},t),{pointCloudLoading:!!o})}case l.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return i(n({},t),{checkMode:!!o})}case l.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return i(n({},t),{highlightAttribute:o})}case l.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=i(n({},_),{result:ct.batchUpdateTrackID({id:o,newID:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=i(n({},_),{result:ct.batchUpdateResultByTrackID({id:o,newData:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:o,imgList:s,stepList:u,step:a,predictionResult:p}=t,c={};p.forEach(I=>{const{index:E}=I;c[E]=_t.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const L=`step_${a}`,g=[],_=s.map((I,E)=>{if(c[E]){const D=I.result==="{}"?w(J("",{step:a,stepList:u},{rect:[]},{})):w(I.result);D[L].result.push(c[E]);const P=i(n({},I),{result:JSON.stringify(D)});return g.push({imgIndex:E,newInfo:P}),P}return I});return o==null||o(_,K.BatchUpdateImgList,-1,_,{updateImgList:g}),i(n({},t),{imgList:_})}default:return t}};export{wt as LoadFileAndFileData,Mt as annotationReducer,Vt as composeResultByToolInstance,x as getStepConfig,Ut as getTotalPage};
|
|
1
|
+
import{getFormatSize as St}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Dt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as i}from"../Actions.js";import{jsonParser as x}from"../../utils/index.js";import X from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as vt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as ut,composeResult as Y}from"../../utils/data.js";import O from"../../utils/StepUtils.js";import J from"../../utils/ToolUtils.js";import{MathUtils as at,CommonToolUtils as yt,AnnotationEngine as Pt,ImgUtils as Rt}from"@labelbee/lb-annotation";import{PointCloudUtils as ct,i18n as G}from"@labelbee/lb-utils";import{Modal as dt}from"antd";import{message as pt}from"antd/es";import _t from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as W}from"../../data/enums/ToolType.js";var Ct=Object.defineProperty,Ot=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,It=(t,e,r)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,o=(t,e)=>{for(var r in e||(e={}))bt.call(e,r)&&It(t,r,e[r]);if(gt)for(var r of gt(e))Nt.call(e,r)&&It(t,r,e[r]);return t},l=(t,e)=>Ot(t,ht(e)),mt=(t,e,r)=>new Promise((A,d)=>{var S=m=>{try{T(r.next(m))}catch(y){d(y)}},f=m=>{try{T(r.throw(m))}catch(y){d(y)}},T=m=>m.done?A(m.value):Promise.resolve(m.value).then(S,f);T((r=r.apply(t,e)).next())});const w=(t,e)=>t.find(r=>r.step===e),ft={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},Ut=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},Tt=(t,e)=>t.reduce((r,A)=>{if(A){const d=A.result;if(x(d)[`step_${e}`])return r+1}return r},0)/t.length,Bt=(t,e)=>{const{step:r,stepList:A}=t,d=O.getCurrentStepInfo(r,A),S=vt.jsonParser(d.config);if(J.isVideoTool(d==null?void 0:d.tool)||J.isAudioTool(d==null?void 0:d.tool)||J.isPointCloudTool(d==null?void 0:d.tool)||[W.LLM,W.NLP].includes(d==null?void 0:d.tool))return;const f=document.getElementById("toolContainer");if(!f)throw"Not exist dom named id-toolContainer";const T=St({width:window.innerWidth,height:window.innerHeight}),m=new Pt({container:f,toolName:d.tool,size:T,imgNode:e,config:S,style:JSON.parse(Dt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},xt=(t,e)=>(r,A)=>mt(void 0,null,function*(){var d,S;const{stepList:f,step:T}=A().annotation,m=O.currentToolIsVideo(T,f),y=O.currentToolIsPointCloud(T,f),h=((d=O.getCurrentStepInfo(T,f))==null?void 0:d.tool)===W.LLM,b=((S=O.getCurrentStepInfo(T,f))==null?void 0:S.tool)===W.NLP,N=O.currentToolIsAudio(T,f);if($(r,!0),yield r(wt(t)),m){r(Ft(t));return}if(y||h||N||b){r(jt(t));return}r(Gt(t,e))}),wt=t=>(e,r)=>mt(void 0,null,function*(){const{getFileData:A,imgList:d}=r().annotation;if(A){const S=yield A(d[t],t);e({type:i.SET_FILE_DATA,payload:{fileData:S,index:t}})}}),Ft=t=>e=>{e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},jt=t=>e=>{$(e,!1),e({type:i.LOAD_FILE_DATA,payload:{nextIndex:t}})},Gt=(t,e)=>(r,A)=>{var d;const{toolInstance:S,imgList:f}=A().annotation,T=(d=f==null?void 0:f[t])==null?void 0:d.url;Rt.load(T).then(m=>{$(r,!1),r({type:i.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),S==null||S.setErrorImg(),r({type:i.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Vt=({toolInstance:t,imgList:e,imgIndex:r,stepList:A,step:d=1})=>{var S,f,T,m;const y=((S=e[r])==null?void 0:S.result)||"",[h,b,N]=(f=t==null?void 0:t.exportData())!=null?f:[],V=(m=(T=t==null?void 0:t.exportCustomData)==null?void 0:T.call(t))!=null?m:{},M=ut(y,b),k=Y(M,{step:d,stepList:A},{rect:h},V);return e.map((F,H)=>H===r?o(l(o({},F),{result:k}),N):o({},F))},Mt=(t=o({},ft),e)=>{var r,A,d,S,f,T,m,y,h,b,N,V,M,k,F,H,q,Z,Q,tt,et,nt,ot,st,lt;switch(e.type){case i.INIT_ALL_STATE:return o(o({},t),ft);case i.UPDATE_TOOL_INSTANCE:return l(o({},t),{toolInstance:e.payload.toolInstance});case i.UPDATE_IMG_LIST:return l(o({},t),{imgList:e.payload.imgList});case i.CALC_STEP_PROGRESS:{const{imgList:n,step:s}=t,u=Tt(n,s);return l(o({},t),{stepProgress:u})}case i.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:L}=t;if(!p||!n[s])return t;const g=((r=n[s])==null?void 0:r.result)||"",[,_,I]=(A=p==null?void 0:p.exportData())!=null?A:[],E=(S=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?S:{},D=ut(g,_),P=Y(D,{step:u,stepList:a},{rect:L},E),v=t.imgList.map((C,R)=>{if(R===s){const j=X.dataCorrection(P,g,u,a);return o(l(o({},C),{result:j}),I)}return C});if(((f=e.payload)==null?void 0:f.submitType)===K.SyncImgList)return l(o({},t),{imgList:v});c&&c([v[s]],(T=e.payload)==null?void 0:T.submitType,s,v);const U=Tt(v,u);return l(o({},t),{stepProgress:U,imgList:v})}case i.SAVE_RESULT:{const{imgList:n,imgIndex:s,onSave:u}=t;return u==null||u(n[s],s,n),o({},t)}case i.SUBMIT_RESULT:{const{imgList:n,basicIndex:s,resultList:u,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let L=c;if((p==null?void 0:p.length)>0){const g=(y=p[s])==null?void 0:y.id,_=c.map(I=>l(o({},I),{sourceID:g}));L=_t.cloneDeep(u).filter(I=>I.sourceID!==g),L.push(..._)}return l(o({},t),{resultList:L,imgList:n})}case i.SET_BASIC_INDEX:{const{toolInstance:n,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:L,basicResultList:g}=t;if(!n||!c)return t;const _=e.payload.basicIndex,I=(h=g[_])==null?void 0:h.id,E=x((b=u[a])==null?void 0:b.result),D=(L||[]).filter(j=>j.sourceID===I),P=w(p,s),{dataSourceStep:v,tool:U}=P,C=w(p,v);let R=[];return v&&U&&(R=(N=E[`step_${v}`])==null?void 0:N.result,(R==null?void 0:R.length)>0?(c==null||c.setBasicInfo(C.tool,R[_]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),pt.info(G.t("NoDependency")))),n==null||n.setResult(D),n==null||n.history.initRecord(D,!0),l(o({},t),{basicIndex:_})}case i.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=e.payload;return l(o({},t),{triggerEventAfterIndexChanged:!!n})}case i.LOAD_FILE_DATA:{const{imgList:n,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return l(o({},t),{imgIndex:e.payload.nextIndex});const c=O.getCurrentStepInfo(s,p),{nextIndex:L,imgNode:g,nextBasicIndex:_,imgError:I}=e.payload,E=_!=null?_:0,D=x((V=n[L])==null?void 0:V.result),P=D[`step_${c.step}`],v=!P,U={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};g&&I!==!0?a==null||a.setImgNode(g,U):u==null||u.setValid(U.valid);const C=w(p,c.step),{dataSourceStep:R,tool:j}=C,it=w(p,R),rt=R&&j,B=(H=(F=D[`step_${R}`])==null?void 0:F.result)!=null?H:[],z=X.getInitialResultList(P==null?void 0:P.result,u,C,B,v);if(a==null||a.launchOperation(),rt&&((B==null?void 0:B.length)>0?a==null||a.setBasicInfo(it.tool,B[E]):(a==null||a.setBasicInfo(it.tool),a==null||a.forbidOperation(),pt.info(G.t("NoDependency")))),c.tool!=="check"){const Lt=(Z=(q=B[E])==null?void 0:q.id)!=null?Z:"",Et=rt?z.filter(At=>yt.isSameSourceID(At.sourceID,Lt)):z;(Q=u==null?void 0:u.history)==null||Q.initRecord(z,!0),u==null||u.setResult(Et)}return l(o({},t),{imgIndex:L,basicIndex:E,basicResultList:B,resultList:z})}case i.UPDATE_ANNOTATION_CONFIG:return l(o({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case i.SET_TASK_STEP_LIST:{const{stepList:n}=e.payload;return l(o({},t),{stepList:n})}case i.SET_TASK_CONFIG:{const{stepList:n,step:s}=e.payload;return l(o({},t),{stepList:n,step:s})}case i.INIT_TOOL:{const{imgNode:n}=t,s=Bt(t,n);if(s){const{toolInstance:u,annotationEngine:a}=s;return l(o({},t),{toolInstance:u,annotationEngine:a})}return o({},t)}case i.SET_TOOL:{const n=(et=e.payload)==null?void 0:et.instance;return n?l(o({},t),{toolInstance:n}):o({},t)}case i.UPDATE_ON_SUBMIT:return l(o({},t),{onSubmit:e.payload.onSubmit});case i.UPDATE_ON_SAVE:return l(o({},t),{onSave:e.payload.onSave});case i.UPDATE_ON_PAGE_CHANGE:return l(o({},t),{onPageChange:e.payload.onPageChange});case i.SET_PREDICT_RESULT:return l(o({},t),{predictionResult:e.payload.result});case i.SET_PREDICT_RESULT_VISIBLE:return l(o({},t),{predictionResultVisible:e.payload.visible});case i.UPDATE_ON_STEP_CHANGE:return l(o({},t),{onStepChange:e.payload.onStepChange});case i.UPDATE_GET_FILE_DATA:return l(o({},t),{getFileData:e.payload.getFileData});case i.UPDATE_PAGE_SIZE:return l(o({},t),{pageSize:e.payload.pageSize});case i.UPDATE_LOAD_FILE_LIST:return l(o({},t),{loadFileList:e.payload.loadFileList});case i.UPDATE_BEFORE_ROTATE:return l(o({},t),{beforeRotate:e.payload.beforeRotate});case i.UPDATE_PRE_DATA_PROCESS:return l(o({},t),{preDataProcess:e.payload.preDataProcess});case i.UPDATE_IMG_INDEX_BY_EXTERNAL:return l(o({},t),{getImgIndexByExternal:e.payload.getImgIndexByExternal});case i.SKIP_BEFORE_PAGE_TURNING:return l(o({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case i.SET_FILE_DATA:{const{fileData:n,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=o(o({},a[s]),n),l(o({},t),{imgList:a})}case i.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:s}=t;return s&&s()===!1||(nt=n==null?void 0:n.updateRotate)==null||nt.call(n),t}case i.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=t,s=(ot=n==null?void 0:n.valid)!=null?ot:!0;return dt.destroyAll(),dt.confirm({content:G.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!s)},okText:G.t("Confirm"),cancelText:G.t("Cancel")}),t}case i.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:s,imgList:u,step:a}=t;if(!n)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const p=u[s-1].result;if(!p)return t;const c=X.copyResultChange(p,a,(st=u[s].result)!=null?st:"");u[s]=l(o({},u[s]),{result:c});const g=x(c)[`step_${a}`],_=(g==null?void 0:g.result)||[];return n==null||n.setResult(_),n==null||n.history.pushHistory(_),(lt=n==null?void 0:n.asyncData)==null||lt.call(n,u[s]),l(o({},t),{imgList:[...u]})}case i.SET_STEP:{const{stepList:n,annotationEngine:s}=t,{toStep:u}=e.payload;if(s){const a=w(n,u);return s==null||s.setToolName(a.tool,a.config),l(o({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}return l(o({},t),{step:u})}case i.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=e.payload;return l(o({},t),{loadPCDFileLoading:!!n})}case i.SET_LOADING:{const{loading:n}=e.payload;return l(o({},t),{loading:!!n})}case i.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=e.payload;return l(o({},t),{pointCloudLoading:!!n})}case i.SET_CHECK_MODE:{const{checkMode:n}=e.payload;return l(o({},t),{checkMode:!!n})}case i.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=e.payload;return l(o({},t),{highlightAttribute:n})}case i.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=l(o({},_),{result:ct.batchUpdateTrackID({id:n,newID:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),l(o({},t),{imgList:g})}case i.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=l(o({},_),{result:ct.batchUpdateResultByTrackID({id:n,newData:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),l(o({},t),{imgList:g})}case i.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:s,stepList:u,step:a,predictionResult:p}=t,c={};p.forEach(I=>{const{index:E}=I;c[E]=_t.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const L=`step_${a}`,g=[],_=s.map((I,E)=>{if(c[E]){const D=I.result==="{}"?x(Y("",{step:a,stepList:u},{rect:[]},{})):x(I.result);D[L].result.push(c[E]);const P=l(o({},I),{result:JSON.stringify(D)});return g.push({imgIndex:E,newInfo:P}),P}return I});return n==null||n(_,K.BatchUpdateImgList,-1,_,{updateImgList:g}),l(o({},t),{imgList:_})}default:return t}};export{xt as LoadFileAndFileData,Mt as annotationReducer,Vt as composeResultByToolInstance,w as getStepConfig,Ut as getTotalPage};
|
package/es/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import f from"lodash";import{pointCloudLidar2image as
|
|
1
|
+
import f from"lodash";import{pointCloudLidar2image as y}from"@labelbee/lb-annotation";var d=Object.defineProperty,_=Object.defineProperties,x=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,m=(r,t,n)=>t in r?d(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,w=(r,t)=>{for(var n in t||(t={}))O.call(t,n)&&m(r,n,t[n]);if(u)for(var n of u(t))P.call(t,n)&&m(r,n,t[n]);return r},b=(r,t)=>_(r,x(t));const I=(r,t={})=>{try{return typeof r=="string"?JSON.parse(r):f.isObject(r)?r:t}catch(n){return t}},v=r=>{if(Array.isArray(r))return r.filter(t=>t).join(" ");if(f.isObject(r)){const t=[];return Object.keys(r).forEach(n=>{r[n]&&t.push(n)}),t.join(" ")}return""},g=r=>{let t=Infinity,n=Infinity,e=-Infinity,o=-Infinity;for(const i of r)t=Math.min(t,i.x),n=Math.min(n,i.y),e=Math.max(e,i.x),o=Math.max(o,i.y);return{x:t,y:n,width:e-t,height:o-n}},l=(()=>{const r=(t,n)=>{const e=Math.max(t.x,n.x),o=Math.max(t.y,n.y),i=Math.min(t.x+t.width,n.x+n.width),a=Math.min(t.y+t.height,n.y+n.height),s=i-e,c=a-o;return s>=0&&c>=0?{x:e,y:o,width:s,height:c}:null};return(t,n,e)=>{if(e[n]){const o=e[n].width,i=e[n].height;return r(t,{x:0,y:0,width:o,height:i})!==null}return!1}})(),j=r=>{var t;const{pointCloudBox:n,mappingData:e,imageSizes:o}=r,{transferViewData:i}=(t=y(n,e.calib))!=null?t:{};if(!i)return;const a=i.reduce((p,h)=>h.type==="line"?[...p,...h.pointList]:p,[]),s=b(w({},g(a)),{imageName:e.path});if(l(s,e.path,o))return s};export{v as classnames,g as getBoundingRect,j as getRectPointCloudBox,l as isBoundingRectInImage,I as jsonParser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{useRef as d,useState as
|
|
1
|
+
import t,{useRef as d,useState as p}from"react";import{Col as v,Popconfirm as C}from"antd";import{useTranslation as m}from"react-i18next";import{prefix as E}from"../../../../constant/index.js";const y={color:"#CCCCCC"},f=({info:r})=>{const{t:e}=m();return r.key.startsWith("sure")?t.createElement("div",{key:r.key},`${e("ConfirmTo")}${r.name.slice(0)}\uFF1F`):t.createElement("span",null,r.name)},g=({icon:r})=>typeof r=="string"?t.createElement("img",{width:23,height:25,src:r}):r,i=({isHover:r,info:e})=>{const n=!!e.forbidOperation,o=e.key===r&&!n;let a={color:o?"#666fff":""};return n&&(a=y),t.createElement("div",{style:{cursor:n?"not-allowed":"default"},onClick:()=>{var c;return(e==null?void 0:e.forbidConfirm)&&!n&&((c=e==null?void 0:e.onClick)==null?void 0:c.call(e))}},t.createElement("div",{className:"icon"},t.createElement(g,{icon:o?e.hoverSvg:e.imgSvg})),t.createElement("div",{className:"toolName",style:a},e.name))},k=({allOperation:r})=>{const e=d(null),[n,o]=p(null),{t:a}=m(),c=Math.floor(24/r.length);return t.createElement("div",{className:"generalOperation",ref:e},r.map((l,u)=>t.createElement(v,{span:c,key:u,className:"generalOperation-col"},t.createElement("div",{key:l.key,className:"item",onMouseEnter:()=>{o(l.key)},onMouseLeave:()=>{o(null)}},l.forbidConfirm?t.createElement(i,{info:l,isHover:n}):t.createElement(C,{title:t.createElement(f,{info:l}),placement:"topRight",okText:a("Confirm"),cancelText:a("Cancel"),getPopupContainer:()=>{var s;return(s=e.current)!=null?s:document.body},onConfirm:l.onClick,overlayClassName:`${E}-pop-confirm`},t.createElement("div",null,t.createElement(i,{info:l,isHover:n})))))))};export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i,{useState as P,useRef as A,useEffect as S}from"react";import{connect as w}from"react-redux";import I from"../../../../utils/StepUtils.js";import{useTranslation as R}from"react-i18next";import{LabelBeeContext as D}from"../../../../store/ctx.js";import{prefix as b}from"../../../../constant/index.js";import{jsonParser as B,classnames as H}from"../../../../utils/index.js";import{Row as K,Col as h,Popconfirm as k}from"antd";import{CloseOutlined as F}from"@ant-design/icons";import L from"../../../../components/longText/index.js";var U=Object.defineProperty,M=Object.defineProperties,V=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,T=(n,t,e)=>t in n?U(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,G=(n,t)=>{for(var e in t||(t={}))q.call(t,e)&&T(n,e,t[e]);if(C)for(var e of C(t))z.call(t,e)&&T(n,e,t[e]);return n},J=(n,t)=>M(n,V(t));const c=`${b}-sidebar`,Q=(n,t,e)=>{const l=(n==null?void 0:n.attributeList)||[],m=t.map(a=>{var p,o;const _=((o=(p=l.filter(d=>d.value===a.attribute))==null?void 0:p[0])==null?void 0:o.key)||"";return J(G({},a),{label:_})});return(e==null?void 0:e.length)>0?m.filter(a=>e.includes(a.attribute)):m},W=n=>{var t,e,l;const[m,a]=P(0),p=A(null),{toolInstance:o,checkMode:_,stepInfo:d}=n,{t:u}=R(),y=B(d.config),[g,E]=P("");S(()=>(o&&o.on("changeAttributeSidebar",r=>{a(s=>s+1)}),()=>{o==null||o.unbindAll("changeAttributeSidebar")}),[o,p]);const[x]=o.exportData(),O=(e=(t=x==null?void 0:x[0])==null?void 0:t.textAnnotation)!=null?e:[],f=Q(y,O,(l=o==null?void 0:o.attributeLockList)!=null?l:[]),N=r=>{let s=r===g?"":r;o==null||o.setHighlightKey(s),E(s)},j=r=>{o==null||o.deleteTextAnnotation(r.id)};return(f==null?void 0:f.length)===0?null:i.createElement("div",{className:`${c}__content__NLPList`},f.map((r,s)=>{const $=g===r.id;return i.createElement("div",{key:s,className:H({[`${c}__content__NLPList__item`]:!0,[`${c}__content__NLPList__item__active`]:$}),onClick:()=>N(r.id)},i.createElement(K,{className:`${c}__content__NLPList__item__text`},i.createElement(h,{span:7},i.createElement(L,{text:`${r.label}\uFF0C${u("textTool")}: `,openByText:!0,isToolTips:!0})),i.createElement(h,{span:16,offset:1},i.createElement(L,{text:r.text,openByText:!0,isToolTips:!0}))),!_&&i.createElement(k,{title:u("DeleteCommentConfirm"),placement:"topRight",okText:u("Confirm"),cancelText:u("Cancel"),getPopupContainer:v=>v.parentElement,onConfirm:()=>j(r),overlayClassName:`${b}-pop-confirm`},i.createElement(F,{className:`${c}-pop-remove`,onClick:v=>{v.stopPropagation()}})))}))},X=n=>{var t,e;const l=I.getCurrentStepInfo((t=n.annotation)==null?void 0:t.step,(e=n.annotation)==null?void 0:e.stepList);return{toolInstance:n.annotation.toolInstance,stepInfo:l}};var Y=w(X,null,null,{context:D})(W);export{Y as default,c as sidebarCls};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s,{useState as I,useEffect as D}from"react";import{connect as j}from"react-redux";import h from"../../../../utils/StepUtils.js";import{useTranslation as E}from"react-i18next";import{LabelBeeContext as R}from"../../../../store/ctx.js";import{jsonParser as S}from"../../../../utils/index.js";import V from"../../../../components/LLMToolView/sidebar/components/determineGroup/index.js";import{getCurrentResultFromResultList as C}from"../../../../components/LLMToolView/utils/data.js";var T=Object.defineProperty,A=Object.defineProperties,B=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,P=(t,e,n)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,g=(t,e)=>{for(var n in e||(e={}))G.call(e,n)&&P(t,n,e[n]);if(y)for(var n of y(e))H.call(e,n)&&P(t,n,e[n]);return t},M=(t,e)=>A(t,B(e));const U=t=>{const{toolInstance:e,stepInfo:n,disabeledAll:u,imgIndex:d,imgList:p}=t,[_]=e.exportData(),[l,x]=I(_==null?void 0:_[0]),{t:L}=E(),[F,O]=I(0);D(()=>{var o;if(!p[d])return;const r=(o=p[d])!=null?o:{},i=C((r==null?void 0:r.result)||"");x(i)},[d,p]),D(()=>(e&&e.on("changeIndicatorDetermine",o=>{const[r]=e.exportData();x(r==null?void 0:r[0]),O(i=>i+1)}),()=>{e==null||e.unbindAll("changeIndicatorDetermine")}),[e]);const b=S(n.config),{indicatorDetermine:m}=b,w=o=>{var r;const{value:i,key:a}=o;if(a){const f={[a]:i},c=(r=l==null?void 0:l.indicatorDetermine)!=null?r:{},v=M(g({},l),{indicatorDetermine:g(g({},c),f)});e.updateResult(v)}};if((m==null?void 0:m.length)>0){const o=m.filter(r=>r==null?void 0:r.label);return s.createElement("div",{style:{padding:"12px",marginBottom:"12px"}},(o==null?void 0:o.length)>0&&s.createElement("div",null,s.createElement("div",{style:{fontSize:"16px",fontWeight:500,lineHeight:"46px"}},L("IndicatorJudgment")),s.createElement("div",{style:{maxHeight:"400px",overflow:"auto"}},o.map((r,i)=>{var a;const{label:f,value:c}=r;return s.createElement(V,{selectValue:(a=l==null?void 0:l.indicatorDetermine)==null?void 0:a[c],title:f,updateValue:v=>{w({key:c,value:v})},key:i,disabeledAll:u})}))))}return null},k=t=>{var e,n;const u=h.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(n=t.annotation)==null?void 0:n.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:u,imgIndex:t.annotation.imgIndex,imgList:t.annotation.imgList}};var z=j(k,null,null,{context:R})(U);export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{useState as y,useContext as T,useEffect as j}from"react";import{EditFilled as ot}from"@ant-design/icons";import{ToolIcons as nt}from"../ToolIcons.js";import{EToolName as rt}from"../../../../data/enums/ToolType.js";import{cTool as lt}from"@labelbee/lb-annotation";import{PointCloudContext as D}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as h,Input as it,message as I}from"antd";import st from"../../../../utils/StepUtils.js";import{connect as at}from"react-redux";import{jsonParser as ct,classnames as ut}from"../../../../utils/index.js";import{useStatus as $}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as R}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as dt,useDispatch as mt}from"../../../../store/ctx.js";import pt from"./components/batchUpdateModal/index.js";import ft from"./components/annotatedBox/index.js";import gt from"./components/findTrackIDIndex/index.js";import{EPointCloudSegmentStatus as w,EPointCloudPattern as vt}from"@labelbee/lb-utils";import St from"../../../../components/attributeList/index.js";import{useAttribute as bt}from"../../../../components/pointCloudView/hooks/useAttribute.js";import Ct from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import _t from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import Pt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import xt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import Et from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import yt from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as L}from"../index.js";import{SetTaskStepList as It}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as wt}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Lt from"../../../../components/subAttributeList/index.js";var Tt=Object.defineProperty,jt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,z=(o,t,n)=>t in o?Tt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,A=(o,t)=>{for(var n in t||(t={}))ht.call(t,n)&&z(o,n,t[n]);if(U)for(var n of U(t))kt.call(t,n)&&z(o,n,t[n]);return o},V=(o,t)=>jt(o,Dt(t));const At=()=>{const[o,t]=y(!1),n=T(D),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:r}=R(),[u,d]=y(""),{t:g}=k(),p=c==null?void 0:c.info.trackID,s=m=>!!a.find(b=>b.trackID===m&&b.id!==(c==null?void 0:c.info.id)),i=(m=!1)=>{const f=parseInt(u,10);if(m&&t(!1),isNaN(f)){I.error(g("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){I.error(g("NotAllowDecimalPointsInTrackID"));return}if(s(f)){I.error(g("DuplicateTrackIDsExist"));return}if(!(f>0)){I.error(g("PositiveIntegerCheck"));return}S(f)};j(()=>{t(!1)},[p]);const S=m=>{var f;const b=r({trackID:m});(f=n==null?void 0:n.topViewInstance)==null||f.updatePolygonList(b!=null?b:[])};return e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,g("CurrentBoxTrackIDs")),p&&e.createElement(pt,{id:p,updateCurrentPolygonList:m=>S(m)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&p?e.createElement(it,{defaultValue:p,onChange:m=>{d(m.target.value)},disabled:!p,size:"small",onBlur:()=>{i()},onPressEnter:()=>{i(!0)}}):e.createElement("span",null,p),e.createElement(ot,{style:{color:"#999",marginLeft:16,cursor:typeof p!="undefined"?"pointer":"not-allowed"},onClick:()=>{p&&t(!o)}})))},F=({segmentStatus:o,globalPattern:t})=>t===vt.Segmentation&&![w.Edit,w.Ready].includes(o),M=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:r,enableColorPicker:u})=>{const[d,g]=y({segmentStatus:w.Ready}),{selectedBox:p}=R(),s=T(D),{ptSegmentInstance:i}=s,{t:S}=k(),{defaultAttribute:m}=bt(),f=wt(),{isPointCloudSegmentationPattern:b}=$(),J=mt(),W={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};j(()=>{if(!!i)return i.on("syncPointCloudStatus",g),()=>{i.unbind("syncPointCloudStatus",g)}},[i]);const X=(l,C)=>{var _,P,x,B,N;const E=(_=a==null?void 0:a.attributeList)==null?void 0:_.map(v=>v.value===l?V(A({},v),{color:C}):v),O=V(A({},a),{attributeList:E}),tt=JSON.stringify(O),et=c==null?void 0:c.map(v=>(v==null?void 0:v.step)===(r==null?void 0:r.step)?V(A({},v),{config:tt}):v);(P=s==null?void 0:s.topViewInstance)==null||P.updateAttributeList(E),(x=s==null?void 0:s.sideViewInstance)==null||x.updateAttributeList(E),(B=s==null?void 0:s.backViewInstance)==null||B.updateAttributeList(E),(N=s==null?void 0:s.mainViewInstance)==null||N.setConfig(O),J(It({stepList:et}))},Y=l=>{f.updateViewsByDefaultSize&&f.updateViewsByDefaultSize(l)},q=l=>{F({globalPattern:s.globalPattern,segmentStatus:d.segmentStatus})||n.setDefaultAttribute(l)},G=(l,C)=>{F({globalPattern:s.globalPattern,segmentStatus:d.segmentStatus})||n.setSubAttribute(l,C)},K=o.map(l=>({label:l.key,value:l.value,color:l==null?void 0:l.color,limit:l==null?void 0:l.limit,isDefault:l==null?void 0:l.isDefault})),Q=p||d.cacheSegData&&d.segmentStatus===w.Edit,Z=b;return e.createElement("div",{style:{flex:1,overflowX:"hidden",overflowY:"auto"}},e.createElement("div",{style:W},S("Attribute")),e.createElement(St,{list:K,forbidDefault:!0,selectedAttribute:m!=null?m:"",attributeChanged:l=>q(l),updateColorConfig:X,enableColorPicker:u,updateSize:Y,forbidShowLimitPopover:Z}),e.createElement(h,{style:{margin:0}}),Q&&e.createElement(Lt,{subAttributeList:t,setSubAttribute:G,getValue:l=>{var C,_,P,x;return((_=(C=s.selectedPointCloudBox)==null?void 0:C.subAttribute)==null?void 0:_[l.value])||((x=(P=d.cacheSegData)==null?void 0:P.subAttribute)==null?void 0:x[l.value])}}))},Vt=[{toolName:"LassoSelector",commonSvg:Ct,selectedSvg:_t},{toolName:"RectSelector",commonSvg:Et,selectedSvg:yt},{toolName:"CircleSelector",commonSvg:Pt,selectedSvg:xt}],H=({toolInstance:o})=>{const{ptSegmentInstance:t}=T(D),[n,a]=y("LassoSelector"),{t:c}=k();return j(()=>{if(!t)return;const r=()=>{a("LassoSelector")},u=()=>{a("RectSelector")},d=()=>{a("CircleSelector")};return t.on("LassoSelector",r),t.on("RectSelector",u),t.on("CircleSelector",d),()=>{t.unbind("LassoSelector",r),t.unbind("RectSelector",u),t.unbind("CircleSelector",d)}},[t]),e.createElement("div",{className:`${L}__level`},Vt.map(r=>{const u=n===r.toolName;return e.createElement("span",{className:`${L}__toolOption`,key:r.toolName,onClick:()=>t==null?void 0:t.emit(r.toolName)},e.createElement("img",{className:`${L}__singleTool`,src:u?r==null?void 0:r.selectedSvg:r==null?void 0:r.commonSvg}),e.createElement("span",{className:ut({[`${L}__toolOption__selected`]:u})},c(r.toolName)))}))},Bt=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:r})=>{var u,d;const{updatePointCloudPattern:g,pointCloudPattern:p,isPointCloudSegmentationPattern:s}=$(),i=ct(o.config),S=(u=i==null?void 0:i.attributeList)!=null?u:[],m=(i==null?void 0:i.secondaryAttributeConfigurable)===!0?(d=i==null?void 0:i.inputList)!=null?d:[]:[];return s?e.createElement(e.Fragment,null,e.createElement(H,{toolInstance:t}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:m,config:i,stepList:c,stepInfo:o,enableColorPicker:r})):e.createElement(e.Fragment,null,e.createElement(nt,{toolName:lt.EPointCloudName.PointCloud,selectedToolName:p,onChange:f=>g==null?void 0:g(f)}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:m,config:i,stepList:c,stepInfo:o,enableColorPicker:r}),(i==null?void 0:i.trackConfigurable)===!0&&p===rt.Rect&&e.createElement("div",{style:{flexShrink:0,height:280,overflow:"auto"}},e.createElement(At,null),e.createElement(h,{style:{margin:0}}),e.createElement(ft,{imgList:n,imgIndex:a}),e.createElement(h,{style:{margin:0}}),e.createElement(gt,{imgList:n,imgIndex:a})))},Nt=o=>{var t,n,a,c;const r=st.getCurrentStepInfo((t=o.annotation)==null?void 0:t.step,(n=o.annotation)==null?void 0:n.stepList),u=(a=o.annotation)==null?void 0:a.toolInstance,d=(c=o.annotation)==null?void 0:c.stepList;return{stepInfo:r,toolInstance:u,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:d}};var Ot=at(Nt,null,null,{context:dt})(Bt);export{H as PointCloudSegToolIcon,Ot as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.23.0-alpha.
|
|
3
|
+
"version": "1.23.0-alpha.20",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.27.0-alpha.
|
|
47
|
-
"@labelbee/lb-utils": "1.19.0-alpha.
|
|
46
|
+
"@labelbee/lb-annotation": "1.27.0-alpha.10",
|
|
47
|
+
"@labelbee/lb-utils": "1.19.0-alpha.5",
|
|
48
48
|
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"@types/react-transition-group": "^4.4.9",
|