@labelbee/lb-annotation 1.27.0-alpha.46 → 1.27.0-alpha.47

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:c,shiftKey:i,metaKey:n}=e;switch(t){case keyCode.R:{if(s||c||i||n)return;this.resizeRect();break}}return!0}getComputedDrawingRect(e){const t="extId";return(e==null?void 0:e.boxID)||(e==null?void 0:e[t])?e:__spreadProps(__spreadValues({},e),{lineDash:[3]})}renderDrawingRect(e,t=this.zoom,s=!1){const c=this.getComputedDrawingRect(e);super.renderDrawingRect(c,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:c,height:i}=this.basicImgInfo,n={width:c,height:i,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())}}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:c,shiftKey:i,metaKey:n}=e;switch(t){case keyCode.R:{if(s||c||i||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,s=!1){const c=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(c?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:c,height:i}=this.basicImgInfo,n={width:c,height:i,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())}}module.exports=PointCloud2DRectOperation;
@@ -13,7 +13,6 @@ declare class PointCloud2DRectOperation extends RectOperation {
13
13
  setSelectedIdAfterAddingDrawingRect(): void;
14
14
  setSelectedRectID(newID?: string): void;
15
15
  onKeyDown(e: KeyboardEvent): true | undefined;
16
- private getComputedDrawingRect;
17
16
  renderDrawingRect(rect: IPointCloud2DRectOperationViewRect & IRect, zoom?: number, isZoom?: boolean): void;
18
17
  resizeRect(resizeWidth?: number, resizeHeight?: number): void;
19
18
  }
@@ -1 +1 @@
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,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,i=(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},y=(r,e)=>g(r,w(e));class _ 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",i({},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:c,shiftKey:n,metaKey:o}=e;switch(t){case a.R:{if(s||c||n||o)return;this.resizeRect();break}}return!0}getComputedDrawingRect(e){const t="extId";return(e==null?void 0:e.boxID)||(e==null?void 0:e[t])?e:y(i({},e),{lineDash:[3]})}renderDrawingRect(e,t=this.zoom,s=!1){const c=this.getComputedDrawingRect(e);super.renderDrawingRect(c,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:c,height:n}=this.basicImgInfo,o={width:c,height:n,x:0,y:0},l=f(this.selectedRects[0],o,e,t);l.noChange||(this.setRectList(this.rectList.map(d=>this.selectedIDs.includes(d.id)?i(i({},d),l):d),!0),this.render(),this.updateDragResult())}}export{_ as default};
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,i=(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",i({},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:c,shiftKey:n,metaKey:o}=e;switch(t){case d.R:{if(s||c||n||o)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,s=!1){const c=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(c?e:_(i({},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:c,height:n}=this.basicImgInfo,o={width:c,height:n,x:0,y:0},l=f(this.selectedRects[0],o,e,t);l.noChange||(this.setRectList(this.rectList.map(a=>this.selectedIDs.includes(a.id)?i(i({},a),l):a),!0),this.render(),this.updateDragResult())}}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.46",
3
+ "version": "1.27.0-alpha.47",
4
4
  "description": "Annotation tool collection",
5
5
  "keywords": [
6
6
  "annotation",