@labelbee/lb-annotation 1.14.0-alpha.2 → 1.14.0-alpha.3

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.
Files changed (187) hide show
  1. package/dist/_virtual/MathUtilsWorker.js +8 -1
  2. package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +35 -2
  3. package/dist/_virtual/filterBoxWorker.js +8 -1
  4. package/dist/_virtual/highlightWorker.js +8 -1
  5. package/dist/assets/attributeIcon/icon_canvasEdit0.svg.js +5 -1
  6. package/dist/assets/attributeIcon/icon_canvasEdit1.svg.js +5 -1
  7. package/dist/assets/attributeIcon/icon_canvasEdit2.svg.js +5 -1
  8. package/dist/assets/attributeIcon/icon_canvasEdit3.svg.js +5 -1
  9. package/dist/assets/attributeIcon/icon_canvasEdit4.svg.js +5 -1
  10. package/dist/assets/attributeIcon/icon_canvasEdit5.svg.js +5 -1
  11. package/dist/assets/attributeIcon/icon_canvasEdit6.svg.js +5 -1
  12. package/dist/assets/attributeIcon/icon_canvasEdit7.svg.js +5 -1
  13. package/dist/assets/attributeIcon/icon_canvasEdit8.svg.js +5 -1
  14. package/dist/assets/attributeIcon/icon_canvasEdit_miss.svg.js +5 -1
  15. package/dist/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -5
  16. package/dist/assets/attributeIcon/icon_cuboidLeft.svg.js +5 -7
  17. package/dist/assets/attributeIcon/icon_cuboidMore.svg.js +5 -5
  18. package/dist/assets/attributeIcon/icon_cuboidRight.svg.js +5 -5
  19. package/dist/assets/attributeIcon/icon_cuboidTop.svg.js +5 -12
  20. package/dist/assets/attributeIcon/icon_editFEN.svg.js +5 -1
  21. package/dist/assets/attributeIcon/icon_editHUANG.svg.js +5 -1
  22. package/dist/assets/attributeIcon/icon_editLAN.svg.js +5 -1
  23. package/dist/assets/attributeIcon/icon_editLV.svg.js +5 -1
  24. package/dist/assets/attributeIcon/icon_editQING.svg.js +5 -1
  25. package/dist/constant/annotation.js +127 -1
  26. package/dist/constant/annotationTask.js +30 -1
  27. package/dist/constant/defaultConfig.js +266 -1
  28. package/dist/constant/keyCode.js +38 -1
  29. package/dist/constant/style.js +98 -1
  30. package/dist/constant/tool.js +236 -1
  31. package/dist/core/index.js +150 -1
  32. package/dist/core/pointCloud/OrbitControls.js +665 -1
  33. package/dist/core/pointCloud/PCDLoader.js +260 -2
  34. package/dist/core/pointCloud/annotation.js +215 -1
  35. package/dist/core/pointCloud/cache.js +53 -1
  36. package/dist/core/pointCloud/index.js +991 -5
  37. package/dist/core/pointCloud/matrix.js +138 -1
  38. package/dist/core/pointCloud/segmentation.js +144 -0
  39. package/dist/core/pointCloud/selector/Sse3dLassoSelector.js +26 -0
  40. package/dist/core/pointCloud/selector/Sse3dSelector.js +16 -0
  41. package/dist/core/scheduler.js +233 -1
  42. package/dist/core/toolOperation/LineToolOperation.js +1434 -1
  43. package/dist/core/toolOperation/ScribbleTool.js +292 -1
  44. package/dist/core/toolOperation/TextToolOperation.js +131 -1
  45. package/dist/core/toolOperation/ViewOperation.js +556 -1
  46. package/dist/core/toolOperation/basicToolOperation.js +881 -1
  47. package/dist/core/toolOperation/checkOperation.js +208 -1
  48. package/dist/core/toolOperation/cuboidOperation.js +754 -1
  49. package/dist/core/toolOperation/cuboidToggleButtonClass.js +152 -7
  50. package/dist/core/toolOperation/eventListener.js +37 -1
  51. package/dist/core/toolOperation/measureOperation.js +41 -1
  52. package/dist/core/toolOperation/pointCloud2dOperation.js +365 -1
  53. package/dist/core/toolOperation/pointOperation.js +696 -1
  54. package/dist/core/toolOperation/polygonOperation.js +1251 -1
  55. package/dist/core/toolOperation/rectOperation.js +1233 -1
  56. package/dist/core/toolOperation/segmentByRect.js +174 -1
  57. package/dist/core/toolOperation/tagOperation.js +201 -3
  58. package/dist/core/toolOperation/textAttributeClass.js +182 -16
  59. package/dist/index.js +185 -1
  60. package/dist/locales/constants.js +24 -1
  61. package/dist/locales/en_US/message.js +25 -1
  62. package/dist/locales/index.js +19 -1
  63. package/dist/locales/zh_CN/message.js +25 -1
  64. package/dist/newCore/CanvasScheduler.js +35 -1
  65. package/dist/types/core/pointCloud/segmentation.d.ts +0 -0
  66. package/dist/types/core/pointCloud/selector/Sse3dLassoSelector.d.ts +0 -0
  67. package/dist/types/core/pointCloud/selector/Sse3dSelector.d.ts +0 -0
  68. package/dist/utils/ActionsHistory.js +84 -1
  69. package/dist/utils/ImgUtils.js +23 -1
  70. package/dist/utils/MathUtils.js +385 -2
  71. package/dist/utils/VectorUtils.js +25 -1
  72. package/dist/utils/tool/AttributeUtils.js +218 -1
  73. package/dist/utils/tool/AxisUtils.js +340 -1
  74. package/dist/utils/tool/CanvasUtils.js +62 -1
  75. package/dist/utils/tool/CommonToolUtils.js +174 -1
  76. package/dist/utils/tool/CuboidUtils.js +704 -1
  77. package/dist/utils/tool/DblClickEventListener.js +102 -1
  78. package/dist/utils/tool/DrawUtils.js +492 -3
  79. package/dist/utils/tool/EnhanceCommonToolUtils.js +53 -1
  80. package/dist/utils/tool/ImgPosUtils.js +58 -1
  81. package/dist/utils/tool/LineToolUtils.js +261 -1
  82. package/dist/utils/tool/MarkerUtils.js +56 -1
  83. package/dist/utils/tool/PolygonUtils.js +460 -1
  84. package/dist/utils/tool/RectUtils.js +155 -1
  85. package/dist/utils/tool/RenderDomClass.js +57 -7
  86. package/dist/utils/tool/RenderDomUtils.js +21 -4
  87. package/dist/utils/tool/StyleUtils.js +31 -1
  88. package/dist/utils/tool/TagUtils.js +129 -1
  89. package/dist/utils/tool/UnitUtils.js +12 -1
  90. package/dist/utils/tool/ZoomUtils.js +72 -1
  91. package/dist/utils/tool/polygonTool.js +133 -1
  92. package/dist/utils/uuid.js +26 -1
  93. package/es/_virtual/MathUtilsWorker.js +6 -1
  94. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
  95. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
  96. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -2
  97. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
  98. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
  99. package/es/_virtual/filterBoxWorker.js +6 -1
  100. package/es/_virtual/highlightWorker.js +6 -1
  101. package/es/assets/attributeIcon/icon_canvasEdit0.svg.js +3 -1
  102. package/es/assets/attributeIcon/icon_canvasEdit1.svg.js +3 -1
  103. package/es/assets/attributeIcon/icon_canvasEdit2.svg.js +3 -1
  104. package/es/assets/attributeIcon/icon_canvasEdit3.svg.js +3 -1
  105. package/es/assets/attributeIcon/icon_canvasEdit4.svg.js +3 -1
  106. package/es/assets/attributeIcon/icon_canvasEdit5.svg.js +3 -1
  107. package/es/assets/attributeIcon/icon_canvasEdit6.svg.js +3 -1
  108. package/es/assets/attributeIcon/icon_canvasEdit7.svg.js +3 -1
  109. package/es/assets/attributeIcon/icon_canvasEdit8.svg.js +3 -1
  110. package/es/assets/attributeIcon/icon_canvasEdit_miss.svg.js +3 -1
  111. package/es/assets/attributeIcon/icon_cuboidFAB.svg.js +3 -5
  112. package/es/assets/attributeIcon/icon_cuboidLeft.svg.js +3 -7
  113. package/es/assets/attributeIcon/icon_cuboidMore.svg.js +3 -5
  114. package/es/assets/attributeIcon/icon_cuboidRight.svg.js +3 -5
  115. package/es/assets/attributeIcon/icon_cuboidTop.svg.js +3 -12
  116. package/es/assets/attributeIcon/icon_editFEN.svg.js +3 -1
  117. package/es/assets/attributeIcon/icon_editHUANG.svg.js +3 -1
  118. package/es/assets/attributeIcon/icon_editLAN.svg.js +3 -1
  119. package/es/assets/attributeIcon/icon_editLV.svg.js +3 -1
  120. package/es/assets/attributeIcon/icon_editQING.svg.js +3 -1
  121. package/es/constant/annotation.js +113 -1
  122. package/es/constant/annotationTask.js +25 -1
  123. package/es/constant/defaultConfig.js +260 -1
  124. package/es/constant/keyCode.js +36 -1
  125. package/es/constant/style.js +74 -1
  126. package/es/constant/tool.js +220 -1
  127. package/es/core/index.js +148 -1
  128. package/es/core/pointCloud/OrbitControls.js +661 -1
  129. package/es/core/pointCloud/PCDLoader.js +256 -2
  130. package/es/core/pointCloud/annotation.js +211 -1
  131. package/es/core/pointCloud/cache.js +49 -1
  132. package/es/core/pointCloud/index.js +962 -5
  133. package/es/core/pointCloud/matrix.js +109 -1
  134. package/es/core/pointCloud/segmentation.js +120 -0
  135. package/es/core/pointCloud/selector/Sse3dLassoSelector.js +24 -0
  136. package/es/core/pointCloud/selector/Sse3dSelector.js +14 -0
  137. package/es/core/scheduler.js +228 -1
  138. package/es/core/toolOperation/LineToolOperation.js +1421 -1
  139. package/es/core/toolOperation/ScribbleTool.js +290 -1
  140. package/es/core/toolOperation/TextToolOperation.js +129 -1
  141. package/es/core/toolOperation/ViewOperation.js +549 -1
  142. package/es/core/toolOperation/basicToolOperation.js +877 -1
  143. package/es/core/toolOperation/checkOperation.js +206 -1
  144. package/es/core/toolOperation/cuboidOperation.js +752 -1
  145. package/es/core/toolOperation/cuboidToggleButtonClass.js +150 -7
  146. package/es/core/toolOperation/eventListener.js +35 -1
  147. package/es/core/toolOperation/measureOperation.js +39 -1
  148. package/es/core/toolOperation/pointCloud2dOperation.js +359 -1
  149. package/es/core/toolOperation/pointOperation.js +690 -1
  150. package/es/core/toolOperation/polygonOperation.js +1245 -1
  151. package/es/core/toolOperation/rectOperation.js +1228 -1
  152. package/es/core/toolOperation/scribbleTool2.js +249 -0
  153. package/es/core/toolOperation/segmentByRect.js +172 -1
  154. package/es/core/toolOperation/tagOperation.js +199 -3
  155. package/es/core/toolOperation/textAttributeClass.js +180 -16
  156. package/es/index.js +46 -1
  157. package/es/locales/constants.js +22 -1
  158. package/es/locales/en_US/message.js +23 -1
  159. package/es/locales/index.js +17 -1
  160. package/es/locales/zh_CN/message.js +23 -1
  161. package/es/newCore/CanvasScheduler.js +31 -1
  162. package/es/utils/ActionsHistory.js +78 -1
  163. package/es/utils/ImgUtils.js +21 -1
  164. package/es/utils/MathUtils.js +380 -2
  165. package/es/utils/VectorUtils.js +23 -1
  166. package/es/utils/tool/AttributeUtils.js +212 -1
  167. package/es/utils/tool/AxisUtils.js +335 -1
  168. package/es/utils/tool/CanvasUtils.js +60 -1
  169. package/es/utils/tool/CommonToolUtils.js +172 -1
  170. package/es/utils/tool/CuboidUtils.js +680 -1
  171. package/es/utils/tool/DblClickEventListener.js +100 -1
  172. package/es/utils/tool/DrawUtils.js +490 -3
  173. package/es/utils/tool/EnhanceCommonToolUtils.js +48 -1
  174. package/es/utils/tool/ImgPosUtils.js +56 -1
  175. package/es/utils/tool/LineToolUtils.js +255 -1
  176. package/es/utils/tool/MarkerUtils.js +54 -1
  177. package/es/utils/tool/PolygonUtils.js +458 -1
  178. package/es/utils/tool/RectUtils.js +153 -1
  179. package/es/utils/tool/RenderDomClass.js +55 -7
  180. package/es/utils/tool/RenderDomUtils.js +19 -4
  181. package/es/utils/tool/StyleUtils.js +29 -1
  182. package/es/utils/tool/TagUtils.js +127 -1
  183. package/es/utils/tool/UnitUtils.js +10 -1
  184. package/es/utils/tool/ZoomUtils.js +70 -1
  185. package/es/utils/tool/polygonTool.js +126 -1
  186. package/es/utils/uuid.js +24 -1
  187. package/package.json +7 -5
