@labelbee/lb-annotation 1.27.0-alpha.59 → 1.27.0-alpha.60

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";var keyCode=require("../../constant/keyCode.js"),rectOperation=require("./rectOperation.js"),reCalcRect=require("./utils/reCalcRect.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,e,t)=>e in r?__defProp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,__spreadValues=(r,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(r,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(r,t,e[t]);return r},__spreadProps=(r,e)=>__defProps(r,__getOwnPropDescs(e));class PointCloud2DRectOperation extends rectOperation.RectOperation{constructor(e){super(e);this.checkMode=e.checkMode}createNewDrawingRect(e,t){this.checkMode||super.createNewDrawingRect(e,t)}deleteSelectedRect(e){if(this.checkMode)return;const{selectedRects:t}=this;t.length&&e.stopPropagation(),this.emit("deleteSelectedRects",t)}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||(this.setSelectedRectID(this.drawingRect.id),this.emit("afterAddingDrawingRect",__spreadValues({},this.selectedRect)))}setSelectedRectID(e){this.checkMode||super.setSelectedRectID(e)}onKeyDown(e){if(this.checkMode||![keyCode.Delete,keyCode.R].includes(e.keyCode))return;super.onKeyDown(e);const{keyCode:t,ctrlKey:s,altKey:i,shiftKey:c,metaKey:n}=e;switch(t){case keyCode.R:{if(s||i||c||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,s=!1){const i=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(i?e:__spreadProps(__spreadValues({},e),{lineDash:[3]}),t,s)}resizeRect(e=100,t=100){var s;if(!this.imgNode||!((s=this.selectedRects)==null?void 0:s.length)||e<=0||t<=0||this.selectedRects[0].width<=e&&this.selectedRects[0].height<=t)return;const{width:i,height:c}=this.basicImgInfo,n={width:i,height:c,x:0,y:0},a=reCalcRect(this.selectedRects[0],n,e,t);a.noChange||(this.setRectList(this.rectList.map(o=>this.selectedIDs.includes(o.id)?__spreadValues(__spreadValues({},o),a):o),!0),this.render(),this.updateDragResult())}rightMouseUp(e){const t=super.rightMouseUp(e);return this.emit("onRightClick",{event:e,targetId:t==null?void 0:t.boxID}),t}}module.exports=PointCloud2DRectOperation;
1
+ "use strict";var keyCode=require("../../constant/keyCode.js"),rectOperation=require("./rectOperation.js"),reCalcRect=require("./utils/reCalcRect.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,e,t)=>e in r?__defProp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,__spreadValues=(r,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(r,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(r,t,e[t]);return r},__spreadProps=(r,e)=>__defProps(r,__getOwnPropDescs(e));class PointCloud2DRectOperation extends rectOperation.RectOperation{constructor(e){super(e);this.checkMode=e.checkMode}createNewDrawingRect(e,t){this.checkMode||super.createNewDrawingRect(e,t)}deleteSelectedRect(e){if(this.checkMode)return;const{selectedRects:t}=this;t.length&&e.stopPropagation(),this.emit("deleteSelectedRects",t)}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||(this.setSelectedRectID(this.drawingRect.id),this.emit("afterAddingDrawingRect",__spreadValues({},this.selectedRect)))}setSelectedRectID(e){this.checkMode||super.setSelectedRectID(e)}onKeyDown(e){if(this.checkMode||![keyCode.Delete,keyCode.R].includes(e.keyCode))return;super.onKeyDown(e);const{keyCode:t,ctrlKey:s,altKey:i,shiftKey:c,metaKey:n}=e;switch(t){case keyCode.R:{if(s||i||c||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,s=!1){const i=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(i?e:__spreadProps(__spreadValues({},e),{lineDash:[3]}),t,s)}resizeRect(e=100,t=100){var s;if(!this.imgNode||!((s=this.selectedRects)==null?void 0:s.length)||e<=0||t<=0||this.selectedRects[0].width<=e&&this.selectedRects[0].height<=t)return;const{width:i,height:c}=this.basicImgInfo,n={width:i,height:c,x:0,y:0},a=reCalcRect(this.selectedRects[0],n,e,t);a.noChange||(this.setRectList(this.rectList.map(o=>this.selectedIDs.includes(o.id)?__spreadValues(__spreadValues({},o),a):o),!0),this.render(),this.updateDragResult())}rightMouseUp(e){const t=super.rightMouseUp(e);return this.emit("onRightClick",{event:e,targetId:t==null?void 0:t.boxID,id:t==null?void 0:t.id}),t}}module.exports=PointCloud2DRectOperation;
@@ -1 +1 @@
1
- import d from"../../constant/keyCode.js";import{RectOperation as p}from"./rectOperation.js";import f from"./utils/reCalcRect.js";var R=Object.defineProperty,g=Object.defineProperties,w=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,u=(r,e,t)=>e in r?R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,c=(r,e)=>{for(var t in e||(e={}))D.call(e,t)&&u(r,t,e[t]);if(h)for(var t of h(e))m.call(e,t)&&u(r,t,e[t]);return r},_=(r,e)=>g(r,w(e));class y extends p{constructor(e){super(e);this.checkMode=e.checkMode}createNewDrawingRect(e,t){this.checkMode||super.createNewDrawingRect(e,t)}deleteSelectedRect(e){if(this.checkMode)return;const{selectedRects:t}=this;t.length&&e.stopPropagation(),this.emit("deleteSelectedRects",t)}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||(this.setSelectedRectID(this.drawingRect.id),this.emit("afterAddingDrawingRect",c({},this.selectedRect)))}setSelectedRectID(e){this.checkMode||super.setSelectedRectID(e)}onKeyDown(e){if(this.checkMode||![d.Delete,d.R].includes(e.keyCode))return;super.onKeyDown(e);const{keyCode:t,ctrlKey:s,altKey:i,shiftKey:o,metaKey:n}=e;switch(t){case d.R:{if(s||i||o||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,s=!1){const i=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(i?e:_(c({},e),{lineDash:[3]}),t,s)}resizeRect(e=100,t=100){var s;if(!this.imgNode||!((s=this.selectedRects)==null?void 0:s.length)||e<=0||t<=0||this.selectedRects[0].width<=e&&this.selectedRects[0].height<=t)return;const{width:i,height:o}=this.basicImgInfo,n={width:i,height:o,x:0,y:0},l=f(this.selectedRects[0],n,e,t);l.noChange||(this.setRectList(this.rectList.map(a=>this.selectedIDs.includes(a.id)?c(c({},a),l):a),!0),this.render(),this.updateDragResult())}rightMouseUp(e){const t=super.rightMouseUp(e);return this.emit("onRightClick",{event:e,targetId:t==null?void 0:t.boxID}),t}}export{y as default};
1
+ import a from"../../constant/keyCode.js";import{RectOperation as p}from"./rectOperation.js";import f from"./utils/reCalcRect.js";var R=Object.defineProperty,g=Object.defineProperties,w=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,h=(r,e,t)=>e in r?R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,c=(r,e)=>{for(var t in e||(e={}))D.call(e,t)&&h(r,t,e[t]);if(u)for(var t of u(e))m.call(e,t)&&h(r,t,e[t]);return r},_=(r,e)=>g(r,w(e));class y extends p{constructor(e){super(e);this.checkMode=e.checkMode}createNewDrawingRect(e,t){this.checkMode||super.createNewDrawingRect(e,t)}deleteSelectedRect(e){if(this.checkMode)return;const{selectedRects:t}=this;t.length&&e.stopPropagation(),this.emit("deleteSelectedRects",t)}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||(this.setSelectedRectID(this.drawingRect.id),this.emit("afterAddingDrawingRect",c({},this.selectedRect)))}setSelectedRectID(e){this.checkMode||super.setSelectedRectID(e)}onKeyDown(e){if(this.checkMode||![a.Delete,a.R].includes(e.keyCode))return;super.onKeyDown(e);const{keyCode:t,ctrlKey:s,altKey:i,shiftKey:o,metaKey:n}=e;switch(t){case a.R:{if(s||i||o||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,s=!1){const i=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(i?e:_(c({},e),{lineDash:[3]}),t,s)}resizeRect(e=100,t=100){var s;if(!this.imgNode||!((s=this.selectedRects)==null?void 0:s.length)||e<=0||t<=0||this.selectedRects[0].width<=e&&this.selectedRects[0].height<=t)return;const{width:i,height:o}=this.basicImgInfo,n={width:i,height:o,x:0,y:0},l=f(this.selectedRects[0],n,e,t);l.noChange||(this.setRectList(this.rectList.map(d=>this.selectedIDs.includes(d.id)?c(c({},d),l):d),!0),this.render(),this.updateDragResult())}rightMouseUp(e){const t=super.rightMouseUp(e);return this.emit("onRightClick",{event:e,targetId:t==null?void 0:t.boxID,id:t==null?void 0:t.id}),t}}export{y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-annotation",
3
- "version": "1.27.0-alpha.59",
3
+ "version": "1.27.0-alpha.60",
4
4
  "description": "Annotation tool collection",
5
5
  "keywords": [
6
6
  "annotation",