@labelbee/lb-components 1.23.0-alpha.140 → 1.23.0-alpha.142

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
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ctx=require("../../../store/ctx.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),actionCreators=require("../../../store/annotation/actionCreators.js"),usePointCloudViews=require("./usePointCloudViews.js"),useSphere=require("./useSphere.js"),useHistory=require("./useHistory.js"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js");const PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},useUpdatePointCloudColor=(v,d)=>{const l=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:u,selectedIDs:i,pointCloudBoxList:s,mainViewInstance:c,selectedID:g}=l,f=ctx.useDispatch(),{selectedSphere:C}=useSphere.useSphere(),{syncPointCloudViews:p,syncPointCloudPoint:P,generateRects:h}=usePointCloudViews.usePointCloudViews({setResourceLoading:v}),{selectedBox:a,updateSelectedBox:x}=useSingleBox.useSingleBox({generateRects:h}),{pushHistoryWithList:V}=useHistory.useHistory(),q=({newSelectedSphere:n,newSphereList:o})=>{const e=u==null?void 0:u.toolInstance;if((n||C)&&i.length===1){const t=n!=null?n:C;e.setSelectedID(i[0]);const r=e.selectedPoint;t&&(P==null||P(PointCloudView.Top,r,t,void 0,o,d))}},y=({trigger:n,newSelectedBox:o})=>{const e=u==null?void 0:u.toolInstance;if(!(i.length===0||!e)&&(o||(a==null?void 0:a.info))){const t=o!=null?o:a==null?void 0:a.info,r=o;if(t){p==null||p({omitView:PointCloudView.Top,polygon:r,boxParams:t},n);return}}};return{updatePointCloudColor:n=>{if(s.forEach(o=>{var e,t,r;if(o&&i.includes(o.id)){o.attribute=n;const S=f(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[o],stepConfig:d,action:"viewUpdateBox"}));o.valid=S[0].valid,x(o),(r=(t=(e=l==null?void 0:l.topViewInstance)==null?void 0:e.pointCloud2dOperation)==null?void 0:t.setPolygonValidAndRender)==null||r.call(t,o.id,!0,o.valid),q({})}}),c){const o=i&&i.length>1?ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.MulitSelect:ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single;l.syncAllViewPointCloudColor(o,s),s.forEach(e=>{y({trigger:o,newSelectedBox:e})}),c.generateBoxes(s)}g||V({pointCloudBoxList:s})}}};exports.useUpdatePointCloudColor=useUpdatePointCloudColor;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ctx=require("../../../store/ctx.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),actionCreators=require("../../../store/annotation/actionCreators.js"),usePointCloudViews=require("./usePointCloudViews.js"),useSphere=require("./useSphere.js"),useHistory=require("./useHistory.js"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js");const PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},useUpdatePointCloudColor=(v,a)=>{const l=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:u,selectedIDs:t,pointCloudBoxList:s,mainViewInstance:c,selectedID:g}=l,f=ctx.useDispatch(),{selectedSphere:C}=useSphere.useSphere(),{syncPointCloudViews:p,syncPointCloudPoint:P,generateRects:h}=usePointCloudViews.usePointCloudViews({setResourceLoading:v}),{selectedBox:d,updateSelectedBox:x}=useSingleBox.useSingleBox({generateRects:h}),{pushHistoryWithList:V}=useHistory.useHistory(),q=({newSelectedSphere:i,newSphereList:o})=>{const n=u==null?void 0:u.toolInstance;if((i||C)&&t.length===1){const e=i!=null?i:C;n.setSelectedID(t[0]);const r=n.selectedPoint;e&&(P==null||P(PointCloudView.Top,r,e,void 0,o,a))}},y=({trigger:i,newSelectedBox:o})=>{const n=u==null?void 0:u.toolInstance;if(!(t.length===0||!n)&&(o||(d==null?void 0:d.info))){const e=o!=null?o:d==null?void 0:d.info,r=o;if(e){p==null||p({omitView:PointCloudView.Top,polygon:r,boxParams:e},i);return}}};return{updatePointCloudColor:i=>{if(s.forEach(o=>{var n,e,r;if(o&&t.includes(o.id)){o.attribute=i;const S=f(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[o],stepConfig:a,action:"viewUpdateBox"}));o.valid=S[0].valid,x(o),(r=(e=(n=l==null?void 0:l.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:e.setPolygonValidAndRender)==null||r.call(e,o.id,!0,o.valid),q({})}}),c){const o=t&&t.length>1?ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.MulitSelect:ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single;if(l.syncAllViewPointCloudColor(o,s),t&&t.length===1){const n=s.find(e=>e.id===t[0]);y({trigger:o,newSelectedBox:n})}c.generateBoxes(s)}g||V({pointCloudBoxList:s})}}};exports.useUpdatePointCloudColor=useUpdatePointCloudColor;
@@ -1 +1 @@
1
- import{useContext as w}from"react";import{useDispatch as D}from"../../../store/ctx.js";import{useSingleBox as b}from"./useSingleBox.js";import{PointCloudContext as T}from"../PointCloudContext.js";import{EPointCloudName as R}from"@labelbee/lb-annotation";import{PreDataProcess as E}from"../../../store/annotation/actionCreators.js";import{usePointCloudViews as H}from"./usePointCloudViews.js";import{useSphere as L}from"./useSphere.js";import{useHistory as _}from"./useHistory.js";import{EPointCloudBoxRenderTrigger as f}from"../../../utils/ToolPointCloudBoxRenderHelper.js";const P={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},k=(v,a)=>{const r=w(T),{topViewInstance:d,selectedIDs:e,pointCloudBoxList:l,mainViewInstance:c,selectedID:g}=r,h=D(),{selectedSphere:p}=L(),{syncPointCloudViews:C,syncPointCloudPoint:m,generateRects:V}=H({setResourceLoading:v}),{selectedBox:u,updateSelectedBox:j}=b({generateRects:V}),{pushHistoryWithList:x}=_(),y=({newSelectedSphere:n,newSphereList:o})=>{const t=d==null?void 0:d.toolInstance;if((n||p)&&e.length===1){const i=n!=null?n:p;t.setSelectedID(e[0]);const s=t.selectedPoint;i&&(m==null||m(P.Top,s,i,void 0,o,a))}},I=({trigger:n,newSelectedBox:o})=>{const t=d==null?void 0:d.toolInstance;if(!(e.length===0||!t)&&(o||(u==null?void 0:u.info))){const i=o!=null?o:u==null?void 0:u.info,s=o;if(i){C==null||C({omitView:P.Top,polygon:s,boxParams:i},n);return}}};return{updatePointCloudColor:n=>{if(l.forEach(o=>{var t,i,s;if(o&&e.includes(o.id)){o.attribute=n;const S=h(E({tool:R.PointCloud,dataList:[o],stepConfig:a,action:"viewUpdateBox"}));o.valid=S[0].valid,j(o),(s=(i=(t=r==null?void 0:r.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null?void 0:i.setPolygonValidAndRender)==null||s.call(i,o.id,!0,o.valid),y({})}}),c){const o=e&&e.length>1?f.MulitSelect:f.Single;r.syncAllViewPointCloudColor(o,l),l.forEach(t=>{I({trigger:o,newSelectedBox:t})}),c.generateBoxes(l)}g||x({pointCloudBoxList:l})}}};export{k as useUpdatePointCloudColor};
1
+ import{useContext as w}from"react";import{useDispatch as D}from"../../../store/ctx.js";import{useSingleBox as b}from"./useSingleBox.js";import{PointCloudContext as T}from"../PointCloudContext.js";import{EPointCloudName as R}from"@labelbee/lb-annotation";import{PreDataProcess as H}from"../../../store/annotation/actionCreators.js";import{usePointCloudViews as E}from"./usePointCloudViews.js";import{useSphere as L}from"./useSphere.js";import{useHistory as _}from"./useHistory.js";import{EPointCloudBoxRenderTrigger as f}from"../../../utils/ToolPointCloudBoxRenderHelper.js";const P={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},k=(g,a)=>{const r=w(T),{topViewInstance:d,selectedIDs:i,pointCloudBoxList:l,mainViewInstance:c,selectedID:v}=r,h=D(),{selectedSphere:p}=L(),{syncPointCloudViews:C,syncPointCloudPoint:m,generateRects:V}=E({setResourceLoading:g}),{selectedBox:u,updateSelectedBox:j}=b({generateRects:V}),{pushHistoryWithList:x}=_(),y=({newSelectedSphere:e,newSphereList:o})=>{const n=d==null?void 0:d.toolInstance;if((e||p)&&i.length===1){const t=e!=null?e:p;n.setSelectedID(i[0]);const s=n.selectedPoint;t&&(m==null||m(P.Top,s,t,void 0,o,a))}},I=({trigger:e,newSelectedBox:o})=>{const n=d==null?void 0:d.toolInstance;if(!(i.length===0||!n)&&(o||(u==null?void 0:u.info))){const t=o!=null?o:u==null?void 0:u.info,s=o;if(t){C==null||C({omitView:P.Top,polygon:s,boxParams:t},e);return}}};return{updatePointCloudColor:e=>{if(l.forEach(o=>{var n,t,s;if(o&&i.includes(o.id)){o.attribute=e;const S=h(H({tool:R.PointCloud,dataList:[o],stepConfig:a,action:"viewUpdateBox"}));o.valid=S[0].valid,j(o),(s=(t=(n=r==null?void 0:r.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:t.setPolygonValidAndRender)==null||s.call(t,o.id,!0,o.valid),y({})}}),c){const o=i&&i.length>1?f.MulitSelect:f.Single;if(r.syncAllViewPointCloudColor(o,l),i&&i.length===1){const n=l.find(t=>t.id===i[0]);I({trigger:o,newSelectedBox:n})}c.generateBoxes(l)}v||x({pointCloudBoxList:l})}}};export{k as useUpdatePointCloudColor};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.23.0-alpha.140",
3
+ "version": "1.23.0-alpha.142",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@ant-design/icons": "^4.6.2",
46
- "@labelbee/lb-annotation": "1.27.0-alpha.70",
46
+ "@labelbee/lb-annotation": "1.27.0-alpha.71",
47
47
  "@labelbee/lb-utils": "1.19.0-alpha.27",
48
48
  "@labelbee/wavesurfer": "1.1.0-alpha.1",
49
49
  "@types/react-dom": "^18.2.7",