@@ -1 +1,174 @@
1
- "use strict";var lbUtils=require("@labelbee/lb-utils"),AxisUtils=require("../../utils/tool/AxisUtils.js"),rectOperation=require("./rectOperation.js"),keyCode=require("../../constant/keyCode.js"),__async=(u,e,t)=>new Promise((i,c)=>{var r=s=>{try{o(t.next(s))}catch(h){c(h)}},n=s=>{try{o(t.throw(s))}catch(h){c(h)}},o=s=>s.done?i(s.value):Promise.resolve(s.value).then(r,n);o((t=t.apply(u,e)).next())});class SegmentByRect extends rectOperation.RectOperation{constructor(e){super(e);this.onKeydown=t=>{switch(t.keyCode){case keyCode.Esc:t.preventDefault(),t.stopPropagation(),this.clearPredictionInfo();break;case keyCode.Z:t.ctrlKey&&(t.preventDefault(),t.stopPropagation(),this.rectList=[],this.render());break}},this.segmentPrediction=t=>__async(this,null,function*(){const i=this.getCoordinateUnderZoom(t);if(this.isRunSegment=!0,this.render(),!this.runPrediction){this.emit("messageError","You needs to set runPrediction function"),this.clearPredictionInfo();return}yield this.runPrediction({point:i,rect:{x:this.rectList[0].x,y:this.rectList[0].y,w:this.rectList[0].width,h:this.rectList[0].height}}),this.clearPredictionInfo()}),this.isRunSegment=!1,this.runPrediction=e.runPrediction}setRunPrediction(e){this.runPrediction=e}eventBinding(){document.addEventListener("keydown",e=>this.onKeydown(e)),super.eventBinding()}clearPredictionInfo(){this.rectList=[],this.isShowCursor=!1,this.coord={x:-1,y:-1},this.drawingRect=void 0,this.isRunSegment=!1,this.clearCanvas(),this.render()}onMouseUp(e){if(!this.isRunSegment){if(e.button===0&&this.rectList.length===1&&!this.isRunSegment){e.stopPropagation(),this.segmentPrediction(e),this.clearActiveStatus();return}super.onMouseUp(e)}}onMouseDown(e){this.isRunSegment||super.onMouseDown(e)}renderCursorLine(){var e;if(!this.ctx)return;const{ctx:t}=this,i=10,c=1,{x:r,y:n}=this.coord;t.save(),t.strokeStyle="white",t.setLineDash([6]),t.lineWidth=c,t.strokeRect(r-i,n-i,i*2,i*2),t.restore();let o=`\u2460 ${lbUtils.i18n.t("FramingOfObjectToBeDivided")}`;const s=lbUtils.i18n.language==="en";let h=s?326:186;if(((e=this.rectList)==null?void 0:e.length)===1){o=`\u2461 ${lbUtils.i18n.t("ClickOnTarget")}`,h=s?232:142;const a=2;t.save(),t.strokeStyle="white";const l=c+i;t.beginPath(),t.moveTo(r+l+a*2,n+l+a),t.arc(r+l+a,n+l+a,a,0,Math.PI*2,!0),t.stroke(),t.restore()}this.isRunSegment&&(h=s?316:136,o=lbUtils.i18n.t("SplittingAlgorithmPrediction")),t.save(),t.fillStyle=this.style.strokeColor,t.fillRect(r+i,n-i*4-1,h,32),t.restore(),t.save(),t.font="14px Source Han Sans CN",t.fillStyle="white",t.fillText(o,r+i+14,n-i*2),t.restore(),super.renderCursorLine()}renderDrawingRect(e,t,i=!1){if(this.ctx&&e){const c=AxisUtils.default.changeRectByZoom(e,i?t:this.zoom,this.currentPos),{x:r,y:n,width:o,height:s}=c;this.ctx.save(),this.ctx.lineCap="butt",this.ctx.lineWidth=this.style.strokeWidth,this.ctx.strokeStyle="white",this.ctx.strokeRect(r,n,o,s),this.ctx.strokeStyle=this.style.strokeColor,this.ctx.setLineDash([6]),this.ctx.strokeRect(r,n,o,s),this.ctx.restore()}}renderTextAttribute(){}renderSelectedRect(){}}module.exports=SegmentByRect;
1
+ 'use strict';
2
+
3
+ var lbUtils = require('@labelbee/lb-utils');
4
+ var AxisUtils = require('../../utils/tool/AxisUtils.js');
5
+ var rectOperation = require('./rectOperation.js');
6
+ var keyCode = require('../../constant/keyCode.js');
7
+
8
+ var __async = (__this, __arguments, generator) => {
9
+ return new Promise((resolve, reject) => {
10
+ var fulfilled = (value) => {
11
+ try {
12
+ step(generator.next(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var rejected = (value) => {
18
+ try {
19
+ step(generator.throw(value));
20
+ } catch (e) {
21
+ reject(e);
22
+ }
23
+ };
24
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
25
+ step((generator = generator.apply(__this, __arguments)).next());
26
+ });
27
+ };
28
+ class SegmentByRect extends rectOperation.RectOperation {
29
+ constructor(props) {
30
+ super(props);
31
+ this.onKeydown = (e) => {
32
+ switch (e.keyCode) {
33
+ case keyCode.Esc:
34
+ e.preventDefault();
35
+ e.stopPropagation();
36
+ this.clearPredictionInfo();
37
+ break;
38
+ case keyCode.Z:
39
+ if (e.ctrlKey) {
40
+ e.preventDefault();
41
+ e.stopPropagation();
42
+ this.rectList = [];
43
+ this.render();
44
+ }
45
+ break;
46
+ }
47
+ };
48
+ this.segmentPrediction = (e) => __async(this, null, function* () {
49
+ const coord = this.getCoordinateUnderZoom(e);
50
+ this.isRunSegment = true;
51
+ this.render();
52
+ if (!this.runPrediction) {
53
+ this.emit("messageError", "You needs to set runPrediction function");
54
+ this.clearPredictionInfo();
55
+ return;
56
+ }
57
+ yield this.runPrediction({
58
+ point: coord,
59
+ rect: {
60
+ x: this.rectList[0].x,
61
+ y: this.rectList[0].y,
62
+ w: this.rectList[0].width,
63
+ h: this.rectList[0].height
64
+ }
65
+ });
66
+ this.clearPredictionInfo();
67
+ });
68
+ this.isRunSegment = false;
69
+ this.runPrediction = props.runPrediction;
70
+ }
71
+ setRunPrediction(runPrediction) {
72
+ this.runPrediction = runPrediction;
73
+ }
74
+ eventBinding() {
75
+ document.addEventListener("keydown", (e) => this.onKeydown(e));
76
+ super.eventBinding();
77
+ }
78
+ clearPredictionInfo() {
79
+ this.rectList = [];
80
+ this.isShowCursor = false;
81
+ this.coord = {x: -1, y: -1};
82
+ this.drawingRect = void 0;
83
+ this.isRunSegment = false;
84
+ this.clearCanvas();
85
+ this.render();
86
+ }
87
+ onMouseUp(e) {
88
+ if (this.isRunSegment) {
89
+ return;
90
+ }
91
+ if (e.button === 0 && this.rectList.length === 1 && !this.isRunSegment) {
92
+ e.stopPropagation();
93
+ this.segmentPrediction(e);
94
+ this.clearActiveStatus();
95
+ return;
96
+ }
97
+ super.onMouseUp(e);
98
+ return void 0;
99
+ }
100
+ onMouseDown(e) {
101
+ if (this.isRunSegment) {
102
+ return;
103
+ }
104
+ super.onMouseDown(e);
105
+ return void 0;
106
+ }
107
+ renderCursorLine() {
108
+ var _a;
109
+ if (!this.ctx) {
110
+ return;
111
+ }
112
+ const {ctx} = this;
113
+ const padding = 10;
114
+ const lineWidth = 1;
115
+ const {x, y} = this.coord;
116
+ ctx.save();
117
+ ctx.strokeStyle = "white";
118
+ ctx.setLineDash([6]);
119
+ ctx.lineWidth = lineWidth;
120
+ ctx.strokeRect(x - padding, y - padding, padding * 2, padding * 2);
121
+ ctx.restore();
122
+ let text = `\u2460 ${lbUtils.i18n.t("FramingOfObjectToBeDivided")}`;
123
+ const isEn = lbUtils.i18n.language === "en";
124
+ let rectWidth = isEn ? 326 : 186;
125
+ if (((_a = this.rectList) == null ? void 0 : _a.length) === 1) {
126
+ text = `\u2461 ${lbUtils.i18n.t("ClickOnTarget")}`;
127
+ rectWidth = isEn ? 232 : 142;
128
+ const radius = 2;
129
+ ctx.save();
130
+ ctx.strokeStyle = "white";
131
+ const margin = lineWidth + padding;
132
+ ctx.beginPath();
133
+ ctx.moveTo(x + margin + radius * 2, y + margin + radius);
134
+ ctx.arc(x + margin + radius, y + margin + radius, radius, 0, Math.PI * 2, true);
135
+ ctx.stroke();
136
+ ctx.restore();
137
+ }
138
+ if (this.isRunSegment) {
139
+ rectWidth = isEn ? 316 : 136;
140
+ text = lbUtils.i18n.t("SplittingAlgorithmPrediction");
141
+ }
142
+ ctx.save();
143
+ ctx.fillStyle = this.style.strokeColor;
144
+ ctx.fillRect(x + padding, y - padding * 4 - 1, rectWidth, 32);
145
+ ctx.restore();
146
+ ctx.save();
147
+ ctx.font = "14px Source Han Sans CN";
148
+ ctx.fillStyle = "white";
149
+ ctx.fillText(text, x + padding + 14, y - padding * 2);
150
+ ctx.restore();
151
+ super.renderCursorLine();
152
+ }
153
+ renderDrawingRect(rect, zoom, isZoom = false) {
154
+ if (this.ctx && rect) {
155
+ const transformRect = AxisUtils["default"].changeRectByZoom(rect, isZoom ? zoom : this.zoom, this.currentPos);
156
+ const {x, y, width, height} = transformRect;
157
+ this.ctx.save();
158
+ this.ctx.lineCap = "butt";
159
+ this.ctx.lineWidth = this.style.strokeWidth;
160
+ this.ctx.strokeStyle = "white";
161
+ this.ctx.strokeRect(x, y, width, height);
162
+ this.ctx.strokeStyle = this.style.strokeColor;
163
+ this.ctx.setLineDash([6]);
164
+ this.ctx.strokeRect(x, y, width, height);
165
+ this.ctx.restore();
166
+ }
167
+ }
168
+ renderTextAttribute() {
169
+ }
170
+ renderSelectedRect() {
171
+ }
172
+ }
173
+
174
+ module.exports = SegmentByRect;
@@ -1,5 +1,186 @@
1
- "use strict";var CommonToolUtils=require("../../utils/tool/CommonToolUtils.js"),TagUtils=require("../../utils/tool/TagUtils.js"),uuid=require("../../utils/uuid.js"),basicToolOperation=require("./basicToolOperation.js");class TagOperation extends basicToolOperation.BasicToolOperation{constructor(t){super(t);this.getInitResultList=(e,s)=>!(e===0||e===void 0)&&s.length===0?[]:TagUtils.getDefaultTagResult(this.config.inputList,s),this.setLabel=(e,s)=>{var i,c;if(this.isImgError||!this.basicResult&&this.dependToolName)return;const l=this.config.inputList;if(!l[e])return;const{subSelected:n}=l[e];if(e<l.length&&l[e].subSelected&&n&&s<n.length){const h=l[e].value;let r=(i=n[s])==null?void 0:i.value;const d=(c=l[e])==null?void 0:c.isMulti,u=this.tagResult.filter(g=>{const o=`${g.sourceID}`;return CommonToolUtils.isSameSourceID(o,this.sourceID)})[0];if(u){let g=0;const{result:o}=u;u.sourceID===0&&(u.sourceID="0");for(const f in u.result)if(f===l[e].value){if(g++,d===!0){const a=o[f].split(";").filter(p=>p!==""),b=a.indexOf(r);b===-1?a.push(r):a.splice(b,1),r=a.join(";")}r===""?Object.keys(o).length===1?this.tagResult=this.tagResult.filter(a=>{const b=`${a.sourceID}`;return CommonToolUtils.isDifferSourceID(b,this.sourceID)}):Object.keys(o).length>1&&delete o[f]:o[f]=r}g===0&&Object.assign(u.result,{[h]:r})}else this.tagResult=[{sourceID:this.sourceID,id:uuid(8,62),result:{[h]:r}}];this.render()}},this.clearResult=(e=!0,s)=>{s?this.tagResult=this.tagResult.map(i=>((i==null?void 0:i.result[s])&&delete i.result[s],i)):this.tagResult=[],this.render()},this.config=CommonToolUtils.jsonParser(t.config),this.tagResult=[],this.labelSelectedList=[],this.setShowDefaultCursor(!0)}destroy(){this.clearTag(),super.destroy()}setResult(t){this.tagResult=t,this.render()}get currentPageResult(){return[this.currentTagResult]}get currentTagResult(){var t;return(t=this.tagResult.filter(e=>{const s=`${e.sourceID}`;return CommonToolUtils.isSameSourceID(s,this.sourceID)})[0])!=null?t:{}}get sourceID(){return CommonToolUtils.getSourceID(this.basicResult)}onKeyDown(t){if(!CommonToolUtils.hotkeyFilter(t)||super.onKeyDown(t)===!1)return;let{keyCode:e}=t;if(e&&(e<=57&&e>=49||e<=105&&e>=97)){if(e>57?e-=97:e-=49,this.config.inputList.length===1){this.labelSelectedList=[0,e],this.setLabel(0,e),setTimeout(()=>{this.labelSelectedList=[],this.render()},500);return}this.labelSelectedList.length===1?(this.labelSelectedList=[this.labelSelectedList[0],e],this.setLabel(this.labelSelectedList[0],e),setTimeout(()=>{this.labelSelectedList=[],this.render()},500)):(this.labelSelectedList=[e],this.emit("expend"))}}clearTag(){var t;const e=(t=this.canvas)==null?void 0:t.parentNode,s=window.self.document.getElementById("tagToolTag");s&&e&&e.contains(s)&&(e==null||e.removeChild(s))}renderTag(){var t,e,s,i,c,l;if(this.clearTag(),!(((t=this.tagResult)==null?void 0:t.length)>0))return;const n=document.createElement("div"),h=TagUtils.getTagNameList((s=(e=this.currentTagResult)==null?void 0:e.result)!=null?s:{},this.config.inputList);n.innerHTML=(i=h.reduce((r,d)=>`${r}${d.keyName}: ${d.value.join(" \u3001 ")}
2
- `,""))!=null?i:"",n.setAttribute("id","tagToolTag"),n.setAttribute("style",`
1
+ 'use strict';
2
+
3
+ var CommonToolUtils = require('../../utils/tool/CommonToolUtils.js');
4
+ var TagUtils = require('../../utils/tool/TagUtils.js');
5
+ var uuid = require('../../utils/uuid.js');
6
+ var basicToolOperation = require('./basicToolOperation.js');
7
+
8
+ class TagOperation extends basicToolOperation.BasicToolOperation {
9
+ constructor(props) {
10
+ super(props);
11
+ this.getInitResultList = (dataSourceStep, basicResultList) => {
12
+ if (!(dataSourceStep === 0 || dataSourceStep === void 0) && basicResultList.length === 0) {
13
+ return [];
14
+ }
15
+ return TagUtils.getDefaultTagResult(this.config.inputList, basicResultList);
16
+ };
17
+ this.setLabel = (i, j) => {
18
+ var _a, _b;
19
+ if (this.isImgError) {
20
+ return;
21
+ }
22
+ if (!this.basicResult && this.dependToolName) {
23
+ return;
24
+ }
25
+ const labelInfoSet = this.config.inputList;
26
+ if (!labelInfoSet[i]) {
27
+ return;
28
+ }
29
+ const {subSelected} = labelInfoSet[i];
30
+ if (i < labelInfoSet.length && labelInfoSet[i].subSelected && subSelected && j < subSelected.length) {
31
+ const key = labelInfoSet[i].value;
32
+ let value = (_a = subSelected[j]) == null ? void 0 : _a.value;
33
+ const isMulti = (_b = labelInfoSet[i]) == null ? void 0 : _b.isMulti;
34
+ const basicTagResult = this.tagResult.filter((v) => {
35
+ const basicSourceID = `${v.sourceID}`;
36
+ return CommonToolUtils.isSameSourceID(basicSourceID, this.sourceID);
37
+ })[0];
38
+ if (basicTagResult) {
39
+ let times = 0;
40
+ const {result} = basicTagResult;
41
+ if (basicTagResult.sourceID === 0) {
42
+ basicTagResult.sourceID = "0";
43
+ }
44
+ for (const oldKey in basicTagResult.result) {
45
+ if (oldKey === labelInfoSet[i].value) {
46
+ times++;
47
+ if (isMulti === true) {
48
+ const keyList = result[oldKey].split(";").filter((v) => v !== "");
49
+ const index = keyList.indexOf(value);
50
+ if (index === -1) {
51
+ keyList.push(value);
52
+ } else {
53
+ keyList.splice(index, 1);
54
+ }
55
+ value = keyList.join(";");
56
+ }
57
+ if (value === "") {
58
+ if (Object.keys(result).length === 1) {
59
+ this.tagResult = this.tagResult.filter((v) => {
60
+ const basicSourceID = `${v.sourceID}`;
61
+ return CommonToolUtils.isDifferSourceID(basicSourceID, this.sourceID);
62
+ });
63
+ } else if (Object.keys(result).length > 1) {
64
+ delete result[oldKey];
65
+ }
66
+ } else {
67
+ result[oldKey] = value;
68
+ }
69
+ }
70
+ }
71
+ if (times === 0) {
72
+ Object.assign(basicTagResult.result, {[key]: value});
73
+ }
74
+ } else {
75
+ this.tagResult = [
76
+ {
77
+ sourceID: this.sourceID,
78
+ id: uuid(8, 62),
79
+ result: {
80
+ [key]: value
81
+ }
82
+ }
83
+ ];
84
+ }
85
+ this.render();
86
+ }
87
+ };
88
+ this.clearResult = (sendMessage = true, value) => {
89
+ if (value) {
90
+ this.tagResult = this.tagResult.map((v) => {
91
+ if (v == null ? void 0 : v.result[value]) {
92
+ delete v.result[value];
93
+ }
94
+ return v;
95
+ });
96
+ } else {
97
+ this.tagResult = [];
98
+ }
99
+ this.render();
100
+ };
101
+ this.config = CommonToolUtils.jsonParser(props.config);
102
+ this.tagResult = [];
103
+ this.labelSelectedList = [];
104
+ this.setShowDefaultCursor(true);
105
+ }
106
+ destroy() {
107
+ this.clearTag();
108
+ super.destroy();
109
+ }
110
+ setResult(tagResult) {
111
+ this.tagResult = tagResult;
112
+ this.render();
113
+ }
114
+ get currentPageResult() {
115
+ return [this.currentTagResult];
116
+ }
117
+ get currentTagResult() {
118
+ var _a;
119
+ return (_a = this.tagResult.filter((v) => {
120
+ const basicSourceID = `${v.sourceID}`;
121
+ return CommonToolUtils.isSameSourceID(basicSourceID, this.sourceID);
122
+ })[0]) != null ? _a : {};
123
+ }
124
+ get sourceID() {
125
+ return CommonToolUtils.getSourceID(this.basicResult);
126
+ }
127
+ onKeyDown(e) {
128
+ if (!CommonToolUtils.hotkeyFilter(e) || super.onKeyDown(e) === false) {
129
+ return;
130
+ }
131
+ let {keyCode} = e;
132
+ if (keyCode) {
133
+ if (keyCode <= 57 && keyCode >= 49 || keyCode <= 105 && keyCode >= 97) {
134
+ if (keyCode > 57) {
135
+ keyCode -= 97;
136
+ } else {
137
+ keyCode -= 49;
138
+ }
139
+ if (this.config.inputList.length === 1) {
140
+ this.labelSelectedList = [0, keyCode];
141
+ this.setLabel(0, keyCode);
142
+ setTimeout(() => {
143
+ this.labelSelectedList = [];
144
+ this.render();
145
+ }, 500);
146
+ return;
147
+ }
148
+ if (this.labelSelectedList.length === 1) {
149
+ this.labelSelectedList = [this.labelSelectedList[0], keyCode];
150
+ this.setLabel(this.labelSelectedList[0], keyCode);
151
+ setTimeout(() => {
152
+ this.labelSelectedList = [];
153
+ this.render();
154
+ }, 500);
155
+ } else {
156
+ this.labelSelectedList = [keyCode];
157
+ this.emit("expend");
158
+ }
159
+ }
160
+ }
161
+ }
162
+ clearTag() {
163
+ var _a;
164
+ const parentNode = (_a = this.canvas) == null ? void 0 : _a.parentNode;
165
+ const oldDom = window.self.document.getElementById("tagToolTag");
166
+ if (oldDom && parentNode && parentNode.contains(oldDom)) {
167
+ parentNode == null ? void 0 : parentNode.removeChild(oldDom);
168
+ }
169
+ }
170
+ renderTag() {
171
+ var _a, _b, _c, _d, _e, _f;
172
+ this.clearTag();
173
+ if (!(((_a = this.tagResult) == null ? void 0 : _a.length) > 0)) {
174
+ return;
175
+ }
176
+ const dom = document.createElement("div");
177
+ const tagInfoList = TagUtils.getTagNameList((_c = (_b = this.currentTagResult) == null ? void 0 : _b.result) != null ? _c : {}, this.config.inputList);
178
+ dom.innerHTML = (_d = tagInfoList.reduce((acc, cur) => {
179
+ return `${acc}${cur.keyName}: ${cur.value.join(` \u3001 `)}
180
+ `;
181
+ }, "")) != null ? _d : "";
182
+ dom.setAttribute("id", "tagToolTag");
183
+ dom.setAttribute("style", `
3
184
  position: absolute;
4
185
  top: 0;
5
186
  right: 0;
@@ -16,4 +197,21 @@
16
197
  background: rgba(102, 111, 255, 1);
17
198
  opacity: 0.6;
18
199
  clear: both;
19
- `),(l=(c=this.canvas)==null?void 0:c.parentNode)==null||l.appendChild(n)}render(){this.renderTag(),super.render(),this.emit("render")}exportData(){let{tagResult:t}=this;return this.isImgError&&(t=[]),[t,this.basicImgInfo]}}module.exports=TagOperation;
200
+ `);
201
+ (_f = (_e = this.canvas) == null ? void 0 : _e.parentNode) == null ? void 0 : _f.appendChild(dom);
202
+ }
203
+ render() {
204
+ this.renderTag();
205
+ super.render();
206
+ this.emit("render");
207
+ }
208
+ exportData() {
209
+ let {tagResult} = this;
210
+ if (this.isImgError) {
211
+ tagResult = [];
212
+ }
213
+ return [tagResult, this.basicImgInfo];
214
+ }
215
+ }
216
+
217
+ module.exports = TagOperation;
@@ -1,37 +1,203 @@
1
- "use strict";var keyCode=require("../../constant/keyCode.js"),tool=require("../../constant/tool.js");const defaultWidth=30,DEFAULT_TEXT_WIDTH=164;class TextAttributeClass{constructor(t){this.textKeyDown=a=>{switch(a.stopPropagation(),a.keyCode){case keyCode.Enter:this.submitTextarea(),this.appendToContainer();break}};const{container:i,icon:e,color:r,getCurrentSelectedData:o,updateSelectedTextAttribute:n}=t,s=t.width||DEFAULT_TEXT_WIDTH;this.container=i,this.getCurrentSelectedData=o,this.updateSelectedTextAttribute=n,this._textAttributeDOM=this.initTextAttributeDOM(),this._iconDOM=this.initIconDOM(e),this._textDOM=this.initTextDOM(s,tool.TEXT_ATTRIBUTE_LINE_HEIGHT),this._textareaDOM=this.initTextareaDOM(s,r),this.appendToContainer()}get isExit(){return this._textAttributeDOM?this.container.contains(this._textAttributeDOM):!1}get isExitTextareaDOM(){return this._textareaDOM?this.container.contains(this._textareaDOM):!1}updateIcon(t){this._iconDOM&&(this._iconDOM.innerHTML=t)}appendToContainer(){!this._textAttributeDOM||!this._textDOM||!this._iconDOM||(this.container.appendChild(this._textAttributeDOM),this._textAttributeDOM.appendChild(this._textDOM),this._textAttributeDOM.appendChild(this._iconDOM))}initTextAttributeDOM(){const t=document.createElement("div");return t.setAttribute("id","textArea"),t}initTextDOM(t,i){const e=document.createElement("span");return e.setAttribute("style",`
2
- width: ${Math.max(t,defaultWidth)}px;
3
- line-height: ${i}px;
1
+ 'use strict';
2
+
3
+ var keyCode = require('../../constant/keyCode.js');
4
+ var tool = require('../../constant/tool.js');
5
+
6
+ const defaultWidth = 30;
7
+ const DEFAULT_TEXT_WIDTH = 164;
8
+ class TextAttributeClass {
9
+ constructor(props) {
10
+ this.textKeyDown = (e) => {
11
+ e.stopPropagation();
12
+ switch (e.keyCode) {
13
+ case keyCode.Enter:
14
+ this.submitTextarea();
15
+ this.appendToContainer();
16
+ break;
17
+ }
18
+ };
19
+ const {container, icon, color, getCurrentSelectedData, updateSelectedTextAttribute} = props;
20
+ const width = props.width || DEFAULT_TEXT_WIDTH;
21
+ this.container = container;
22
+ this.getCurrentSelectedData = getCurrentSelectedData;
23
+ this.updateSelectedTextAttribute = updateSelectedTextAttribute;
24
+ this._textAttributeDOM = this.initTextAttributeDOM();
25
+ this._iconDOM = this.initIconDOM(icon);
26
+ this._textDOM = this.initTextDOM(width, tool.TEXT_ATTRIBUTE_LINE_HEIGHT);
27
+ this._textareaDOM = this.initTextareaDOM(width, color);
28
+ this.appendToContainer();
29
+ }
30
+ get isExit() {
31
+ if (!this._textAttributeDOM) {
32
+ return false;
33
+ }
34
+ return this.container.contains(this._textAttributeDOM);
35
+ }
36
+ get isExitTextareaDOM() {
37
+ if (!this._textareaDOM) {
38
+ return false;
39
+ }
40
+ return this.container.contains(this._textareaDOM);
41
+ }
42
+ updateIcon(icon) {
43
+ if (this._iconDOM) {
44
+ this._iconDOM.innerHTML = icon;
45
+ }
46
+ }
47
+ appendToContainer() {
48
+ if (!this._textAttributeDOM || !this._textDOM || !this._iconDOM) {
49
+ return;
50
+ }
51
+ this.container.appendChild(this._textAttributeDOM);
52
+ this._textAttributeDOM.appendChild(this._textDOM);
53
+ this._textAttributeDOM.appendChild(this._iconDOM);
54
+ }
55
+ initTextAttributeDOM() {
56
+ const _textAttributeDOM = document.createElement("div");
57
+ _textAttributeDOM.setAttribute("id", "textArea");
58
+ return _textAttributeDOM;
59
+ }
60
+ initTextDOM(width, lineHeight) {
61
+ const _textDOM = document.createElement("span");
62
+ _textDOM.setAttribute("style", `
63
+ width: ${Math.max(width, defaultWidth)}px;
64
+ line-height: ${lineHeight}px;
4
65
  word-break: break-all;
5
66
  white-space: pre-line;
6
67
  font-style: italic;
7
- `),e}initIconDOM(t){const i=document.createElement("div");return i.setAttribute("id","annotation_text"),i.innerHTML=t,i.addEventListener("mouseup",e=>{e.stopPropagation(),this.renderTextarea()}),i.addEventListener("mousedown",e=>{e.stopPropagation()}),i.addEventListener("contextmenu",e=>{e.stopPropagation()}),i.setAttribute("style",`
68
+ `);
69
+ return _textDOM;
70
+ }
71
+ initIconDOM(icon) {
72
+ const _iconDOM = document.createElement("div");
73
+ _iconDOM.setAttribute("id", "annotation_text");
74
+ _iconDOM.innerHTML = icon;
75
+ _iconDOM.addEventListener("mouseup", (e) => {
76
+ e.stopPropagation();
77
+ this.renderTextarea();
78
+ });
79
+ _iconDOM.addEventListener("mousedown", (e) => {
80
+ e.stopPropagation();
81
+ });
82
+ _iconDOM.addEventListener("contextmenu", (e) => {
83
+ e.stopPropagation();
84
+ });
85
+ _iconDOM.setAttribute("style", `
8
86
  position: absolute;
9
87
  left: -20px;
10
88
  top: 4px;
11
89
  cursor: pointer;
12
90
  z-index: 10
13
- `),i}initTextareaDOM(t,i){const e=document.createElement("textarea");return e.addEventListener("click",r=>{r.stopPropagation()}),e.addEventListener("mouseup",r=>{r.stopPropagation()}),e.setAttribute("style",`
91
+ `);
92
+ return _iconDOM;
93
+ }
94
+ initTextareaDOM(width, color) {
95
+ const _textareaDOM = document.createElement("textarea");
96
+ _textareaDOM.addEventListener("click", (e) => {
97
+ e.stopPropagation();
98
+ });
99
+ _textareaDOM.addEventListener("mouseup", (e) => {
100
+ e.stopPropagation();
101
+ });
102
+ _textareaDOM.setAttribute("style", `
14
103
  background-color: transparent;
15
104
  border-radius: 5px;
16
- border-color: ${i};
105
+ border-color: ${color};
17
106
  outline: none;
18
107
  resize: none;
19
- width: ${Math.max(t,30)}px;
20
- `),e.setAttribute("maxLength",`${tool.TEXT_ATTRIBUTE_MAX_LENGTH}`),e}removeTextDOM(){!this._textAttributeDOM||this._textDOM&&this._textAttributeDOM.removeChild(this._textDOM)}removeIconDOM(){!this._textAttributeDOM||this._iconDOM&&this._textAttributeDOM.removeChild(this._iconDOM)}removeTextareaDOM(){var t,i;this._textareaDOM&&this._textAttributeDOM&&((t=this._textAttributeDOM)==null?void 0:t.contains(this._textareaDOM))&&((i=this._textAttributeDOM)==null||i.removeChild(this._textareaDOM))}submitTextarea(){var t;this._textareaDOM&&(this.updateSelectedTextAttribute((t=this._textareaDOM)==null?void 0:t.value),this.removeTextareaDOM(),this.clearTextAttribute())}clearTextAttribute(){this._textAttributeDOM&&this.container.contains(this._textAttributeDOM)&&this.container.removeChild(this._textAttributeDOM)}renderTextarea(){if(!this._textAttributeDOM||!this._textareaDOM)return;const t=this.getCurrentSelectedData();if(!t)return;const{width:i=DEFAULT_TEXT_WIDTH,textAttribute:e,color:r}=t;this._textareaDOM.value=`${e}`,this._textareaDOM.setAttribute("style",`
108
+ width: ${Math.max(width, 30)}px;
109
+ `);
110
+ _textareaDOM.setAttribute("maxLength", `${tool.TEXT_ATTRIBUTE_MAX_LENGTH}`);
111
+ return _textareaDOM;
112
+ }
113
+ removeTextDOM() {
114
+ if (!this._textAttributeDOM) {
115
+ return;
116
+ }
117
+ if (this._textDOM) {
118
+ this._textAttributeDOM.removeChild(this._textDOM);
119
+ }
120
+ }
121
+ removeIconDOM() {
122
+ if (!this._textAttributeDOM) {
123
+ return;
124
+ }
125
+ if (this._iconDOM) {
126
+ this._textAttributeDOM.removeChild(this._iconDOM);
127
+ }
128
+ }
129
+ removeTextareaDOM() {
130
+ var _a, _b;
131
+ if (this._textareaDOM && this._textAttributeDOM && ((_a = this._textAttributeDOM) == null ? void 0 : _a.contains(this._textareaDOM))) {
132
+ (_b = this._textAttributeDOM) == null ? void 0 : _b.removeChild(this._textareaDOM);
133
+ }
134
+ }
135
+ submitTextarea() {
136
+ var _a;
137
+ if (this._textareaDOM) {
138
+ this.updateSelectedTextAttribute((_a = this._textareaDOM) == null ? void 0 : _a.value);
139
+ this.removeTextareaDOM();
140
+ this.clearTextAttribute();
141
+ }
142
+ }
143
+ clearTextAttribute() {
144
+ if (this._textAttributeDOM && this.container.contains(this._textAttributeDOM)) {
145
+ this.container.removeChild(this._textAttributeDOM);
146
+ }
147
+ }
148
+ renderTextarea() {
149
+ if (!this._textAttributeDOM || !this._textareaDOM) {
150
+ return;
151
+ }
152
+ const data = this.getCurrentSelectedData();
153
+ if (!data) {
154
+ return;
155
+ }
156
+ const {width = DEFAULT_TEXT_WIDTH, textAttribute, color} = data;
157
+ this._textareaDOM.value = `${textAttribute}`;
158
+ this._textareaDOM.setAttribute("style", `
21
159
  background-color: rgba(0,0,0,0.4);
22
160
  border-radius: 5px;
23
- border-color: ${r};
161
+ border-color: ${color};
24
162
  outline: none;
25
163
  resize: none;
26
164
  font-style: italic;
27
165
  font-weight: 900;
28
166
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.6);
29
- width: ${Math.max(i,defaultWidth)}px;
30
- `),this._textareaDOM.setAttribute("maxLength",`${tool.TEXT_ATTRIBUTE_MAX_LENGTH}`),this._textAttributeDOM.appendChild(this._textareaDOM),this.removeIconDOM(),this.removeTextDOM(),this._textareaDOM.focus(),this._textareaDOM.addEventListener("keydown",this.textKeyDown)}update(t,i){var e;const{left:r,top:o,color:n,width:s=DEFAULT_TEXT_WIDTH}=i,a=Math.max(s,defaultWidth);(e=this._textAttributeDOM)==null||e.setAttribute("style",`
167
+ width: ${Math.max(width, defaultWidth)}px;
168
+ `);
169
+ this._textareaDOM.setAttribute("maxLength", `${tool.TEXT_ATTRIBUTE_MAX_LENGTH}`);
170
+ this._textAttributeDOM.appendChild(this._textareaDOM);
171
+ this.removeIconDOM();
172
+ this.removeTextDOM();
173
+ this._textareaDOM.focus();
174
+ this._textareaDOM.addEventListener("keydown", this.textKeyDown);
175
+ }
176
+ update(textAttribute, position) {
177
+ var _a;
178
+ const {left, top, color, width = DEFAULT_TEXT_WIDTH} = position;
179
+ const newWidth = Math.max(width, defaultWidth);
180
+ (_a = this._textAttributeDOM) == null ? void 0 : _a.setAttribute("style", `
31
181
  position: absolute;
32
- width: ${a}px;
182
+ width: ${newWidth}px;
33
183
  font-size: 14px;
34
- left:${r}px;
35
- top: ${o}px;
36
- color: ${n};
37
- `),this._textDOM&&(this._textDOM.innerHTML=`${t}`),this._textareaDOM&&(this._textareaDOM.style.width=`${a}px`,this._textareaDOM.style.borderColor=`${n}`)}changeSelected(){this.isExitTextareaDOM&&this.submitTextarea()}}module.exports=TextAttributeClass;
184
+ left:${left}px;
185
+ top: ${top}px;
186
+ color: ${color};
187
+ `);
188
+ if (this._textDOM) {
189
+ this._textDOM.innerHTML = `${textAttribute}`;
190
+ }
191
+ if (this._textareaDOM) {
192
+ this._textareaDOM.style.width = `${newWidth}px`;
193
+ this._textareaDOM.style.borderColor = `${color}`;
194
+ }
195
+ }
196
+ changeSelected() {
197
+ if (this.isExitTextareaDOM) {
198
+ this.submitTextarea();
199
+ }
200
+ }
201
+ }
202
+
203
+ module.exports = TextAttributeClass;