@labelbee/lb-components 1.23.0-alpha.102 → 1.23.0-alpha.104

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.
@@ -1 +1 @@
1
- import{useContext as k,useState as E,useMemo as N,useCallback as x}from"react";import S from"lodash";import{message as v,Modal as H}from"antd";import{usePointCloudViews as V}from"./usePointCloudViews.js";import{PointCloudContext as A}from"../PointCloudContext.js";import{useTranslation as T}from"react-i18next";import{EPointCloudBoxRenderTrigger as U}from"../../../utils/ToolPointCloudBoxRenderHelper.js";import q from"../../../utils/AnnotationDataUtils.js";var z=Object.defineProperty,F=Object.defineProperties,G=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,B=(o,e,t)=>e in o?z(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,O=(o,e)=>{for(var t in e||(e={}))J.call(e,t)&&B(o,t,e[t]);if(y)for(var t of y(e))K.call(e,t)&&B(o,t,e[t]);return o},D=(o,e)=>F(o,G(e));const Q=(o,e=[],t=[])=>{const{rects:l=[]}=o,n=l.map(i=>{var c;return D(O({},i),{imageName:(c=q.getNextPath({prePath:i.imageName,preMappingImgList:t,nextMappingImgList:e}))!=null?c:""})}).filter(i=>i.imageName!=="");return D(O({},o),{rects:n})},W=({config:o,currentData:e})=>{const{selectedIDs:t,pointCloudBoxList:l,displayPointCloudList:n,setPointCloudResult:i,syncAllViewPointCloudColor:c}=k(A),[d,m]=E({copiedBoxes:[],copiedMappingImgList:[]}),{copiedBoxes:p}=d,{pointCloudBoxListUpdated:I}=V(),{t:u,i18n:_}=T(),L=s=>o.trackConfigurable!==!0?!1:l.some(a=>s.some(f=>f.trackID===a.trackID)),g=N(()=>n.filter(s=>t.includes(s.id)),[t,n]),w=x(()=>{var s;if(g.length>0){const a=(s=e==null?void 0:e.mappingImgList)!=null?s:[];m({copiedBoxes:S.cloneDeep(g),copiedMappingImgList:a})}else m({copiedBoxes:[],copiedMappingImgList:[]}),v.error(u("CopyEmptyInPointCloud"))},[t,n,_.language,e]),M=x(()=>{var s,a;if(p.length===0){v.error(u("PasteEmptyInPointCloud"));return}const f=L(p),h=(s=e==null?void 0:e.mappingImgList)!=null?s:[],j=(a=d==null?void 0:d.copiedMappingImgList)!=null?a:[],P=p.map(r=>Q(r,h,j)),C=r=>{i(r),I==null||I(r),m({copiedBoxes:[],copiedMappingImgList:[]}),c(U.MultiPaste,r)};if(f)H.confirm({title:u("HasDuplicateIDHeader"),content:u("HasDuplicateIDMsg"),onOk:()=>{const r=l.filter(R=>!P.find(b=>b.trackID===R.trackID)).concat(P);C(r)}});else{const r=[...n,...P];C(r)}},[p,n,_.language,e]);return{copySelectedBoxes:w,pasteSelectedBoxes:M,copiedBoxes:p,selectedBoxes:g}};export{W as useBoxes};
1
+ import{useContext as E,useState as N,useMemo as V,useCallback as I}from"react";import D from"lodash";import{message as P}from"antd";import{usePointCloudViews as H}from"./usePointCloudViews.js";import{PointCloudContext as T}from"../PointCloudContext.js";import{useTranslation as A}from"react-i18next";import{EPointCloudBoxRenderTrigger as U}from"../../../utils/ToolPointCloudBoxRenderHelper.js";import k from"../../../utils/AnnotationDataUtils.js";import{uuid as y}from"@labelbee/lb-annotation";import{useHistory as z}from"./useHistory.js";var W=Object.defineProperty,q=Object.defineProperties,F=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,B=(t,e,o)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,f=(t,e)=>{for(var o in e||(e={}))G.call(e,o)&&B(t,o,e[o]);if(v)for(var o of v(e))J.call(e,o)&&B(t,o,e[o]);return t},x=(t,e)=>q(t,F(e));const K=(t,e=[],o=[])=>{const{rects:p=[]}=t,s=p.map(i=>{var a;return x(f({},i),{imageName:(a=k.getNextPath({prePath:i.imageName,preMappingImgList:o,nextMappingImgList:e}))!=null?a:""})}).filter(i=>i.imageName!=="");return x(f({},t),{rects:s})},Q=(t,e)=>{const o=Math.max(...t.map(s=>s.trackID||0),0),p=5;return e.map((s,i)=>x(f({},s),{id:y(),uuid:y(),center:{x:s.center.x-p,y:s.center.y-p,z:s.center.z},trackID:o+i+1}))},X=({config:t,currentData:e})=>{const{selectedIDs:o,pointCloudBoxList:p,displayPointCloudList:s,setPointCloudResult:i,syncAllViewPointCloudColor:a}=E(T),[u,d]=N({copiedBoxes:[],copiedMappingImgList:[]}),{copiedBoxes:l}=u,{pointCloudBoxListUpdated:C}=H(),{t:m,i18n:_}=A(),{pushHistoryWithList:L}=z(),g=V(()=>s.filter(r=>o.includes(r.id)),[o,s]),O=I(()=>{var r;if(g.length>0){const c=(r=e==null?void 0:e.mappingImgList)!=null?r:[];d({copiedBoxes:D.cloneDeep(g),copiedMappingImgList:c})}else d({copiedBoxes:[],copiedMappingImgList:[]}),P.error(m("CopyEmptyInPointCloud"));P.success(m("CopySuccess"))},[o,s,_.language,e]),h=I(()=>{var r,c;if(l.length===0){P.error(m("PasteEmptyInPointCloud"));return}const w=(r=e==null?void 0:e.mappingImgList)!=null?r:[],M=(c=u==null?void 0:u.copiedMappingImgList)!=null?c:[],j=l.map(n=>K(n,w,M)),b=Q(s,j),R=n=>{i(n),C==null||C(n),d({copiedBoxes:[],copiedMappingImgList:[]}),L({pointCloudBoxList:n}),a(U.MultiPaste,n)},S=[...s,...b];R(S)},[l,s,_.language,e]);return{copySelectedBoxes:O,pasteSelectedBoxes:h,copiedBoxes:l,selectedBoxes:g}};export{X as useBoxes};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.23.0-alpha.102",
3
+ "version": "1.23.0-alpha.104",
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.49",
47
- "@labelbee/lb-utils": "1.19.0-alpha.20",
46
+ "@labelbee/lb-annotation": "1.27.0-alpha.51",
47
+ "@labelbee/lb-utils": "1.19.0-alpha.21",
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",