@labelbee/lb-components 1.23.0-alpha.109 → 1.23.0-alpha.110

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/es/index.css CHANGED
@@ -63,6 +63,12 @@
63
63
  justify-content: space-between;
64
64
  margin-top: 16px;
65
65
  }
66
+ .index-module_switchBox__6DlnW {
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: space-between;
70
+ padding: 12px 20px;
71
+ }
66
72
  .dynamic-resizer-content {
67
73
  width: 100%;
68
74
  height: 100%;
package/es/index.js CHANGED
@@ -1 +1 @@
1
- export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";export{default as TextContent}from"./components/NLPToolView/textContent/index.js";import{i18n as s}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import r,{useState as m,useImperativeHandle as u}from"react";import{initReactI18next as f,I18nextProvider as x}from"react-i18next";import{Provider as w}from"react-redux";import P from"./App.js";import v from"./configureStore.js";import{PageBackward as j,PageForward as T,PageJump as S}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as b}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as I}from"./store/ctx.js";export{default as PredictTracking}from"./components/predictTracking/predictTrackingIcon/index.js";export{default as LLMToolView}from"./components/LLMToolView/index.js";export{default as SwitchCuboidBoxIn2DView,SwitchCuboidBoxIn2DViewStateMode}from"./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js";export{default as BatchSwitchConnectIn2DView}from"./views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js";export{default as MeasureCanvas}from"./components/measureCanvas/index.js";export{default as AnnotatedBox}from"./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js";export{default as RectRotateSensitivitySlider}from"./views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js";export{FindTrackIDIndexInCheckMode as FindTrackIDIndex}from"./views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex/index.js";export{WrapAudioPlayer as AudioPlayer}from"./components/audioPlayer/index.js";export{generatePointCloudBoxRects}from"./utils/index.js";export{default as SubAttributeList}from"./components/subAttributeList/index.js";import{ToolStyleProvider as V}from"./hooks/useToolStyle.js";import{LoadFileAndFileData as g}from"./store/annotation/reducer.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var C=Object.defineProperty,_=Object.defineProperties,h=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,p=(o,e,t)=>e in o?C(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,D=(o,e)=>{for(var t in e||(e={}))y.call(e,t)&&p(o,t,e[t]);if(l)for(var t of l(e))A.call(e,t)&&p(o,t,e[t]);return o},L=(o,e)=>_(o,h(e));const n=v();s.use(f),s.options.react={useSuspense:!1};const B=(o,e)=>{const[t,c]=m();return u(e,()=>({toolInstance:t,annotationEngine:n.getState().annotation.annotationEngine,pageBackwardActions:()=>n.dispatch(j()),pageForwardActions:()=>n.dispatch(T()),pageJump:(a,i)=>{const d=~~a-1;n.dispatch(S(d)),i&&n.dispatch(g(d))},hello:()=>alert("hello labelBee!!!")}),[t]),r.createElement(w,{store:n,context:I},r.createElement(x,{i18n:s},r.createElement(V,{value:o.toolStyle},r.createElement(b,null,r.createElement(P,L(D({},o),{setToolInstance:a=>{var i;c(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}}))))))};var E=r.forwardRef(B);export{E as default,n as store};
1
+ export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";export{default as TextContent}from"./components/NLPToolView/textContent/index.js";import{i18n as s}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import r,{useState as m,useImperativeHandle as u}from"react";import{initReactI18next as f,I18nextProvider as x}from"react-i18next";import{Provider as w}from"react-redux";import P from"./App.js";import v from"./configureStore.js";import{PageBackward as j,PageForward as T,PageJump as S}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as b}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as g}from"./store/ctx.js";export{default as PredictTracking}from"./components/predictTracking/predictTrackingIcon/index.js";export{default as LLMToolView}from"./components/LLMToolView/index.js";export{default as SwitchCuboidBoxIn2DView,SwitchCuboidBoxIn2DViewStateMode}from"./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js";export{default as BatchSwitchConnectIn2DView}from"./views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js";export{default as MeasureCanvas}from"./components/measureCanvas/index.js";export{default as AnnotatedBox}from"./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js";export{default as RectRotateSensitivitySlider}from"./views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js";export{FindTrackIDIndexInCheckMode as FindTrackIDIndex}from"./views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex/index.js";export{WrapAudioPlayer as AudioPlayer}from"./components/audioPlayer/index.js";export{generatePointCloudBoxRects}from"./utils/index.js";export{default as SubAttributeList}from"./components/subAttributeList/index.js";import{ToolStyleProvider as C}from"./hooks/useToolStyle.js";import{LoadFileAndFileData as I}from"./store/annotation/reducer.js";export{default as useToolConfigStore}from"./store/toolConfig/index.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var V=Object.defineProperty,_=Object.defineProperties,h=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,p=(o,e,t)=>e in o?V(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,D=(o,e)=>{for(var t in e||(e={}))y.call(e,t)&&p(o,t,e[t]);if(l)for(var t of l(e))A.call(e,t)&&p(o,t,e[t]);return o},L=(o,e)=>_(o,h(e));const n=v();s.use(f),s.options.react={useSuspense:!1};const B=(o,e)=>{const[t,c]=m();return u(e,()=>({toolInstance:t,annotationEngine:n.getState().annotation.annotationEngine,pageBackwardActions:()=>n.dispatch(j()),pageForwardActions:()=>n.dispatch(T()),pageJump:(i,a)=>{const d=~~i-1;n.dispatch(S(d)),a&&n.dispatch(I(d))},hello:()=>alert("hello labelBee!!!")}),[t]),r.createElement(w,{store:n,context:g},r.createElement(x,{i18n:s},r.createElement(C,{value:o.toolStyle},r.createElement(b,null,r.createElement(P,L(D({},o),{setToolInstance:i=>{var a;c(i),(a=o.onLoad)==null||a.call(o,{toolInstance:i})}}))))))};var E=r.forwardRef(B);export{E as default,n as store};
@@ -0,0 +1 @@
1
+ import{create as o}from"zustand";const e=o(t=>({onlyLoadFirstData:!1,setOnlyLoadFirstData:a=>t(s=>({onlyLoadFirstData:a}))}));export{e as default};
@@ -0,0 +1 @@
1
+ import e,{useEffect as i}from"react";import{Switch as c}from"antd";import l from"../../../../../../store/toolConfig/index.js";import{useTranslation as m}from"react-i18next";import a from"./index.module.scss.js";const f=()=>{const{t:o}=m(),{onlyLoadFirstData:s,setOnlyLoadFirstData:t}=l();i(()=>{t(!1)},[]);const r=n=>{t(n)};return e.createElement("div",{className:a.switchBox},e.createElement("div",{className:a.switchLabel},o("OnlyLoadTheFirstFramePreAnnotation")),e.createElement(c,{defaultChecked:!1,checked:s,onChange:r}))};export{f as default};
@@ -0,0 +1 @@
1
+ var e={switchBox:"index-module_switchBox__6DlnW"};export{e as default};
@@ -1 +1 @@
1
- import e,{useState as P,useContext as j,useEffect as I}from"react";import{EditFilled as ot}from"@ant-design/icons";import{ToolIcons as nt}from"../ToolIcons.js";import{EToolName as lt}from"../../../../data/enums/ToolType.js";import{cTool as rt}from"@labelbee/lb-annotation";import{PointCloudContext as h}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as w,Input as it,message as D}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 R}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as $}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as mt,useDispatch as dt}from"../../../../store/ctx.js";import pt from"./components/batchUpdateModal/index.js";import ft from"./components/annotatedBox/index.js";import vt from"./components/rectRotateSensitivitySlider/index.js";import gt from"./components/findTrackIDIndex/index.js";import{EPointCloudSegmentStatus as L,EPointCloudPattern as St}from"@labelbee/lb-utils";import bt from"../../../../components/attributeList/index.js";import{useAttribute as Ct}from"../../../../components/pointCloudView/hooks/useAttribute.js";import _t from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import yt from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import Et from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import xt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import Pt from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import wt from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as T}from"../index.js";import{SetTaskStepList as Dt}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as Lt}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Tt from"../../../../components/subAttributeList/index.js";import jt from"../../../../components/DynamicResizer/DynamicResizer.js";var It=Object.defineProperty,ht=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable,U=(o,t,n)=>t in o?It(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,A=(o,t)=>{for(var n in t||(t={}))At.call(t,n)&&U(o,n,t[n]);if(z)for(var n of z(t))Vt.call(t,n)&&U(o,n,t[n]);return o},V=(o,t)=>ht(o,kt(t));const Bt=()=>{const[o,t]=P(!1),n=j(h),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:l}=$(),[u,m]=P(""),{t:v}=k(),p=c==null?void 0:c.info.trackID,s=d=>!!a.find(b=>b.trackID===d&&b.id!==(c==null?void 0:c.info.id)),i=(d=!1)=>{const f=parseInt(u,10);if(d&&t(!1),isNaN(f)){D.error(v("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){D.error(v("NotAllowDecimalPointsInTrackID"));return}if(s(f)){D.error(v("DuplicateTrackIDsExist"));return}if(!(f>0)){D.error(v("PositiveIntegerCheck"));return}S(f)};I(()=>{t(!1)},[p]);const S=d=>{var f;const b=l({trackID:d});(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,v("CurrentBoxTrackIDs")),p&&e.createElement(pt,{id:p,updateCurrentPolygonList:d=>S(d)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&p?e.createElement(it,{defaultValue:p,onChange:d=>{m(d.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===St.Segmentation&&![L.Edit,L.Ready].includes(o),H=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:l,enableColorPicker:u})=>{const[m,v]=P({segmentStatus:L.Ready}),{selectedBox:p}=$(),s=j(h),{ptSegmentInstance:i}=s,{t:S}=k(),{defaultAttribute:d}=Ct(),f=Lt(),{isPointCloudSegmentationPattern:b}=R(),W=dt(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};I(()=>{if(!!i)return i.on("syncPointCloudStatus",v),()=>{i.unbind("syncPointCloudStatus",v)}},[i]);const K=(r,C)=>{var _,y,E,B,N;const x=(_=a==null?void 0:a.attributeList)==null?void 0:_.map(g=>g.value===r?V(A({},g),{color:C}):g),O=V(A({},a),{attributeList:x}),tt=JSON.stringify(O),et=c==null?void 0:c.map(g=>(g==null?void 0:g.step)===(l==null?void 0:l.step)?V(A({},g),{config:tt}):g);(y=s==null?void 0:s.topViewInstance)==null||y.updateAttributeList(x),(E=s==null?void 0:s.sideViewInstance)==null||E.updateAttributeList(x),(B=s==null?void 0:s.backViewInstance)==null||B.updateAttributeList(x),(N=s==null?void 0:s.mainViewInstance)==null||N.setConfig(O),W(Dt({stepList:et}))},X=r=>{f.updateViewsByDefaultSize&&f.updateViewsByDefaultSize(r)},Y=r=>{F({globalPattern:s.globalPattern,segmentStatus:m.segmentStatus})||n.setDefaultAttribute(r)},q=(r,C)=>{F({globalPattern:s.globalPattern,segmentStatus:m.segmentStatus})||n.setSubAttribute(r,C)},G=o.map(r=>({label:r.key,value:r.value,color:r==null?void 0:r.color,limit:r==null?void 0:r.limit,isDefault:r==null?void 0:r.isDefault})),Q=p||m.cacheSegData&&m.segmentStatus===L.Edit,Z=b;return e.createElement("div",{style:{height:"100%",overflow:"auto",display:"flex",flexDirection:"column"}},e.createElement("div",{style:J},S("Attribute")),e.createElement("div",{style:{height:0,flex:1,overflowY:"auto",overflowX:"hidden"}},e.createElement(bt,{list:G,forbidDefault:!0,selectedAttribute:d!=null?d:"",attributeChanged:r=>Y(r),updateColorConfig:K,enableColorPicker:u,updateSize:X,forbidShowLimitPopover:Z}),e.createElement(w,{style:{margin:0}}),Q&&e.createElement(Tt,{subAttributeList:t,setSubAttribute:q,getValue:r=>{var C,_,y,E;return((_=(C=s.selectedPointCloudBox)==null?void 0:C.subAttribute)==null?void 0:_[r.value])||((E=(y=m.cacheSegData)==null?void 0:y.subAttribute)==null?void 0:E[r.value])}})))},Nt=[{toolName:"LassoSelector",commonSvg:_t,selectedSvg:yt},{toolName:"RectSelector",commonSvg:Pt,selectedSvg:wt},{toolName:"CircleSelector",commonSvg:Et,selectedSvg:xt}],M=({toolInstance:o})=>{const{ptSegmentInstance:t}=j(h),[n,a]=P("LassoSelector"),{t:c}=k();return I(()=>{if(!t)return;const l=()=>{a("LassoSelector")},u=()=>{a("RectSelector")},m=()=>{a("CircleSelector")};return t.on("LassoSelector",l),t.on("RectSelector",u),t.on("CircleSelector",m),()=>{t.unbind("LassoSelector",l),t.unbind("RectSelector",u),t.unbind("CircleSelector",m)}},[t]),e.createElement("div",{className:`${T}__level`},Nt.map(l=>{const u=n===l.toolName;return e.createElement("span",{className:`${T}__toolOption`,key:l.toolName,onClick:()=>t==null?void 0:t.emit(l.toolName)},e.createElement("img",{className:`${T}__singleTool`,src:u?l==null?void 0:l.selectedSvg:l==null?void 0:l.commonSvg}),e.createElement("span",{className:ut({[`${T}__toolOption__selected`]:u})},c(l.toolName)))}))},Ot=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:l})=>{var u,m;const{updatePointCloudPattern:v,pointCloudPattern:p,isPointCloudSegmentationPattern:s}=R(),i=ct(o.config),S=(u=i==null?void 0:i.attributeList)!=null?u:[],d=(i==null?void 0:i.secondaryAttributeConfigurable)===!0?(m=i==null?void 0:i.inputList)!=null?m:[]:[];return s?e.createElement(e.Fragment,null,e.createElement(M,{toolInstance:t}),e.createElement(H,{toolInstance:t,attributeList:S,subAttributeList:d,config:i,stepList:c,stepInfo:o,enableColorPicker:l})):e.createElement(e.Fragment,null,e.createElement(nt,{toolName:rt.EPointCloudName.PointCloud,selectedToolName:p,onChange:f=>v==null?void 0:v(f)}),e.createElement("div",{style:{flex:1,overflow:"hidden"}},e.createElement(jt,{minTopHeight:42,defaultHeight:400,localKey:"id:"+(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(H,{toolInstance:t,attributeList:S,subAttributeList:d,config:i,stepList:c,stepInfo:o,enableColorPicker:l}),(i==null?void 0:i.trackConfigurable)===!0&&p===lt.Rect?e.createElement("div",{style:{height:"100%",overflow:"auto"}},e.createElement(Bt,null),e.createElement(w,{style:{margin:0}}),e.createElement(ft,{imgList:n,imgIndex:a}),e.createElement(w,{style:{margin:0}}),e.createElement(gt,{imgList:n,imgIndex:a}),e.createElement(w,{style:{margin:0}}),e.createElement(vt,null)):e.createElement("div",null))))},Rt=o=>{var t,n,a,c;const l=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,m=(c=o.annotation)==null?void 0:c.stepList;return{stepInfo:l,toolInstance:u,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:m}};var $t=at(Rt,null,null,{context:mt})(Ot);export{M as PointCloudSegToolIcon,$t as default};
1
+ import e,{useState as P,useContext as L,useEffect as T}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 I}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as w,Input as it,message as D}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 R}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as $}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as mt,useDispatch as dt}from"../../../../store/ctx.js";import pt from"./components/batchUpdateModal/index.js";import ft from"./components/annotatedBox/index.js";import vt from"./components/rectRotateSensitivitySlider/index.js";import gt from"./components/findTrackIDIndex/index.js";import St from"./components/firstFrameDataSwitch/index.js";import{EPointCloudSegmentStatus as h,EPointCloudPattern as bt}from"@labelbee/lb-utils";import Ct from"../../../../components/attributeList/index.js";import{useAttribute as _t}from"../../../../components/pointCloudView/hooks/useAttribute.js";import yt from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import Et from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import xt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import Pt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import wt from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import Dt from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as j}from"../index.js";import{SetTaskStepList as ht}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as jt}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Lt from"../../../../components/subAttributeList/index.js";import Tt from"../../../../components/DynamicResizer/DynamicResizer.js";var It=Object.defineProperty,kt=Object.defineProperties,At=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,F=(o,t,n)=>t in o?It(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,A=(o,t)=>{for(var n in t||(t={}))Vt.call(t,n)&&F(o,n,t[n]);if(z)for(var n of z(t))Bt.call(t,n)&&F(o,n,t[n]);return o},V=(o,t)=>kt(o,At(t));const Nt=()=>{const[o,t]=P(!1),n=L(I),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:r}=$(),[u,m]=P(""),{t:v}=k(),p=c==null?void 0:c.info.trackID,s=d=>!!a.find(b=>b.trackID===d&&b.id!==(c==null?void 0:c.info.id)),i=(d=!1)=>{const f=parseInt(u,10);if(d&&t(!1),isNaN(f)){D.error(v("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){D.error(v("NotAllowDecimalPointsInTrackID"));return}if(s(f)){D.error(v("DuplicateTrackIDsExist"));return}if(!(f>0)){D.error(v("PositiveIntegerCheck"));return}S(f)};T(()=>{t(!1)},[p]);const S=d=>{var f;const b=r({trackID:d});(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,v("CurrentBoxTrackIDs")),p&&e.createElement(pt,{id:p,updateCurrentPolygonList:d=>S(d)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&p?e.createElement(it,{defaultValue:p,onChange:d=>{m(d.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)}})))},U=({segmentStatus:o,globalPattern:t})=>t===bt.Segmentation&&![h.Edit,h.Ready].includes(o),H=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:r,enableColorPicker:u})=>{const[m,v]=P({segmentStatus:h.Ready}),{selectedBox:p}=$(),s=L(I),{ptSegmentInstance:i}=s,{t:S}=k(),{defaultAttribute:d}=_t(),f=jt(),{isPointCloudSegmentationPattern:b}=R(),W=dt(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};T(()=>{if(!!i)return i.on("syncPointCloudStatus",v),()=>{i.unbind("syncPointCloudStatus",v)}},[i]);const K=(l,C)=>{var _,y,E,B,N;const x=(_=a==null?void 0:a.attributeList)==null?void 0:_.map(g=>g.value===l?V(A({},g),{color:C}):g),O=V(A({},a),{attributeList:x}),tt=JSON.stringify(O),et=c==null?void 0:c.map(g=>(g==null?void 0:g.step)===(r==null?void 0:r.step)?V(A({},g),{config:tt}):g);(y=s==null?void 0:s.topViewInstance)==null||y.updateAttributeList(x),(E=s==null?void 0:s.sideViewInstance)==null||E.updateAttributeList(x),(B=s==null?void 0:s.backViewInstance)==null||B.updateAttributeList(x),(N=s==null?void 0:s.mainViewInstance)==null||N.setConfig(O),W(ht({stepList:et}))},X=l=>{f.updateViewsByDefaultSize&&f.updateViewsByDefaultSize(l)},Y=l=>{U({globalPattern:s.globalPattern,segmentStatus:m.segmentStatus})||n.setDefaultAttribute(l)},q=(l,C)=>{U({globalPattern:s.globalPattern,segmentStatus:m.segmentStatus})||n.setSubAttribute(l,C)},G=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||m.cacheSegData&&m.segmentStatus===h.Edit,Z=b;return e.createElement("div",{style:{height:"100%",overflow:"auto",display:"flex",flexDirection:"column"}},e.createElement("div",{style:J},S("Attribute")),e.createElement("div",{style:{height:0,flex:1,overflowY:"auto",overflowX:"hidden"}},e.createElement(Ct,{list:G,forbidDefault:!0,selectedAttribute:d!=null?d:"",attributeChanged:l=>Y(l),updateColorConfig:K,enableColorPicker:u,updateSize:X,forbidShowLimitPopover:Z}),e.createElement(w,{style:{margin:0}}),Q&&e.createElement(Lt,{subAttributeList:t,setSubAttribute:q,getValue:l=>{var C,_,y,E;return((_=(C=s.selectedPointCloudBox)==null?void 0:C.subAttribute)==null?void 0:_[l.value])||((E=(y=m.cacheSegData)==null?void 0:y.subAttribute)==null?void 0:E[l.value])}})))},Ot=[{toolName:"LassoSelector",commonSvg:yt,selectedSvg:Et},{toolName:"RectSelector",commonSvg:wt,selectedSvg:Dt},{toolName:"CircleSelector",commonSvg:xt,selectedSvg:Pt}],M=({toolInstance:o})=>{const{ptSegmentInstance:t}=L(I),[n,a]=P("LassoSelector"),{t:c}=k();return T(()=>{if(!t)return;const r=()=>{a("LassoSelector")},u=()=>{a("RectSelector")},m=()=>{a("CircleSelector")};return t.on("LassoSelector",r),t.on("RectSelector",u),t.on("CircleSelector",m),()=>{t.unbind("LassoSelector",r),t.unbind("RectSelector",u),t.unbind("CircleSelector",m)}},[t]),e.createElement("div",{className:`${j}__level`},Ot.map(r=>{const u=n===r.toolName;return e.createElement("span",{className:`${j}__toolOption`,key:r.toolName,onClick:()=>t==null?void 0:t.emit(r.toolName)},e.createElement("img",{className:`${j}__singleTool`,src:u?r==null?void 0:r.selectedSvg:r==null?void 0:r.commonSvg}),e.createElement("span",{className:ut({[`${j}__toolOption__selected`]:u})},c(r.toolName)))}))},Rt=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:r})=>{var u,m;const{updatePointCloudPattern:v,pointCloudPattern:p,isPointCloudSegmentationPattern:s}=R(),i=ct(o.config),S=(u=i==null?void 0:i.attributeList)!=null?u:[],d=(i==null?void 0:i.secondaryAttributeConfigurable)===!0?(m=i==null?void 0:i.inputList)!=null?m:[]:[];return s?e.createElement(e.Fragment,null,e.createElement(M,{toolInstance:t}),e.createElement(H,{toolInstance:t,attributeList:S,subAttributeList:d,config:i,stepList:c,stepInfo:o,enableColorPicker:r})):e.createElement(e.Fragment,null,e.createElement(nt,{toolName:lt.EPointCloudName.PointCloud,selectedToolName:p,onChange:f=>v==null?void 0:v(f)}),e.createElement("div",{style:{flex:1,overflow:"hidden"}},e.createElement(Tt,{minTopHeight:42,defaultHeight:400,localKey:"id:"+(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(H,{toolInstance:t,attributeList:S,subAttributeList:d,config:i,stepList:c,stepInfo:o,enableColorPicker:r}),(i==null?void 0:i.trackConfigurable)===!0&&p===rt.Rect?e.createElement("div",{style:{height:"100%",overflow:"auto"}},e.createElement(Nt,null),e.createElement(w,{style:{margin:0}}),e.createElement(ft,{imgList:n,imgIndex:a}),e.createElement(w,{style:{margin:0}}),e.createElement(gt,{imgList:n,imgIndex:a}),e.createElement(w,{style:{margin:0}}),e.createElement(vt,null),o.loadPreStep>0&&e.createElement(St,null)):e.createElement("div",null))))},$t=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,m=(c=o.annotation)==null?void 0:c.stepList;return{stepInfo:r,toolInstance:u,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:m}};var zt=at($t,null,null,{context:mt})(Rt);export{M as PointCloudSegToolIcon,zt as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.23.0-alpha.109",
3
+ "version": "1.23.0-alpha.110",
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.51",
47
- "@labelbee/lb-utils": "1.19.0-alpha.21",
46
+ "@labelbee/lb-annotation": "1.27.0-alpha.52",
47
+ "@labelbee/lb-utils": "1.19.0-alpha.22",
48
48
  "@labelbee/wavesurfer": "1.1.0-alpha.1",
49
49
  "@types/react-dom": "^18.2.7",
50
50
  "@types/react-transition-group": "^4.4.9",