@labelbee/lb-components 1.23.0-alpha.70 → 1.23.0-alpha.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/2DViewWorker.js +1 -0
- package/dist/_virtual/highlightSegmentWorker.js +1 -1
- package/dist/components/DynamicResizer/DynamicResizer.js +1 -0
- package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
- package/dist/components/DynamicResizer/assets/topToZero.svg.js +1 -0
- package/dist/components/DynamicResizer/hooks/useDrag.js +1 -0
- package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
- package/dist/components/DynamicResizer/index.js +1 -0
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudBackView.js +1 -1
- package/dist/components/pointCloudView/PointCloudLayout.js +1 -1
- package/dist/components/pointCloudView/PointCloudSideView.js +1 -1
- package/dist/index.css +71 -0
- package/dist/index.js +1 -1
- package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +5 -0
- package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +12 -0
- package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +23 -0
- package/dist/types/components/DynamicResizer/index.d.ts +2 -0
- package/dist/types/components/DynamicResizer/types/interface.d.ts +16 -0
- package/dist/types/components/pointCloudView/2DViewWorker.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/_virtual/2DViewWorker.js +1 -0
- package/es/_virtual/highlightSegmentWorker.js +1 -1
- package/es/components/DynamicResizer/DynamicResizer.js +1 -0
- package/es/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
- package/es/components/DynamicResizer/assets/topToZero.svg.js +1 -0
- package/es/components/DynamicResizer/hooks/useDrag.js +1 -0
- package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
- package/es/components/DynamicResizer/index.js +1 -0
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloudBackView.js +1 -1
- package/es/components/pointCloudView/PointCloudLayout.js +1 -1
- package/es/components/pointCloudView/PointCloudSideView.js +1 -1
- package/es/index.css +71 -0
- package/es/index.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createBase64WorkerFactory as l}from"./_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js";var Z=l("
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useRef as u}from"react";import f from"./hooks/useDrag.js";const g=i=>{const{minTopHeight:s=0,minBottomHeight:a=0,defaultHeight:o=50,axis:c="y",children:t,localKey:n="dynamicResizerHeights",customDivider:m}=i,r=u(null),{rendered:l,topStyle:d,bottomStyle:y}=f({containerRef:r,minTopHeight:s,minBottomHeight:a,defaultHeight:o,axis:c,localKey:n,customDivider:m});return e.createElement("div",{className:"dynamic-resizer-content",ref:r},e.createElement("div",{className:"dynamic-resizer-top",style:d},t[0]),l,e.createElement("div",{className:"dynamic-resizer-bottom",style:y},t[1]))};export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o,{useCallback as r,useMemo as E}from"react";import y from"react-draggable";import{useLocalStorageState as L}from"ahooks";import k from"./useUpdateHeight.js";import N from"../assets/topToZero.svg.js";import Z from"../assets/bottomToZero.svg.js";const j=y,C=({containerRef:e,minTopHeight:p=0,minBottomHeight:u=0,defaultHeight:h=50,axis:a,localKey:b})=>{const s=b||"dynamicResizerHeights",{topHeight:i,position:l,bounds:c,topStyle:v,bottomStyle:H,updateELHeight:d,setTopHeightToZero:S,setBottomHeightToZero:f}=k(e,p,u,h,s),[P,g]=L(s),T=r(()=>{e.current&&e.current.classList.add("hide-scrollbar")},[e]),m=r((t,D)=>{t.stopPropagation(),d(D.y)},[d]),n=r(t=>{t.stopPropagation(),e.current&&e.current.classList.remove("hide-scrollbar"),g(i)},[e,g,i]);return{rendered:E(()=>{const t=o.createElement("div",{className:"divider"},o.createElement("img",{src:N,className:"divider-top",draggable:"false",onClick:S}),o.createElement("div",{className:"divider-icon",draggable:"false"}),o.createElement("img",{src:Z,className:"divider-bottom",draggable:"false",onClick:f}));return o.createElement(j,{axis:a,position:l,handle:".divider",onStart:T,onDrag:m,onStop:n,bounds:c},t)},[a,l,m,n,c]),topStyle:v,bottomStyle:H}};export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as g,useEffect as y,useMemo as r,useCallback as k}from"react";import{useLocalStorageState as E}from"ahooks";const z=(o,n,m,v,f)=>{const[i,T]=g(0),[H,b]=g(0),[l,M]=g(0),[h,_]=g(0),[x,p]=E(f);y(()=>{Z();const t=x;let e=0;t!=null?e=isNaN(Number(t))?0:Number(t):e=i||v,u(e)},[]);const B=r(()=>({x:0,y:i}),[i]),L=r(()=>{var t;return{top:l,bottom:(((t=o.current)==null?void 0:t.offsetHeight)||0)-h}},[i,o]),S=r(()=>({height:i+"px"}),[i]),N=r(()=>({height:H+"px"}),[H]),Z=()=>{var t,e,s,c;if(o){let a=n,d=m;n>=(((t=o.current)==null?void 0:t.offsetHeight)||0)/2&&(a=(((e=o.current)==null?void 0:e.offsetHeight)||0)/2),m>=(((s=o.current)==null?void 0:s.offsetHeight)||0)/2&&(d=(((c=o.current)==null?void 0:c.offsetHeight)||0)/2),M(a||1e-5),_(d)}},u=k(t=>{var e;if(o){const s=((e=o==null?void 0:o.current)==null?void 0:e.offsetHeight)||0,c=s-h;t>=l&&t<=c&&(T(t),b(s-t))}},[o,l,h]);return{topHeight:i,bottomHeight:H,position:B,bounds:L,topStyle:S,bottomStyle:N,updateELHeight:u,setBottomHeightToZero:()=>{var t;if(o){const e=((t=o==null?void 0:o.current)==null?void 0:t.offsetHeight)||0;u(e-h||0),p(e-h||0)}},setTopHeightToZero:()=>{o&&(u(l||0),p(l||0))}}};export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./DynamicResizer.js";export{default}from"./DynamicResizer.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
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
|
|
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
|
|
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
|
|
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.css
CHANGED
|
@@ -63,6 +63,77 @@
|
|
|
63
63
|
justify-content: space-between;
|
|
64
64
|
margin-top: 16px;
|
|
65
65
|
}
|
|
66
|
+
.dynamic-resizer-content {
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
flex-grow: 0;
|
|
71
|
+
position: relative;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.divider {
|
|
75
|
+
height: 10px;
|
|
76
|
+
width: 100%;
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: -5px;
|
|
79
|
+
left: 0;
|
|
80
|
+
cursor: row-resize;
|
|
81
|
+
user-select: none;
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.divider:hover .divider-top, .divider:hover .divider-bottom {
|
|
89
|
+
display: block;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.divider-top,
|
|
93
|
+
.divider-bottom {
|
|
94
|
+
width: 20px;
|
|
95
|
+
height: 20px;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
display: none;
|
|
98
|
+
user-select: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.divider-icon {
|
|
102
|
+
width: 100%;
|
|
103
|
+
height: 20px;
|
|
104
|
+
position: relative;
|
|
105
|
+
}
|
|
106
|
+
.divider-icon::after {
|
|
107
|
+
content: "";
|
|
108
|
+
display: block;
|
|
109
|
+
position: absolute;
|
|
110
|
+
top: 50%;
|
|
111
|
+
left: 0;
|
|
112
|
+
right: 0;
|
|
113
|
+
width: 90%;
|
|
114
|
+
height: 1px;
|
|
115
|
+
background: #ccc;
|
|
116
|
+
margin: 0 auto;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.dynamic-resizer-top {
|
|
120
|
+
width: 100%;
|
|
121
|
+
overflow-y: auto;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.dynamic-resizer-bottom {
|
|
125
|
+
width: 100%;
|
|
126
|
+
overflow-y: auto;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.hide-scrollbar * {
|
|
130
|
+
scrollbar-width: none; /* Firefox */
|
|
131
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.hide-scrollbar *::-webkit-scrollbar {
|
|
135
|
+
display: none; /* Chrome, Safari, Opera */
|
|
136
|
+
}
|
|
66
137
|
.index-module_latexEditor__0fK8G {
|
|
67
138
|
line-height: 32px;
|
|
68
139
|
background-color: #ededed;
|
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
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useState as
|
|
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:100,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};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.23.0-alpha.
|
|
3
|
+
"version": "1.23.0-alpha.72",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"postcss-url": "^10.1.3",
|
|
58
58
|
"re-resizable": "^6.9.9",
|
|
59
59
|
"react-colorful": "^5.6.1",
|
|
60
|
+
"react-draggable": "^4.4.6",
|
|
60
61
|
"react-i18next": "^11.12.0",
|
|
61
62
|
"react-markdown": "^8.0.7",
|
|
62
63
|
"react-redux": "^7.2.3",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"rollup": "^2.43.1",
|
|
112
113
|
"rollup-plugin-esbuild": "^3.0.2",
|
|
113
114
|
"rollup-plugin-postcss": "^4.0.2",
|
|
115
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
114
116
|
"rollup-plugin-web-worker-loader": "^1.6.1",
|
|
115
117
|
"sass": "^1.53.0",
|
|
116
118
|
"typescript": "^4.2.3"
|