@labelbee/lb-components 1.24.0-alpha.2 → 1.24.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.
Files changed (108) hide show
  1. package/dist/_virtual/2DViewWorker.js +1 -1
  2. package/dist/assets/annotation/rectTool/three_points_rect.svg.js +1 -0
  3. package/dist/assets/annotation/rectTool/two_points_rect.svg.js +1 -0
  4. package/dist/components/DynamicResizer/DynamicResizer.js +1 -1
  5. package/dist/components/DynamicResizer/hooks/useDrag.js +1 -1
  6. package/dist/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
  7. package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
  8. package/dist/components/DynamicResizer/utils/index.js +1 -0
  9. package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -1
  10. package/dist/components/LLMMultiWheelView/index.js +1 -1
  11. package/dist/components/LLMMultiWheelView/sidebar/index.js +1 -1
  12. package/dist/components/LLMToolView/index.js +1 -1
  13. package/dist/components/LLMToolView/questionView/components/audioView/index.js +1 -0
  14. package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
  15. package/dist/components/LLMToolView/questionView/index.js +1 -1
  16. package/dist/components/attributeList/index.js +1 -1
  17. package/dist/components/audioAnnotate/index.js +1 -1
  18. package/dist/components/audioAnnotate/textInput/index.js +1 -1
  19. package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  20. package/dist/components/audioPlayer/index.js +1 -1
  21. package/dist/components/longText/index.js +1 -1
  22. package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
  23. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  24. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  25. package/dist/components/pointCloudView/PointCloudListener.js +1 -1
  26. package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
  27. package/dist/components/pointCloudView/components/UnifyParamsModal/index.js +1 -1
  28. package/dist/components/pointCloudView/hooks/usePointCloudAttribute.js +1 -0
  29. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  30. package/dist/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -1
  31. package/dist/components/pointCloudView/index.js +1 -1
  32. package/dist/components/tagList/index.js +1 -1
  33. package/dist/constant/index.js +1 -1
  34. package/dist/index.css +116 -89
  35. package/dist/store/annotation/actionCreators.js +1 -1
  36. package/dist/store/annotation/reducer.js +1 -1
  37. package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +3 -3
  38. package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +24 -7
  39. package/dist/types/components/DynamicResizer/hooks/useDraggingAllowed.d.ts +12 -0
  40. package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +10 -21
  41. package/dist/types/components/DynamicResizer/types/interface.d.ts +14 -6
  42. package/dist/types/components/DynamicResizer/utils/index.d.ts +4 -0
  43. package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +2 -0
  44. package/dist/types/components/LLMMultiWheelView/index.d.ts +2 -0
  45. package/dist/types/components/LLMToolView/questionView/components/audioView/index.d.ts +8 -0
  46. package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +3 -1
  47. package/dist/types/components/longText/index.d.ts +1 -1
  48. package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +0 -1
  49. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +2 -0
  50. package/dist/types/components/pointCloudView/hooks/usePointCloudAttribute.d.ts +3 -0
  51. package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +1 -2
  52. package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +1 -2
  53. package/dist/types/constant/index.d.ts +2 -1
  54. package/dist/types/store/annotation/actionCreators.d.ts +1 -1
  55. package/dist/types/store/annotation/map.d.ts +1 -0
  56. package/dist/types/store/annotation/reducer.d.ts +4 -0
  57. package/dist/types/store/annotation/types.d.ts +3 -2
  58. package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -1
  59. package/dist/views/MainView/LLMMultiWheelLayout/index.js +1 -1
  60. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  61. package/dist/views/MainView/sidebar/ToolIcons.js +1 -1
  62. package/es/_virtual/2DViewWorker.js +1 -1
  63. package/es/assets/annotation/rectTool/three_points_rect.svg.js +1 -0
  64. package/es/assets/annotation/rectTool/two_points_rect.svg.js +1 -0
  65. package/es/components/DynamicResizer/DynamicResizer.js +1 -1
  66. package/es/components/DynamicResizer/hooks/useDrag.js +1 -1
  67. package/es/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
  68. package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
  69. package/es/components/DynamicResizer/utils/index.js +1 -0
  70. package/es/components/LLMMultiWheelView/dialogView/index.js +1 -1
  71. package/es/components/LLMMultiWheelView/index.js +1 -1
  72. package/es/components/LLMMultiWheelView/sidebar/index.js +1 -1
  73. package/es/components/LLMToolView/index.js +1 -1
  74. package/es/components/LLMToolView/questionView/components/audioView/index.js +1 -0
  75. package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
  76. package/es/components/LLMToolView/questionView/index.js +1 -1
  77. package/es/components/attributeList/index.js +1 -1
  78. package/es/components/audioAnnotate/index.js +1 -1
  79. package/es/components/audioAnnotate/textInput/index.js +1 -1
  80. package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  81. package/es/components/audioPlayer/index.js +1 -1
  82. package/es/components/longText/index.js +1 -1
  83. package/es/components/pointCloudView/PointCloud2DView.js +1 -1
  84. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  85. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  86. package/es/components/pointCloudView/PointCloudListener.js +1 -1
  87. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  88. package/es/components/pointCloudView/components/UnifyParamsModal/index.js +1 -1
  89. package/es/components/pointCloudView/hooks/usePointCloudAttribute.js +1 -0
  90. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  91. package/es/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -1
  92. package/es/components/pointCloudView/index.js +1 -1
  93. package/es/components/tagList/index.js +1 -1
  94. package/es/constant/index.js +1 -1
  95. package/es/index.css +116 -89
  96. package/es/store/annotation/actionCreators.js +1 -1
  97. package/es/store/annotation/reducer.js +1 -1
  98. package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -1
  99. package/es/views/MainView/LLMMultiWheelLayout/index.js +1 -1
  100. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  101. package/es/views/MainView/sidebar/ToolIcons.js +1 -1
  102. package/package.json +6 -6
  103. package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
  104. package/dist/components/DynamicResizer/assets/divider.svg.js +0 -1
  105. package/dist/components/DynamicResizer/assets/topToZero.svg.js +0 -1
  106. package/es/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
  107. package/es/components/DynamicResizer/assets/divider.svg.js +0 -1
  108. package/es/components/DynamicResizer/assets/topToZero.svg.js +0 -1
