@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.
- package/dist/_virtual/2DViewWorker.js +1 -0
- package/dist/_virtual/highlightSegmentWorker.js +1 -1
- 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.js +1 -1
- package/dist/types/components/pointCloudView/2DViewWorker.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +1 -0
- package/es/_virtual/2DViewWorker.js +1 -0
- package/es/_virtual/highlightSegmentWorker.js +1 -1
- 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.js +1 -1
- package/package.json +2 -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};
|
|
@@ -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.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};
|
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.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"
|