@labelbee/lb-components 1.23.0-alpha.70 → 1.23.0-alpha.71

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{createBase64WorkerFactory as l}from"./_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js";var Z=l("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIGM9T2JqZWN0LmRlZmluZVByb3BlcnR5LG89T2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyxsPU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHksZj1PYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLGE9KHIsZSx0KT0+ZSBpbiByP2MocixlLHtlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMCx2YWx1ZTp0fSk6cltlXT10LHU9KHIsZSk9Pntmb3IodmFyIHQgaW4gZXx8KGU9e30pKWwuY2FsbChlLHQpJiZhKHIsdCxlW3RdKTtpZihvKWZvcih2YXIgdCBvZiBvKGUpKWYuY2FsbChlLHQpJiZhKHIsdCxlW3RdKTtyZXR1cm4gcn07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2NvbnN0e2NhY2hlTWFwOnQsaW5kZXhlczpzLGRlZmF1bHRSR0JBOl99PWUuZGF0YSxkPXMubGVuZ3RoLHA9W107Zm9yKGxldCBuPTA7bjxkO249bisxKXtjb25zdCBpPXRbc1tuXV07aSYmcC5wdXNoKHUoe30saSkpfXBvc3RNZXNzYWdlKHthbm5vdGF0aW9uczpbe3R5cGU6InBpeGVsUG9pbnRzIixhbm5vdGF0aW9uOnAsZGVmYXVsdFJHQkE6X31dfSl9fSkoKTsKCg==",null,!1);export{Z as default};
1
+ import{createBase64WorkerFactory as l}from"./_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js";var Z=l("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIGU9T2JqZWN0LmRlZmluZVByb3BlcnR5LHQ9T2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyxuPU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHksbz1PYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLGE9KHQsbixvKT0+biBpbiB0P2UodCxuLHtlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMCx2YWx1ZTpvfSk6dFtuXT1vLHI9KGUscik9Pntmb3IodmFyIHMgaW4gcnx8KHI9e30pKW4uY2FsbChyLHMpJiZhKGUscyxyW3NdKTtpZih0KWZvcih2YXIgcyBvZiB0KHIpKW8uY2FsbChyLHMpJiZhKGUscyxyW3NdKTtyZXR1cm4gZX07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2NvbnN0e2NhY2hlTWFwOnQsaW5kZXhlczpuLGRlZmF1bHRSR0JBOm99PWUuZGF0YSxhPW4ubGVuZ3RoLHM9W107Zm9yKGxldCBlPTA7ZTxhO2UrPTEpe2NvbnN0IG89dFtuW2VdXTtvJiZzLnB1c2gocih7fSxvKSl9cG9zdE1lc3NhZ2Uoe2Fubm90YXRpb25zOlt7dHlwZToicGl4ZWxQb2ludHMiLGFubm90YXRpb246cyxkZWZhdWx0UkdCQTpvfV19KX19KCk7Cgo=",null,!1);export{Z as default};
@@ -1 +1 @@
1
- import{getClassName as W}from"../../utils/dom.js";import l,{useState as L,useContext as me,useCallback as pe,useEffect as X}from"react";import{PointCloudContainer as fe}from"./PointCloudLayout.js";import{PointCloudContext as ge}from"./PointCloudContext.js";import{connect as ve}from"react-redux";import{cKeyCode as be,EventBus as ye,pointCloudLidar2image as Ee,pointListLidar2Img as he}from"@labelbee/lb-annotation";import{LabelBeeContext as _e}from"../../store/ctx.js";import{a2MapStateToProps as we}from"../../store/annotation/map.js";import{toolStyleConverter as Y}from"@labelbee/lb-utils";import Ce from"./PointCloud2DSingleView.js";import Z from"./components/TitleButton/index.js";import{LeftOutlined as Pe}from"@ant-design/icons";import Le from"classnames";import xe from"../../assets/annotation/common/icon_esc.svg.js";import Ie from"../../assets/annotation/common/icon_left_squareOutlined.svg.js";import ke from"../../assets/annotation/common/icon_right_squareOutlined.svg.js";import{isNumber as Fe}from"lodash";import{getBoundingRect as Oe,isBoundingRectInImage as je}from"../../utils/index.js";import{useLatest as Se}from"ahooks";var Ne=Object.defineProperty,Re=Object.defineProperties,Ve=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable,ee=(e,i,n)=>i in e?Ne(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,m=(e,i)=>{for(var n in i||(i={}))Ae.call(i,n)&&ee(e,n,i[n]);if(D)for(var n of D(i))Te.call(i,n)&&ee(e,n,i[n]);return e},p=(e,i)=>Re(e,Ve(i));const S=be.default,ze=({showEnlarge:e,isEnlargeTopView:i,data:n,setIsEnlarge:y,setCurIndex:g,curIndex:E=0,index:x,annotations2d:h})=>i?l.createElement(Z,{title:n==null?void 0:n.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):e?l.createElement("div",{style:{display:"flex",alignItems:"center"}},l.createElement(Pe,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{y(!1),g(void 0)}}),l.createElement("span",null,n==null?void 0:n.calName),l.createElement("span",{style:{marginLeft:"8px"}},E+1,"/",h==null?void 0:h.length)):l.createElement(Z,{title:n==null?void 0:n.calName,onClick:()=>{y(!0),g(x)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),qe=({currentData:e,config:i,thumbnailWidth:n,isEnlargeTopView:y,highlightAttribute:g,loadPCDFileLoading:E,checkMode:x,measureVisible:h})=>{var N;const[f,te]=L([]),{topViewInstance:oe,displayPointCloudList:R,polygonList:V,imageSizes:I,selectedIDs:A,windowKeydownListenerHook:k}=me(ge),[F,ne]=L(""),[_,ie]=L(!1),[u,w]=L(void 0),O=pe(o=>{ie(o),ye.emit("2d-image:enlarge",o)},[]),le=({viewDataPointList:o,pointCloudBox:r,defaultViewStyle:s,stroke:t})=>o?o.map(v=>({type:v.type,annotation:p(m({id:r.id,pointList:v.pointList},s),{stroke:t})})):[],T=()=>{var o;if(!E&&oe&&(e==null?void 0:e.mappingImgList)&&((o=e==null?void 0:e.mappingImgList)==null?void 0:o.length)>0){const r={fill:"transparent",color:"green"};let s=[];e==null||e.mappingImgList.forEach(t=>{var v,H,K,$;const B=R.reduce((c,d)=>{var b,a;const C=d.id===F||g===d.attribute,{transferViewData:j,viewRangePointList:P}=(b=Ee(d,t.calib,{createRange:C}))!=null?b:{};if(!j||!P)return[];const ue=j.reduce((J,Q)=>Q.type==="line"?[...J,...Q.pointList]:J,[]),ce=p(m({},Oe(ue)),{imageName:t.path});if(!je(ce,t.path,I))return c;const M=(a=Y.getColorFromConfig({attribute:d.attribute},p(m({},i),{attributeConfigurable:!0}),{}))==null?void 0:a.stroke,de=le({viewDataPointList:j,pointCloudBox:d,defaultViewStyle:r,stroke:M}),G=[...c,...de];return(P==null?void 0:P.length)>0&&G.unshift({type:"polygon",annotation:p(m({id:F,pointList:P},r),{stroke:M,fill:"rgba(255, 255, 255, 0.6)"})}),G},[]),U=I[(v=t==null?void 0:t.path)!=null?v:""];U&&Fe((H=t==null?void 0:t.calib)==null?void 0:H.groundHeight)&&V.forEach(c=>{const d=c.pointList.map(a=>{var C;return p(m({},a),{z:(C=t==null?void 0:t.calib)==null?void 0:C.groundHeight})}),b=he(d,t==null?void 0:t.calib,U);if(b){const a=Y.getColorFromConfig({attribute:c.attribute},p(m({},i),{attributeConfigurable:!0}),{});B.push({type:"polygon",annotation:p(m({id:c.id,pointList:b},r),{stroke:a==null?void 0:a.stroke,fill:A.includes(c.id)?a==null?void 0:a.fill:"rgba(255, 255, 255, 0.6)"})})}}),s.push({annotations:B,url:t==null?void 0:t.url,fallbackUrl:(K=t==null?void 0:t.fallbackUrl)!=null?K:"",calName:($=t==null?void 0:t.calib)==null?void 0:$.calName,calib:t==null?void 0:t.calib,path:t==null?void 0:t.path})}),te(s)}};X(()=>{window.requestIdleCallback?window.requestIdleCallback(T):setTimeout(T,1)},[R,e==null?void 0:e.mappingImgList,F,g,E,V,I,A]);const re=Se(o=>{if(!_)return;const r=()=>{o.stopImmediatePropagation()};switch(o.keyCode){case S.Esc:{O(!1),r();break}case S.Left:{z(),r();break}case S.Right:{q(),r();break}}}),z=()=>{u===void 0||!_||Number(u)>0&&w(u-1)},q=()=>{u===void 0||!_||Number(u)<(f==null?void 0:f.length)-1&&w(u+1)};X(()=>{const o=s=>re.current(s);return k.preappendEventListener(o)},[k,k.preappendEventListener]);const se=!e||!(e==null?void 0:e.mappingImgList)||!(((N=e==null?void 0:e.mappingImgList)==null?void 0:N.length)>0),ae=l.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},l.createElement("img",{src:Ie,style:{height:"24px",marginRight:"8px",cursor:"pointer"},onClick:()=>z()}),l.createElement("span",{style:{marginRight:"12px"}},"\u952E\u76D8\u5DE6\u952E\u4E0A\u4E00\u5F20"),l.createElement("span",{style:{margin:"0px 8px 0px 12px"}},"\u952E\u76D8\u53F3\u952E\u4E0A\u4E00\u5F20"),l.createElement("img",{src:ke,style:{height:"24px",marginRight:"12px",cursor:"pointer"},onClick:()=>q()}),l.createElement("img",{src:xe,style:{height:"24px",margin:"0px 8px 0px 12px",cursor:"pointer"},onClick:()=>{O(!1),w(void 0)}}),l.createElement("span",null,"\u952E\u9000\u51FA"));return(f==null?void 0:f.length)>0?l.createElement(l.Fragment,null,f.map((o,r)=>{const s=_&&r===u;return l.createElement(fe,{className:Le({[W("point-cloud-2d-container")]:!0,[W("point-cloud-container","zoom")]:s}),title:l.createElement(ze,{showEnlarge:s,isEnlargeTopView:y,data:o,setIsEnlarge:O,setCurIndex:w,curIndex:u,index:r,annotations2d:f}),titleOnSurface:!s,style:{display:se?"none":"flex",width:s?"100%":n},key:r,toolbar:ae},(o==null?void 0:o.annotations)&&(o==null?void 0:o.url)&&l.createElement(Ce,{key:o.url,currentData:e,view2dData:o,setSelectedID:ne,showEnlarge:s,checkMode:x,measureVisible:h}))})):null};var He=ve(we,null,null,{context:_e})(qe);export{He as default};
1
+ import{getClassName as _}from"../../utils/dom.js";import t,{useState as f,useContext as z,useCallback as $,useRef as q,useEffect as j}from"react";import{PointCloudContainer as D}from"./PointCloudLayout.js";import{PointCloudContext as M}from"./PointCloudContext.js";import{connect as W}from"react-redux";import{cKeyCode as H,EventBus as G}from"@labelbee/lb-annotation";import{LabelBeeContext as J}from"../../store/ctx.js";import{a2MapStateToProps as Q}from"../../store/annotation/map.js";import U from"./PointCloud2DSingleView.js";import S from"./components/TitleButton/index.js";import{LeftOutlined as X}from"@ant-design/icons";import Y from"classnames";import Z from"../../assets/annotation/common/icon_esc.svg.js";import ee from"../../assets/annotation/common/icon_left_squareOutlined.svg.js";import te from"../../assets/annotation/common/icon_right_squareOutlined.svg.js";import ne from"../../_virtual/2DViewWorker.js";import{useLatest as oe}from"ahooks";const C=H.default,ie=({showEnlarge:n,isEnlargeTopView:v,data:l,setIsEnlarge:c,setCurIndex:m,curIndex:u=0,index:E,annotations2d:p})=>v?t.createElement(S,{title:l==null?void 0:l.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):n?t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(X,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{c(!1),m(void 0)}}),t.createElement("span",null,l==null?void 0:l.calName),t.createElement("span",{style:{marginLeft:"8px"}},u+1,"/",p==null?void 0:p.length)):t.createElement(S,{title:l==null?void 0:l.calName,onClick:()=>{c(!0),m(E)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),le=({currentData:n,config:v,thumbnailWidth:l,isEnlargeTopView:c,highlightAttribute:m,loadPCDFileLoading:u,checkMode:E,measureVisible:p})=>{var h;const[a,N]=f([]),{topViewInstance:R,displayPointCloudList:k,polygonList:w,imageSizes:F,selectedIDs:b,windowKeydownListenerHook:x}=z(M),[L,A]=f(""),[d,V]=f(!1),[r,g]=f(void 0),y=$(e=>{V(e),G.emit("2d-image:enlarge",e)},[]),s=q();j(()=>{var e;if(!u&&R&&(n==null?void 0:n.mappingImgList)&&((e=n==null?void 0:n.mappingImgList)==null?void 0:e.length)>0)return s.current&&s.current.terminate(),s.current=new ne,s.current.onmessage=o=>{var i;const O=o.data;N(O),(i=s.current)==null||i.terminate()},s.current.postMessage({currentData:n,displayPointCloudList:k,selectedID:L,highlightAttribute:m,imageSizes:F,config:v,polygonList:w,selectedIDs:b}),()=>{var o;(o=s.current)==null||o.terminate()}},[k,n==null?void 0:n.mappingImgList,L,m,u,w,F,b]);const T=oe(e=>{if(!d)return;const o=()=>{e.stopImmediatePropagation()};switch(e.keyCode){case C.Esc:{y(!1),o();break}case C.Left:{I(),o();break}case C.Right:{P(),o();break}}}),I=()=>{r===void 0||!d||Number(r)>0&&g(r-1)},P=()=>{r===void 0||!d||Number(r)<(a==null?void 0:a.length)-1&&g(r+1)};j(()=>{const e=i=>T.current(i);return x.preappendEventListener(e)},[x,x.preappendEventListener]);const B=!n||!(n==null?void 0:n.mappingImgList)||!(((h=n==null?void 0:n.mappingImgList)==null?void 0:h.length)>0),K=t.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},t.createElement("img",{src:ee,style:{height:"24px",marginRight:"8px",cursor:"pointer"},onClick:()=>I()}),t.createElement("span",{style:{marginRight:"12px"}},"\u952E\u76D8\u5DE6\u952E\u4E0A\u4E00\u5F20"),t.createElement("span",{style:{margin:"0px 8px 0px 12px"}},"\u952E\u76D8\u53F3\u952E\u4E0A\u4E00\u5F20"),t.createElement("img",{src:te,style:{height:"24px",marginRight:"12px",cursor:"pointer"},onClick:()=>P()}),t.createElement("img",{src:Z,style:{height:"24px",margin:"0px 8px 0px 12px",cursor:"pointer"},onClick:()=>{y(!1),g(void 0)}}),t.createElement("span",null,"\u952E\u9000\u51FA"));return(a==null?void 0:a.length)>0?t.createElement(t.Fragment,null,a.map((e,o)=>{const i=d&&o===r;return t.createElement(D,{className:Y({[_("point-cloud-2d-container")]:!0,[_("point-cloud-container","zoom")]:i}),title:t.createElement(ie,{showEnlarge:i,isEnlargeTopView:c,data:e,setIsEnlarge:y,setCurIndex:g,curIndex:r,index:o,annotations2d:a}),titleOnSurface:!i,style:{display:B?"none":"flex",width:i?"100%":l},key:o,toolbar:K},(e==null?void 0:e.annotations)&&(e==null?void 0:e.url)&&t.createElement(U,{key:e.url,currentData:n,view2dData:e,setSelectedID:A,showEnlarge:i,checkMode:E,measureVisible:p}))})):null};var re=W(Q,null,null,{context:J})(le);export{re as default};
@@ -1 +1 @@
1
- import{PointCloudAnnotation as B}from"@labelbee/lb-annotation";import{getClassName as w}from"../../utils/dom.js";import{PointCloudContainer as y}from"./PointCloudLayout.js";import c,{useRef as k,useEffect as h}from"react";import{PointCloudContext as v}from"./PointCloudContext.js";import{EPerspectiveView as j}from"@labelbee/lb-utils";import{useSingleBox as V}from"./hooks/useSingleBox.js";import{useSphere as b}from"./hooks/useSphere.js";import{useZoom as S}from"./hooks/useZoom.js";import{SizeInfoForView as E}from"./PointCloudInfos.js";import{connect as I}from"react-redux";import{a2MapStateToProps as T}from"../../store/annotation/map.js";import{usePointCloudViews as D}from"./hooks/usePointCloudViews.js";import O from"../../hooks/useSize.js";import N from"./components/EmptyPage/index.js";import{useTranslation as M}from"react-i18next";import{LabelBeeContext as X}from"../../store/ctx.js";import U from"../../utils/ToolUtils.js";import Z from"./components/TitleButton/index.js";const A=(u,r,a=1)=>{const{width:e,height:o}=r,t={x:u.x+e*a/2,y:u.y+o*a/2},m={x:r.width/2,y:r.height/2};return{offsetX:(m.x-t.x)/a,offsetY:-(m.y-t.y)/a}},g=(u,r,a,e,o)=>{const{offsetX:t,offsetY:m}=A(u,a,r);if(o.camera.zoom=r,u){const d=Math.cos(e),f=Math.sin(e),x=t*d,C=t*f,{x:p,y:n,z:l}=o.initCameraPosition;o.camera.position.set(p+C,n-x,l+m)}o.camera.updateProjectionMatrix(),o.render()},L=({currentData:u,config:r,checkMode:a})=>{const e=c.useContext(v),o=k(null),t=O(o),{selectedBox:m}=V(),{selectedSphere:d}=b(),{syncBackviewToolZoom:f}=S(),{t:x}=M(),{backViewUpdateBox:C,backViewUpdatePoint:p}=D();return h(()=>{if(o.current){const n={width:o.current.clientWidth,height:o.current.clientHeight},l=new B({container:o.current,size:n,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:r,checkMode:a,toolName:U.getPointCloudToolList()});e.setBackViewInstance(l)}},[]),h(()=>{if(!t||!e.backViewInstance)return;const{toolInstance:n,pointCloudInstance:l}=e.backViewInstance;n.singleOn("renderZoom",(i,s)=>{if(e.selectedPointCloudBox){g(s,i,t,e.selectedPointCloudBox.rotation,l),f(s,i,t);return}if(d){g(s,i,t,0,l),f(s,i,t);return}}),n.singleOn("dragMove",({currentPos:i,zoom:s})=>{!e.selectedPointCloudBox&&!d||g(i,s,t,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,l)}),n.singleOn("updatePointByDrag",(i,s)=>{d&&(p==null||p(i,s[0]))}),n.singleOn("updatePolygonByDrag",i=>{if(e.selectedIDs.length===1&&i.length===1){const{newPolygon:s,originPolygon:P}=i[0];s&&P&&C(s,P)}})},[e,t]),h(()=>{var n;(n=e==null?void 0:e.backViewInstance)==null||n.initSize(t)},[t]),c.createElement(y,{className:w("point-cloud-container","back-view"),title:c.createElement(Z,{title:x("BackView")}),titleOnSurface:!0},c.createElement("div",{className:w("point-cloud-container","bottom-view-content")},c.createElement("div",{className:w("point-cloud-container","core-instance"),ref:o}),!m&&!d&&c.createElement(N,null),c.createElement(E,{perspectiveView:j.Back})))};var Y=I(T,null,null,{context:X})(L);export{Y as default};
1
+ import{PointCloudAnnotation as B}from"@labelbee/lb-annotation";import{getClassName as w}from"../../utils/dom.js";import{PointCloudContainer as v}from"./PointCloudLayout.js";import c,{useRef as y,useEffect as h}from"react";import{PointCloudContext as k}from"./PointCloudContext.js";import{EPerspectiveView as j}from"@labelbee/lb-utils";import{useSingleBox as V}from"./hooks/useSingleBox.js";import{useSphere as b}from"./hooks/useSphere.js";import{useZoom as S}from"./hooks/useZoom.js";import{SizeInfoForView as E}from"./PointCloudInfos.js";import{connect as I}from"react-redux";import{a2MapStateToProps as T}from"../../store/annotation/map.js";import{usePointCloudViews as D}from"./hooks/usePointCloudViews.js";import N from"../../hooks/useSize.js";import O from"./components/EmptyPage/index.js";import{useTranslation as M}from"react-i18next";import{LabelBeeContext as X}from"../../store/ctx.js";import U from"../../utils/ToolUtils.js";import Z from"./components/TitleButton/index.js";const A=(u,r,a=1)=>{const{width:e,height:o}=r,t={x:u.x+e*a/2,y:u.y+o*a/2},m={x:r.width/2,y:r.height/2};return{offsetX:(m.x-t.x)/a,offsetY:-(m.y-t.y)/a}},g=(u,r,a,e,o)=>{const{offsetX:t,offsetY:m}=A(u,a,r);if(o.camera.zoom=r,u){const d=Math.cos(e),f=Math.sin(e),x=t*d,C=t*f,{x:p,y:n,z:l}=o.initCameraPosition;o.camera.position.set(p+C,n-x,l+m)}o.camera.updateProjectionMatrix(),o.render()},L=({currentData:u,config:r,checkMode:a})=>{const e=c.useContext(k),o=y(null),t=N(o),{selectedBox:m}=V(),{selectedSphere:d}=b(),{syncBackviewToolZoom:f}=S(),{t:x}=M(),{backViewUpdateBox:C,backViewUpdatePoint:p}=D();return h(()=>{if(o.current){const n={width:o.current.clientWidth,height:o.current.clientHeight},l=new B({container:o.current,size:n,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:r,checkMode:a,toolName:U.getPointCloudToolList()});e.setBackViewInstance(l)}},[]),h(()=>{if(!t||!e.backViewInstance)return;const{toolInstance:n,pointCloudInstance:l}=e.backViewInstance;n.singleOn("renderZoom",(i,s)=>{if(e.selectedPointCloudBox){g(s,i,t,e.selectedPointCloudBox.rotation,l),f(s,i,t);return}if(d){g(s,i,t,0,l),f(s,i,t);return}}),n.singleOn("dragMove",({currentPos:i,zoom:s})=>{!e.selectedPointCloudBox&&!d||g(i,s,t,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,l)}),n.singleOn("updatePointByDrag",(i,s)=>{d&&(p==null||p(i,s[0]))}),n.singleOn("updatePolygonByDrag",i=>{if(e.selectedIDs.length===1&&i.length===1){const{newPolygon:s,originPolygon:P}=i[0];s&&P&&C(s,P)}})},[e,t]),h(()=>{var n;(n=e==null?void 0:e.backViewInstance)==null||n.initSize(t)},[t]),c.createElement(v,{className:w("point-cloud-container","back-view"),title:c.createElement(Z,{title:x("BackView")}),titleOnSurface:!0,titleNonInteractive:!0},c.createElement("div",{className:w("point-cloud-container","bottom-view-content")},c.createElement("div",{className:w("point-cloud-container","core-instance"),ref:o}),!m&&!d&&c.createElement(O,null),c.createElement(E,{perspectiveView:j.Back})))};var Y=I(T,null,null,{context:X})(L);export{Y as default};
@@ -1 +1 @@
1
- import{getClassName as e}from"../../utils/dom.js";import l from"classnames";import a from"react";const m=({title:t,toolbar:n,children:o,className:c,style:r,titleOnSurface:s})=>a.createElement("div",{className:l([c,e("point-cloud-container")]),style:r},s?a.createElement("span",{className:e("point-cloud-container","header-title-box")},t):a.createElement("div",{className:e("point-cloud-container","header")},t&&a.createElement("span",{className:e("point-cloud-container","header-title")},t),n&&a.createElement("div",{className:e("point-cloud-container","header-toolbar")},n)),o);export{m as PointCloudContainer};
1
+ import{getClassName as e}from"../../utils/dom.js";import i from"classnames";import a from"react";const m=({title:t,toolbar:n,children:o,className:r,style:c,titleNonInteractive:s,titleOnSurface:l})=>a.createElement("div",{className:i([r,e("point-cloud-container")]),style:c},l?a.createElement("span",{className:e("point-cloud-container","header-title-box"),style:{pointerEvents:s?"none":"auto"}},t):a.createElement("div",{className:e("point-cloud-container","header")},t&&a.createElement("span",{className:e("point-cloud-container","header-title")},t),n&&a.createElement("div",{className:e("point-cloud-container","header-toolbar")},n)),o);export{m as PointCloudContainer};
@@ -1 +1 @@
1
- import{PointCloudAnnotation as P}from"@labelbee/lb-annotation";import{getClassName as w}from"../../utils/dom.js";import{PointCloudContainer as v}from"./PointCloudLayout.js";import u,{useRef as y,useEffect as C}from"react";import{EPerspectiveView as j}from"@labelbee/lb-utils";import{PointCloudContext as B}from"./PointCloudContext.js";import{SizeInfoForView as V}from"./PointCloudInfos.js";import{connect as S}from"react-redux";import{a2MapStateToProps as b}from"../../store/annotation/map.js";import{usePointCloudViews as E}from"./hooks/usePointCloudViews.js";import{useSingleBox as I}from"./hooks/useSingleBox.js";import{useSphere as T}from"./hooks/useSphere.js";import D from"./components/EmptyPage/index.js";import N from"../../hooks/useSize.js";import{useTranslation as O}from"react-i18next";import{LabelBeeContext as k}from"../../store/ctx.js";import M from"../../utils/ToolUtils.js";import{useZoom as X}from"./hooks/useZoom.js";import L from"./components/TitleButton/index.js";const U=(c,l,e=1)=>{const{width:f,height:i}=l,d={x:c.x+f*e/2,y:c.y+i*e/2},r={x:l.width/2,y:l.height/2};return{offsetX:(r.x-d.x)/e,offsetY:-(r.y-d.y)/e}},h=(c,l,e,f,i)=>{const{offsetX:d,offsetY:r}=U(c,e,l);if(i.camera.zoom=l,c){const a=Math.cos(f),o=Math.sin(f),x=d*a,p=d*o,{x:n,y:m,z:t}=i.initCameraPosition;i.camera.position.set(n-x,m-p,t+r)}i.camera.updateProjectionMatrix(),i.render()},Z=({config:c,checkMode:l})=>{const e=u.useContext(B),{sideViewUpdateBox:f,sideViewUpdatePoint:i}=E(),{selectedBox:d}=I(),{selectedSphere:r}=T(),a=y(null),o=N(a),{t:x}=O(),{syncSideviewToolZoom:p}=X();return C(()=>{if(a.current){const n={width:a.current.clientWidth,height:a.current.clientHeight},m=new P({container:a.current,size:n,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:c,checkMode:l,toolName:M.getPointCloudToolList()});e.setSideViewInstance(m)}},[]),C(()=>{if(!o||!e.sideViewInstance)return;const{toolInstance:n,pointCloudInstance:m}=e.sideViewInstance;n.singleOn("renderZoom",(t,s)=>{if(e.selectedPointCloudBox){h(s,t,o,e.selectedPointCloudBox.rotation,m),p(s,t,o);return}r&&(h(s,t,o,0,m),p(s,t,o))}),n.singleOn("dragMove",({currentPos:t,zoom:s})=>{!e.selectedPointCloudBox&&!r||h(t,s,o,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,m)}),n.singleOn("updatePointByDrag",(t,s)=>{r&&(i==null||i(t,s[0]))}),n.singleOn("updatePolygonByDrag",t=>{if(e.selectedIDs.length===1&&t.length===1){const{newPolygon:s,originPolygon:g}=t[0];f(s,g)}})},[e,o]),C(()=>{var n;(n=e==null?void 0:e.sideViewInstance)==null||n.initSize(o)},[o]),u.createElement(v,{className:w("point-cloud-container","side-view"),title:u.createElement(L,{title:x("SideView")}),titleOnSurface:!0},u.createElement("div",{className:w("point-cloud-container","bottom-view-content")},u.createElement("div",{className:w("point-cloud-container","core-instance"),ref:a}),!d&&!r&&u.createElement(D,null),u.createElement(V,{perspectiveView:j.Left})))};var A=S(b,null,null,{context:k})(Z);export{A as default};
1
+ import{PointCloudAnnotation as P}from"@labelbee/lb-annotation";import{getClassName as w}from"../../utils/dom.js";import{PointCloudContainer as v}from"./PointCloudLayout.js";import m,{useRef as y,useEffect as C}from"react";import{EPerspectiveView as j}from"@labelbee/lb-utils";import{PointCloudContext as B}from"./PointCloudContext.js";import{SizeInfoForView as V}from"./PointCloudInfos.js";import{connect as S}from"react-redux";import{a2MapStateToProps as b}from"../../store/annotation/map.js";import{usePointCloudViews as E}from"./hooks/usePointCloudViews.js";import{useSingleBox as I}from"./hooks/useSingleBox.js";import{useSphere as T}from"./hooks/useSphere.js";import N from"./components/EmptyPage/index.js";import D from"../../hooks/useSize.js";import{useTranslation as O}from"react-i18next";import{LabelBeeContext as k}from"../../store/ctx.js";import M from"../../utils/ToolUtils.js";import{useZoom as X}from"./hooks/useZoom.js";import L from"./components/TitleButton/index.js";const U=(c,l,e=1)=>{const{width:f,height:i}=l,d={x:c.x+f*e/2,y:c.y+i*e/2},r={x:l.width/2,y:l.height/2};return{offsetX:(r.x-d.x)/e,offsetY:-(r.y-d.y)/e}},h=(c,l,e,f,i)=>{const{offsetX:d,offsetY:r}=U(c,e,l);if(i.camera.zoom=l,c){const a=Math.cos(f),o=Math.sin(f),x=d*a,p=d*o,{x:n,y:u,z:t}=i.initCameraPosition;i.camera.position.set(n-x,u-p,t+r)}i.camera.updateProjectionMatrix(),i.render()},Z=({config:c,checkMode:l})=>{const e=m.useContext(B),{sideViewUpdateBox:f,sideViewUpdatePoint:i}=E(),{selectedBox:d}=I(),{selectedSphere:r}=T(),a=y(null),o=D(a),{t:x}=O(),{syncSideviewToolZoom:p}=X();return C(()=>{if(a.current){const n={width:a.current.clientWidth,height:a.current.clientHeight},u=new P({container:a.current,size:n,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:c,checkMode:l,toolName:M.getPointCloudToolList()});e.setSideViewInstance(u)}},[]),C(()=>{if(!o||!e.sideViewInstance)return;const{toolInstance:n,pointCloudInstance:u}=e.sideViewInstance;n.singleOn("renderZoom",(t,s)=>{if(e.selectedPointCloudBox){h(s,t,o,e.selectedPointCloudBox.rotation,u),p(s,t,o);return}r&&(h(s,t,o,0,u),p(s,t,o))}),n.singleOn("dragMove",({currentPos:t,zoom:s})=>{!e.selectedPointCloudBox&&!r||h(t,s,o,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,u)}),n.singleOn("updatePointByDrag",(t,s)=>{r&&(i==null||i(t,s[0]))}),n.singleOn("updatePolygonByDrag",t=>{if(e.selectedIDs.length===1&&t.length===1){const{newPolygon:s,originPolygon:g}=t[0];f(s,g)}})},[e,o]),C(()=>{var n;(n=e==null?void 0:e.sideViewInstance)==null||n.initSize(o)},[o]),m.createElement(v,{className:w("point-cloud-container","side-view"),title:m.createElement(L,{title:x("SideView")}),titleOnSurface:!0,titleNonInteractive:!0},m.createElement("div",{className:w("point-cloud-container","bottom-view-content")},m.createElement("div",{className:w("point-cloud-container","core-instance"),ref:a}),!d&&!r&&m.createElement(N,null),m.createElement(V,{perspectiveView:j.Left})))};var A=S(b,null,null,{context:k})(Z);export{A as default};
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 p}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import n,{useState as c,useImperativeHandle as m}from"react";import{I18nextProvider as u}from"react-i18next";import{Provider as f}from"react-redux";import x from"./App.js";import w from"./configureStore.js";import{PageBackward as P,PageForward as v,PageJump as T}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as j}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as b}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 S}from"./hooks/useToolStyle.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var V=Object.defineProperty,g=Object.defineProperties,C=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,d=(o,e,t)=>e in o?V(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,y=(o,e)=>{for(var t in e||(e={}))I.call(e,t)&&d(o,t,e[t]);if(s)for(var t of s(e))_.call(e,t)&&d(o,t,e[t]);return o},h=(o,e)=>g(o,C(e));const r=w(),A=(o,e)=>{const[t,l]=c();return m(e,()=>({toolInstance:t,annotationEngine:r.getState().annotation.annotationEngine,pageBackwardActions:()=>r.dispatch(P()),pageForwardActions:()=>r.dispatch(v()),pageJump:a=>{const i=~~a-1;r.dispatch(T(i))},hello:()=>alert("hello labelBee!!!")}),[t]),n.createElement(f,{store:r,context:b},n.createElement(u,{i18n:p},n.createElement(S,{value:o.toolStyle},n.createElement(j,null,n.createElement(x,h(y({},o),{setToolInstance:a=>{var i;l(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}}))))))};var B=n.forwardRef(A);export{B as default,r 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 n,{useState as c,useImperativeHandle as m}from"react";import{initReactI18next as u,I18nextProvider as f}from"react-i18next";import{Provider as x}from"react-redux";import w from"./App.js";import P from"./configureStore.js";import{PageBackward as v,PageForward as T,PageJump as j}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as S}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as b}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 I}from"./hooks/useToolStyle.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var V=Object.defineProperty,g=Object.defineProperties,C=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,l=(o,e,t)=>e in o?V(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,h=(o,e)=>{for(var t in e||(e={}))_.call(e,t)&&l(o,t,e[t]);if(d)for(var t of d(e))y.call(e,t)&&l(o,t,e[t]);return o},A=(o,e)=>g(o,C(e));const r=P();s.use(u),s.options.react={useSuspense:!1};const B=(o,e)=>{const[t,p]=c();return m(e,()=>({toolInstance:t,annotationEngine:r.getState().annotation.annotationEngine,pageBackwardActions:()=>r.dispatch(v()),pageForwardActions:()=>r.dispatch(T()),pageJump:a=>{const i=~~a-1;r.dispatch(j(i))},hello:()=>alert("hello labelBee!!!")}),[t]),n.createElement(x,{store:r,context:b},n.createElement(f,{i18n:s},n.createElement(I,{value:o.toolStyle},n.createElement(S,null,n.createElement(w,A(h({},o),{setToolInstance:a=>{var i;p(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}}))))))};var D=n.forwardRef(B);export{D as default,r as store};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.23.0-alpha.70",
3
+ "version": "1.23.0-alpha.71",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",
@@ -111,6 +111,7 @@
111
111
  "rollup": "^2.43.1",
112
112
  "rollup-plugin-esbuild": "^3.0.2",
113
113
  "rollup-plugin-postcss": "^4.0.2",
114
+ "rollup-plugin-terser": "^7.0.2",
114
115
  "rollup-plugin-web-worker-loader": "^1.6.1",
115
116
  "sass": "^1.53.0",
116
117
  "typescript": "^4.2.3"