@@ -1 +1 @@
1
- import e,{useState as y,useContext as I,useEffect as L}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 it}from"@labelbee/lb-annotation";import{PointCloudContext as T}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as w,Input as rt,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 B}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 bt from"./components/selectBoxVisibleSwitch/index.js";import{EPointCloudSegmentStatus as h,EPointCloudPattern as Ct}from"@labelbee/lb-utils";import xt from"../../../../components/attributeList/index.js";import{useAttribute as Et}from"../../../../components/pointCloudView/hooks/useAttribute.js";import Pt from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import _t from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import yt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import wt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import Dt from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import ht from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as j}from"../index.js";import{SetTaskStepList as jt}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as It}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Lt from"../../../../components/subAttributeList/index.js";import Tt from"../../../../components/DynamicResizer/DynamicResizer.js";var Bt=Object.defineProperty,Vt=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,F=(o,t,n)=>t in o?Bt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,V=(o,t)=>{for(var n in t||(t={}))At.call(t,n)&&F(o,n,t[n]);if(z)for(var n of z(t))Nt.call(t,n)&&F(o,n,t[n]);return o},k=(o,t)=>Vt(o,kt(t));const Ot=()=>{const[o,t]=y(!1),n=I(T),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:l}=$(),[u,m]=y(""),{t:v}=B(),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)),r=(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)};L(()=>{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:[]),n.mainViewInstance&&n.selectedPointCloudBox&&(n==null||n.mainViewInstance.generateBox(n==null?void 0:n.selectedPointCloudBox))};return e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,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(rt,{defaultValue:p,onChange:d=>{m(d.target.value)},disabled:!p,size:"small",onBlur:()=>{r()},onPressEnter:()=>{r(!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===Ct.Segmentation&&![h.Edit,h.Ready].includes(o),H=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:l,enableColorPicker:u})=>{const[m,v]=y({segmentStatus:h.Ready}),{selectedBox:p}=$(),s=I(T),{ptSegmentInstance:r}=s,{t:S}=B(),{defaultAttribute:d}=Et(),f=It(),{isPointCloudSegmentationPattern:b}=R(),W=dt(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};L(()=>{if(!!r)return r.on("syncPointCloudStatus",v),()=>{r.unbind("syncPointCloudStatus",v)}},[r]);const K=(i,C)=>{var x,E,P,A,N;const _=(x=a==null?void 0:a.attributeList)==null?void 0:x.map(g=>g.value===i?k(V({},g),{color:C}):g),O=k(V({},a),{attributeList:_}),tt=JSON.stringify(O),et=c==null?void 0:c.map(g=>(g==null?void 0:g.step)===(l==null?void 0:l.step)?k(V({},g),{config:tt}):g);(E=s==null?void 0:s.topViewInstance)==null||E.updateAttributeList(_),(P=s==null?void 0:s.sideViewInstance)==null||P.updateAttributeList(_),(A=s==null?void 0:s.backViewInstance)==null||A.updateAttributeList(_),(N=s==null?void 0:s.mainViewInstance)==null||N.setConfig(O),W(jt({stepList:et}))},X=i=>{f.updateViewsByDefaultSize&&f.updateViewsByDefaultSize(i)},Y=i=>{U({globalPattern:s.globalPattern,segmentStatus:m.segmentStatus})||n.setDefaultAttribute(i)},q=(i,C)=>{U({globalPattern:s.globalPattern,segmentStatus:m.segmentStatus})||n.setSubAttribute(i,C)},G=o.map(i=>({label:i.key,value:i.value,color:i==null?void 0:i.color,limit:i==null?void 0:i.limit,isDefault:i==null?void 0:i.isDefault})),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(xt,{list:G,forbidDefault:!0,selectedAttribute:d!=null?d:"",attributeChanged:i=>Y(i),updateColorConfig:K,enableColorPicker:u,updateSize:X,forbidShowLimitPopover:Z}),e.createElement(w,{style:{margin:0}}),Q&&e.createElement(Lt,{subAttributeList:t,setSubAttribute:q,getValue:i=>{var C,x,E,P;return((x=(C=s.selectedPointCloudBox)==null?void 0:C.subAttribute)==null?void 0:x[i.value])||((P=(E=m.cacheSegData)==null?void 0:E.subAttribute)==null?void 0:P[i.value])}})))},Rt=[{toolName:"LassoSelector",commonSvg:Pt,selectedSvg:_t},{toolName:"RectSelector",commonSvg:Dt,selectedSvg:ht},{toolName:"CircleSelector",commonSvg:yt,selectedSvg:wt}],M=({toolInstance:o})=>{const{ptSegmentInstance:t}=I(T),[n,a]=y("LassoSelector"),{t:c}=B();return L(()=>{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:`${j}__level`},Rt.map(l=>{const u=n===l.toolName;return e.createElement("span",{className:`${j}__toolOption`,key:l.toolName,onClick:()=>t==null?void 0:t.emit(l.toolName)},e.createElement("img",{className:`${j}__singleTool`,src:u?l==null?void 0:l.selectedSvg:l==null?void 0:l.commonSvg}),e.createElement("span",{className:ut({[`${j}__toolOption__selected`]:u})},c(l.toolName)))}))},$t=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:l})=>{var u,m;const{updatePointCloudPattern:v,pointCloudPattern:p,isPointCloudSegmentationPattern:s}=R(),r=ct(o.config),S=(u=r==null?void 0:r.attributeList)!=null?u:[],d=(r==null?void 0:r.secondaryAttributeConfigurable)===!0?(m=r==null?void 0:r.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:r,stepList:c,stepInfo:o,enableColorPicker:l})):e.createElement(e.Fragment,null,e.createElement(nt,{toolName:it.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:r,stepList:c,stepInfo:o,enableColorPicker:l}),(r==null?void 0:r.trackConfigurable)===!0&&p===lt.Rect?e.createElement("div",{style:{height:"100%",overflow:"auto"}},e.createElement(Ot,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(bt,null)):e.createElement("div",null))))},zt=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 Ft=at(zt,null,null,{context:mt})($t);export{M as PointCloudSegToolIcon,Ft as default};
1
+ import e,{useState as w,useContext as T,useMemo as ot,useEffect as L}from"react";import{EditFilled as nt}from"@ant-design/icons";import{ToolIcons as it}from"../ToolIcons.js";import{EToolName as lt}from"../../../../data/enums/ToolType.js";import{cTool as rt}from"@labelbee/lb-annotation";import{PointCloudContext as B}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as D,Input as st,message as h}from"antd";import at from"../../../../utils/StepUtils.js";import{connect as ct}from"react-redux";import{jsonParser as ut,classnames as mt}from"../../../../utils/index.js";import{useStatus as $}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as z}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as dt,useDispatch as pt}from"../../../../store/ctx.js";import ft from"./components/batchUpdateModal/index.js";import vt from"./components/annotatedBox/index.js";import gt from"./components/rectRotateSensitivitySlider/index.js";import St from"./components/findTrackIDIndex/index.js";import bt from"./components/firstFrameDataSwitch/index.js";import Ct from"./components/selectBoxVisibleSwitch/index.js";import{EPointCloudSegmentStatus as j,EPointCloudPattern as xt}from"@labelbee/lb-utils";import Et from"../../../../components/attributeList/index.js";import{useAttribute as Pt}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 wt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import Dt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import ht from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import jt from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as I}from"../index.js";import{SetTaskStepList as It}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as Tt}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Lt from"../../../../components/subAttributeList/index.js";import Bt from"../../../../components/DynamicResizer/DynamicResizer.js";import{isNumber as kt}from"lodash";var Vt=Object.defineProperty,At=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,U=(o,t,n)=>t in o?Vt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,V=(o,t)=>{for(var n in t||(t={}))Ot.call(t,n)&&U(o,n,t[n]);if(F)for(var n of F(t))Rt.call(t,n)&&U(o,n,t[n]);return o},A=(o,t)=>At(o,Nt(t));const $t=()=>{const[o,t]=w(!1),n=T(B),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:i}=z(),[u,m]=w(""),{t:f}=k(),p=c==null?void 0:c.info.trackID,r=ot(()=>kt(p)&&p>=0,[p]),s=d=>!!a.find(C=>C.trackID===d&&C.id!==(c==null?void 0:c.info.id)),b=(d=!1)=>{const v=parseInt(u,10);if(d&&t(!1),isNaN(v)){h.error(f("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){h.error(f("NotAllowDecimalPointsInTrackID"));return}if(s(v)){h.error(f("DuplicateTrackIDsExist"));return}if(!(v>0)){h.error(f("PositiveIntegerCheck"));return}g(v)};L(()=>{t(!1)},[p]);const g=d=>{var v;const C=i({trackID:d});(v=n==null?void 0:n.topViewInstance)==null||v.updatePolygonList(C!=null?C:[]),n.mainViewInstance&&n.selectedPointCloudBox&&(n==null||n.mainViewInstance.generateBox(n==null?void 0:n.selectedPointCloudBox))};return e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,f("CurrentBoxTrackIDs")),r&&e.createElement(ft,{id:p,updateCurrentPolygonList:d=>g(d)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&r?e.createElement(st,{defaultValue:p,onChange:d=>{m(d.target.value)},disabled:!r,size:"small",onBlur:()=>{b()},onPressEnter:()=>{b(!0)}}):e.createElement("span",null,p),e.createElement(nt,{style:{color:"#999",marginLeft:16,cursor:typeof p!="undefined"?"pointer":"not-allowed"},onClick:()=>{r&&t(!o)}})))},H=({segmentStatus:o,globalPattern:t})=>t===xt.Segmentation&&![j.Edit,j.Ready].includes(o),M=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:i,enableColorPicker:u})=>{const[m,f]=w({segmentStatus:j.Ready}),{selectedBox:p}=z(),r=T(B),{ptSegmentInstance:s}=r,{t:b}=k(),{defaultAttribute:g}=Pt(),d=Tt(),{isPointCloudSegmentationPattern:v}=$(),C=pt(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};L(()=>{if(!!s)return s.on("syncPointCloudStatus",f),()=>{s.unbind("syncPointCloudStatus",f)}},[s]);const K=(l,x)=>{var E,P,_,N,O;const y=(E=a==null?void 0:a.attributeList)==null?void 0:E.map(S=>S.value===l?A(V({},S),{color:x}):S),R=A(V({},a),{attributeList:y}),tt=JSON.stringify(R),et=c==null?void 0:c.map(S=>(S==null?void 0:S.step)===(i==null?void 0:i.step)?A(V({},S),{config:tt}):S);(P=r==null?void 0:r.topViewInstance)==null||P.updateAttributeList(y),(_=r==null?void 0:r.sideViewInstance)==null||_.updateAttributeList(y),(N=r==null?void 0:r.backViewInstance)==null||N.updateAttributeList(y),(O=r==null?void 0:r.mainViewInstance)==null||O.setConfig(R),C(It({stepList:et}))},X=l=>{d.updateViewsByDefaultSize&&d.updateViewsByDefaultSize(l)},Y=l=>{H({globalPattern:r.globalPattern,segmentStatus:m.segmentStatus})||n.setDefaultAttribute(l)},q=(l,x)=>{H({globalPattern:r.globalPattern,segmentStatus:m.segmentStatus})||n.setSubAttribute(l,x)},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===j.Edit,Z=v;return e.createElement("div",{style:{height:"100%",overflow:"auto",display:"flex",flexDirection:"column"}},e.createElement("div",{style:J},b("Attribute")),e.createElement("div",{style:{height:0,flex:1,overflowY:"auto",overflowX:"hidden"}},e.createElement(Et,{list:G,forbidDefault:!0,selectedAttribute:g!=null?g:"",attributeChanged:l=>Y(l),updateColorConfig:K,enableColorPicker:u,updateSize:X,forbidShowLimitPopover:Z}),e.createElement(D,{style:{margin:0}}),Q&&e.createElement(Lt,{subAttributeList:t,setSubAttribute:q,getValue:l=>{var x,E,P,_;return((E=(x=r.selectedPointCloudBox)==null?void 0:x.subAttribute)==null?void 0:E[l.value])||((_=(P=m.cacheSegData)==null?void 0:P.subAttribute)==null?void 0:_[l.value])}})))},zt=[{toolName:"LassoSelector",commonSvg:_t,selectedSvg:yt},{toolName:"RectSelector",commonSvg:ht,selectedSvg:jt},{toolName:"CircleSelector",commonSvg:wt,selectedSvg:Dt}],W=({toolInstance:o})=>{const{ptSegmentInstance:t}=T(B),[n,a]=w("LassoSelector"),{t:c}=k();return L(()=>{if(!t)return;const i=()=>{a("LassoSelector")},u=()=>{a("RectSelector")},m=()=>{a("CircleSelector")};return t.on("LassoSelector",i),t.on("RectSelector",u),t.on("CircleSelector",m),()=>{t.unbind("LassoSelector",i),t.unbind("RectSelector",u),t.unbind("CircleSelector",m)}},[t]),e.createElement("div",{className:`${I}__level`},zt.map(i=>{const u=n===i.toolName;return e.createElement("span",{className:`${I}__toolOption`,key:i.toolName,onClick:()=>t==null?void 0:t.emit(i.toolName)},e.createElement("img",{className:`${I}__singleTool`,src:u?i==null?void 0:i.selectedSvg:i==null?void 0:i.commonSvg}),e.createElement("span",{className:mt({[`${I}__toolOption__selected`]:u})},c(i.toolName)))}))},Ft=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:i})=>{var u,m;const{updatePointCloudPattern:f,pointCloudPattern:p,isPointCloudSegmentationPattern:r}=$(),s=ut(o.config),b=(u=s==null?void 0:s.attributeList)!=null?u:[],g=(s==null?void 0:s.secondaryAttributeConfigurable)===!0?(m=s==null?void 0:s.inputList)!=null?m:[]:[];return r?e.createElement(e.Fragment,null,e.createElement(W,{toolInstance:t}),e.createElement(M,{toolInstance:t,attributeList:b,subAttributeList:g,config:s,stepList:c,stepInfo:o,enableColorPicker:i})):e.createElement(e.Fragment,null,e.createElement(it,{toolName:rt.EPointCloudName.PointCloud,selectedToolName:p,onChange:d=>f==null?void 0:f(d)}),e.createElement("div",{style:{flex:1,overflow:"hidden"}},e.createElement(Bt,{minTopHeight:42,defaultHeight:400,localKey:"settingid:"+(o==null?void 0:o.id)+"taskID:"+(o==null?void 0:o.taskID)+"step:"+(o==null?void 0:o.step)+"type:"+(o==null?void 0:o.type)},e.createElement(M,{toolInstance:t,attributeList:b,subAttributeList:g,config:s,stepList:c,stepInfo:o,enableColorPicker:i}),(s==null?void 0:s.trackConfigurable)===!0&&p===lt.Rect?e.createElement("div",{style:{height:"100%",overflow:"auto"}},e.createElement($t,null),e.createElement(D,{style:{margin:0}}),e.createElement(vt,{imgList:n,imgIndex:a}),e.createElement(D,{style:{margin:0}}),e.createElement(St,{imgList:n,imgIndex:a}),e.createElement(D,{style:{margin:0}}),e.createElement(gt,null),o.loadPreStep>0&&e.createElement(bt,null),e.createElement(Ct,null)):e.createElement("div",null))))},Ut=o=>{var t,n,a,c;const i=at.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:i,toolInstance:u,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:m}};var Ht=ct(Ut,null,null,{context:dt})(Ft);export{W as PointCloudSegToolIcon,Ht as default};
@@ -1 +1 @@
1
- import{EToolName as e}from"../../../data/enums/ToolType.js";import t from"react";import{sidebarCls as s}from"./index.js";import p from"../../../assets/annotation/lineTool/icon_line.svg.js";import _ from"../../../assets/annotation/lineTool/icon_line_a.svg.js";import v from"../../../assets/annotation/pointTool/icon_point.svg.js";import d from"../../../assets/annotation/pointTool/icon_point_a.svg.js";import u from"../../../assets/annotation/polygonTool/icon_polygon_a.svg.js";import N from"../../../assets/annotation/polygonTool/icon_polygon.svg.js";import T from"../../../assets/annotation/rectTool/icon_rect.svg.js";import f from"../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{cTool as S}from"@labelbee/lb-annotation";import $ from"classnames";import{useTranslation as j}from"react-i18next";const{EPointCloudName:E,TOOL_NAME:y,TOOL_NAME_EN:O}=S,m=[{toolName:e.Rect,commonSvg:T,selectedSvg:f},{toolName:e.Polygon,commonSvg:N,selectedSvg:u},{toolName:e.Line,commonSvg:p,selectedSvg:_},{toolName:e.Point,commonSvg:v,selectedSvg:d}],P=n=>n==="en"?O:y,L=({toolName:n,selectedToolName:r,onChange:l})=>{const{i18n:c}=j(),i=m==null?void 0:m.filter(o=>n===E.PointCloud?[e.Polygon,e.Rect,e.Point,e.Line].includes(o==null?void 0:o.toolName):(o==null?void 0:o.toolName)===n),g=i.length>1;return t.createElement("div",{className:`${s}__level`},i.map(o=>{const a=g&&r===o.toolName;return t.createElement("span",{className:`${s}__toolOption`,key:o.toolName,onClick:()=>l==null?void 0:l(o.toolName)},t.createElement("img",{className:`${s}__singleTool`,src:a?o==null?void 0:o.selectedSvg:o==null?void 0:o.commonSvg}),t.createElement("span",{className:$({[`${s}__toolOption__selected`]:a})},P(c.language)[o.toolName]))}))};export{L as ToolIcons};
1
+ import{EToolName as t}from"../../../data/enums/ToolType.js";import e from"react";import{sidebarCls as n}from"./index.js";import E from"../../../assets/annotation/lineTool/icon_line.svg.js";import N from"../../../assets/annotation/lineTool/icon_line_a.svg.js";import S from"../../../assets/annotation/pointTool/icon_point.svg.js";import y from"../../../assets/annotation/pointTool/icon_point_a.svg.js";import P from"../../../assets/annotation/polygonTool/icon_polygon_a.svg.js";import R from"../../../assets/annotation/polygonTool/icon_polygon.svg.js";import{cTool as w}from"@labelbee/lb-annotation";import O from"classnames";import{useTranslation as $}from"react-i18next";import{Dropdown as j}from"antd";import{DownOutlined as C}from"@ant-design/icons";import{ReactComponent as c}from"../../../assets/annotation/rectTool/two_points_rect.svg.js";import{ReactComponent as u}from"../../../assets/annotation/rectTool/three_points_rect.svg.js";import{useLocalStorageState as M}from"ahooks";const{EPointCloudName:b,TOOL_NAME:h,TOOL_NAME_EN:k,ERectToolModeType:l,RECT_TOOL_MODE_NAME:L}=w,d=[{toolName:t.Rect,dropdownItems:[{key:l.ThreePoints,icon:e.createElement(u,null),label:"\u4E09\u70B9\u753B\u77E9\u5F62"},{key:l.TwoPoints,icon:e.createElement(c,null),label:"\u4E24\u70B9\u753B\u77E9\u5F62"}]},{toolName:t.Polygon,commonSvg:R,selectedSvg:P},{toolName:t.Line,commonSvg:E,selectedSvg:N},{toolName:t.Point,commonSvg:S,selectedSvg:y}],B=s=>s==="en"?k:h,x=({toolName:s,selectedToolName:p,onChange:r})=>{const{i18n:g}=$(),m=d==null?void 0:d.filter(o=>s===b.PointCloud?[t.Polygon,t.Rect,t.Point,t.Line].includes(o==null?void 0:o.toolName):(o==null?void 0:o.toolName)===s),_=m.length>1,[a,T]=M(L,{defaultValue:l.ThreePoints,serializer:o=>o!=null?o:"",deserializer:o=>o}),v=a===l.TwoPoints?c:u,f=o=>{T(o.key)};return e.createElement("div",{className:`${n}__level`},m.map(o=>{const i=_&&p===o.toolName;return e.createElement("span",{className:`${n}__toolOption`,key:o.toolName,onClick:()=>r==null?void 0:r(o.toolName)},o.dropdownItems?e.createElement(j,{overlayClassName:`${n}__dropdown`,menu:{items:o.dropdownItems,selectable:!0,defaultSelectedKeys:a?[a]:[],onClick:f}},e.createElement("div",{className:`${n}__multiBox`,style:{color:i?"#666fff":"#999999"}},e.createElement(v,null),e.createElement(C,null))):e.createElement("img",{className:`${n}__singleTool`,src:i?o==null?void 0:o.selectedSvg:o==null?void 0:o.commonSvg}),e.createElement("span",{className:O({[`${n}__toolOption__selected`]:i})},B(g.language)[o.toolName]))}))};export{x as ToolIcons};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.24.0-alpha.2",
3
+ "version": "1.24.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,10 +43,10 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@ant-design/icons": "^4.6.2",
46
- "@labelbee/lb-annotation": "1.28.0-alpha.1",
47
- "@labelbee/lb-utils": "1.19.0",
46
+ "@labelbee/lb-annotation": "1.28.0-alpha.9",
47
+ "@labelbee/lb-utils": "1.20.0-alpha.1",
48
48
  "@labelbee/wavesurfer": "1.1.0",
49
- "@types/react-dom": "^18.2.7",
49
+ "@types/react-dom": "18.3.1",
50
50
  "@types/react-transition-group": "^4.4.9",
51
51
  "ahooks": "^3.4.0",
52
52
  "classnames": "^2.3.0",
@@ -55,7 +55,7 @@
55
55
  "github-markdown-css": "^5.2.0",
56
56
  "lodash": "^4.17.21",
57
57
  "postcss-url": "^10.1.3",
58
- "re-resizable": "^6.9.9",
58
+ "re-resizable": "6.9.17",
59
59
  "react-colorful": "^5.6.1",
60
60
  "react-draggable": "^4.4.6",
61
61
  "react-i18next": "^11.12.0",
@@ -89,7 +89,7 @@
89
89
  "@svgr/rollup": "^8.1.0",
90
90
  "@types/diff-match-patch": "^1.0.36",
91
91
  "@types/lodash": "^4.14.168",
92
- "@types/react": "^16.13.1",
92
+ "@types/react": "16.14.62",
93
93
  "@types/react-redux": "^7.1.16",
94
94
  "@types/react-syntax-highlighter": "^15.5.0",
95
95
  "@typescript-eslint/eslint-plugin": "^4.15.1",
@@ -1 +0,0 @@
1
- "use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";module.exports=img;
@@ -1 +0,0 @@
1
- "use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";module.exports=img;
@@ -1 +0,0 @@
1
- "use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";module.exports=img;
@@ -1 +0,0 @@
1
- import"react";var t="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";export{t as default};
@@ -1 +0,0 @@
1
- import"react";var a="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";export{a as default};
@@ -1 +0,0 @@
1
- import"react";var t="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";export{t as default};