@labelbee/lb-components 1.23.0-alpha.55 → 1.23.0-alpha.56

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"),PointCloudContext=require("../PointCloudContext.js"),useHistory=require("./useHistory.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,e,t)=>e in o?__defProp(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,__spreadValues=(o,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(o,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(o,t,e[t]);return o},__spreadProps=(o,e)=>__defProps(o,__getOwnPropDescs(e));const usePolygon=()=>{const{polygonList:o,setPolygonList:e,selectedID:t}=React.useContext(PointCloudContext.PointCloudContext),{addHistory:l,pushHistoryWithList:a}=useHistory.useHistory(),i=o.find(r=>r.id===t);return{addPolygon:r=>{e(o.concat(r)),l({newPolygon:r})},deletePolygon:r=>{const s=o.filter(n=>n.id!==r).map(n=>__spreadValues({},n));e(s),a({polygonList:s})},selectedPolygon:i,updateSelectedPolygon:r=>{i&&e(o.map(s=>s.id===t?r:s))},updatePolygonValidByID:r=>{o.find(n=>n.id===r)&&e(o.map(n=>n.id===r?__spreadProps(__spreadValues({},n),{valid:!n.valid}):n))}}};exports.usePolygon=usePolygon;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useHistory=require("./useHistory.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,o,t)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,__spreadValues=(e,o)=>{for(var t in o||(o={}))__hasOwnProp.call(o,t)&&__defNormalProp(e,t,o[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(o))__propIsEnum.call(o,t)&&__defNormalProp(e,t,o[t]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o));const usePolygon=()=>{const{polygonList:e,pointCloudBoxList:o,setPolygonList:t,selectedID:a}=React.useContext(PointCloudContext.PointCloudContext),{addHistory:p,pushHistoryWithList:u}=useHistory.useHistory(),d=e.find(r=>r.id===a);return{addPolygon:r=>{t(e.concat(r)),p({newPolygon:r})},deletePolygon:r=>{const i=e.filter(s=>s.id!==r).map(s=>__spreadValues({},s));t(i);const n={polygonList:i};try{const s=o.filter(l=>l.id!==r).map(l=>__spreadValues({},l));s.length<o.length&&(n.pointCloudBoxList=s)}catch(s){console.error("exec update history pointCloudBoxList error:",s)}u(n)},selectedPolygon:d,updateSelectedPolygon:r=>{d&&t(e.map(i=>i.id===a?r:i))},updatePolygonValidByID:r=>{e.find(n=>n.id===r)&&t(e.map(n=>n.id===r?__spreadProps(__spreadValues({},n),{valid:!n.valid}):n))}}};exports.usePolygon=usePolygon;
@@ -1 +1 @@
1
- import{useContext as c}from"react";import{PointCloudContext as P}from"../PointCloudContext.js";import{useHistory as u}from"./useHistory.js";var f=Object.defineProperty,g=Object.defineProperties,_=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,a=(e,o,t)=>o in e?f(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,p=(e,o)=>{for(var t in o||(o={}))m.call(o,t)&&a(e,t,o[t]);if(l)for(var t of l(o))O.call(o,t)&&a(e,t,o[t]);return e},w=(e,o)=>g(e,_(o));const v=()=>{const{polygonList:e,setPolygonList:o,selectedID:t}=c(P),{addHistory:d,pushHistoryWithList:y}=u(),i=e.find(r=>r.id===t);return{addPolygon:r=>{o(e.concat(r)),d({newPolygon:r})},deletePolygon:r=>{const s=e.filter(n=>n.id!==r).map(n=>p({},n));o(s),y({polygonList:s})},selectedPolygon:i,updateSelectedPolygon:r=>{i&&o(e.map(s=>s.id===t?r:s))},updatePolygonValidByID:r=>{e.find(n=>n.id===r)&&o(e.map(n=>n.id===r?w(p({},n),{valid:!n.valid}):n))}}};export{v as usePolygon};
1
+ import{useContext as f}from"react";import{PointCloudContext as g}from"../PointCloudContext.js";import{useHistory as _}from"./useHistory.js";var m=Object.defineProperty,O=Object.defineProperties,w=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,y=(o,t,e)=>t in o?m(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,p=(o,t)=>{for(var e in t||(t={}))x.call(t,e)&&y(o,e,t[e]);if(c)for(var e of c(t))C.call(t,e)&&y(o,e,t[e]);return o},L=(o,t)=>O(o,w(t));const h=()=>{const{polygonList:o,pointCloudBoxList:t,setPolygonList:e,selectedID:a}=f(g),{addHistory:u,pushHistoryWithList:P}=_(),d=o.find(r=>r.id===a);return{addPolygon:r=>{e(o.concat(r)),u({newPolygon:r})},deletePolygon:r=>{const i=o.filter(s=>s.id!==r).map(s=>p({},s));e(i);const n={polygonList:i};try{const s=t.filter(l=>l.id!==r).map(l=>p({},l));s.length<t.length&&(n.pointCloudBoxList=s)}catch(s){console.error("exec update history pointCloudBoxList error:",s)}P(n)},selectedPolygon:d,updateSelectedPolygon:r=>{d&&e(o.map(i=>i.id===a?r:i))},updatePolygonValidByID:r=>{o.find(n=>n.id===r)&&e(o.map(n=>n.id===r?L(p({},n),{valid:!n.valid}):n))}}};export{h as usePolygon};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.23.0-alpha.55",
3
+ "version": "1.23.0-alpha.56",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",