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

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 (189) hide show
  1. package/dist/_virtual/MathUtilsWorker.js +1 -8
  2. package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +2 -35
  3. package/dist/_virtual/filterBoxWorker.js +1 -8
  4. package/dist/_virtual/highlightWorker.js +1 -8
  5. package/dist/assets/attributeIcon/icon_canvasEdit0.svg.js +1 -5
  6. package/dist/assets/attributeIcon/icon_canvasEdit1.svg.js +1 -5
  7. package/dist/assets/attributeIcon/icon_canvasEdit2.svg.js +1 -5
  8. package/dist/assets/attributeIcon/icon_canvasEdit3.svg.js +1 -5
  9. package/dist/assets/attributeIcon/icon_canvasEdit4.svg.js +1 -5
  10. package/dist/assets/attributeIcon/icon_canvasEdit5.svg.js +1 -5
  11. package/dist/assets/attributeIcon/icon_canvasEdit6.svg.js +1 -5
  12. package/dist/assets/attributeIcon/icon_canvasEdit7.svg.js +1 -5
  13. package/dist/assets/attributeIcon/icon_canvasEdit8.svg.js +1 -5
  14. package/dist/assets/attributeIcon/icon_canvasEdit_miss.svg.js +1 -5
  15. package/dist/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -5
  16. package/dist/assets/attributeIcon/icon_cuboidLeft.svg.js +7 -5
  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 +12 -5
  20. package/dist/assets/attributeIcon/icon_editFEN.svg.js +1 -5
  21. package/dist/assets/attributeIcon/icon_editHUANG.svg.js +1 -5
  22. package/dist/assets/attributeIcon/icon_editLAN.svg.js +1 -5
  23. package/dist/assets/attributeIcon/icon_editLV.svg.js +1 -5
  24. package/dist/assets/attributeIcon/icon_editQING.svg.js +1 -5
  25. package/dist/constant/annotation.js +1 -127
  26. package/dist/constant/annotationTask.js +1 -30
  27. package/dist/constant/defaultConfig.js +1 -266
  28. package/dist/constant/keyCode.js +1 -38
  29. package/dist/constant/style.js +1 -98
  30. package/dist/constant/tool.js +1 -236
  31. package/dist/core/index.js +1 -150
  32. package/dist/core/pointCloud/OrbitControls.js +1 -665
  33. package/dist/core/pointCloud/PCDLoader.js +2 -260
  34. package/dist/core/pointCloud/annotation.js +1 -215
  35. package/dist/core/pointCloud/cache.js +1 -53
  36. package/dist/core/pointCloud/index.js +5 -991
  37. package/dist/core/pointCloud/matrix.js +1 -138
  38. package/dist/core/scheduler.js +1 -233
  39. package/dist/core/toolOperation/LineToolOperation.js +1 -1434
  40. package/dist/core/toolOperation/ScribbleTool.js +1 -292
  41. package/dist/core/toolOperation/TextToolOperation.js +1 -131
  42. package/dist/core/toolOperation/ViewOperation.js +1 -556
  43. package/dist/core/toolOperation/basicToolOperation.js +1 -881
  44. package/dist/core/toolOperation/checkOperation.js +1 -208
  45. package/dist/core/toolOperation/cuboidOperation.js +1 -754
  46. package/dist/core/toolOperation/cuboidToggleButtonClass.js +7 -152
  47. package/dist/core/toolOperation/eventListener.js +1 -37
  48. package/dist/core/toolOperation/measureOperation.js +1 -41
  49. package/dist/core/toolOperation/pointCloud2dOperation.js +1 -365
  50. package/dist/core/toolOperation/pointOperation.js +1 -696
  51. package/dist/core/toolOperation/polygonOperation.js +1 -1251
  52. package/dist/core/toolOperation/rectOperation.js +1 -1233
  53. package/dist/core/toolOperation/segmentByRect.js +1 -174
  54. package/dist/core/toolOperation/tagOperation.js +3 -201
  55. package/dist/core/toolOperation/textAttributeClass.js +16 -182
  56. package/dist/index.js +1 -185
  57. package/dist/locales/constants.js +1 -24
  58. package/dist/locales/en_US/message.js +1 -25
  59. package/dist/locales/index.js +1 -19
  60. package/dist/locales/zh_CN/message.js +1 -25
  61. package/dist/newCore/CanvasScheduler.js +1 -35
  62. package/dist/types/core/pointCloud/index.d.ts +2 -2
  63. package/dist/utils/ActionsHistory.js +1 -84
  64. package/dist/utils/ImgUtils.js +1 -23
  65. package/dist/utils/MathUtils.js +2 -385
  66. package/dist/utils/VectorUtils.js +1 -25
  67. package/dist/utils/tool/AttributeUtils.js +1 -218
  68. package/dist/utils/tool/AxisUtils.js +1 -340
  69. package/dist/utils/tool/CanvasUtils.js +1 -62
  70. package/dist/utils/tool/CommonToolUtils.js +1 -174
  71. package/dist/utils/tool/CuboidUtils.js +1 -704
  72. package/dist/utils/tool/DblClickEventListener.js +1 -102
  73. package/dist/utils/tool/DrawUtils.js +3 -492
  74. package/dist/utils/tool/EnhanceCommonToolUtils.js +1 -53
  75. package/dist/utils/tool/ImgPosUtils.js +1 -58
  76. package/dist/utils/tool/LineToolUtils.js +1 -261
  77. package/dist/utils/tool/MarkerUtils.js +1 -56
  78. package/dist/utils/tool/PolygonUtils.js +1 -460
  79. package/dist/utils/tool/RectUtils.js +1 -155
  80. package/dist/utils/tool/RenderDomClass.js +7 -57
  81. package/dist/utils/tool/RenderDomUtils.js +4 -21
  82. package/dist/utils/tool/StyleUtils.js +1 -31
  83. package/dist/utils/tool/TagUtils.js +1 -129
  84. package/dist/utils/tool/UnitUtils.js +1 -12
  85. package/dist/utils/tool/ZoomUtils.js +1 -72
  86. package/dist/utils/tool/polygonTool.js +1 -133
  87. package/dist/utils/uuid.js +1 -26
  88. package/es/_virtual/MathUtilsWorker.js +1 -6
  89. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +2 -31
  90. package/es/_virtual/filterBoxWorker.js +1 -6
  91. package/es/_virtual/highlightWorker.js +1 -6
  92. package/es/assets/attributeIcon/icon_canvasEdit0.svg.js +1 -3
  93. package/es/assets/attributeIcon/icon_canvasEdit1.svg.js +1 -3
  94. package/es/assets/attributeIcon/icon_canvasEdit2.svg.js +1 -3
  95. package/es/assets/attributeIcon/icon_canvasEdit3.svg.js +1 -3
  96. package/es/assets/attributeIcon/icon_canvasEdit4.svg.js +1 -3
  97. package/es/assets/attributeIcon/icon_canvasEdit5.svg.js +1 -3
  98. package/es/assets/attributeIcon/icon_canvasEdit6.svg.js +1 -3
  99. package/es/assets/attributeIcon/icon_canvasEdit7.svg.js +1 -3
  100. package/es/assets/attributeIcon/icon_canvasEdit8.svg.js +1 -3
  101. package/es/assets/attributeIcon/icon_canvasEdit_miss.svg.js +1 -3
  102. package/es/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -3
  103. package/es/assets/attributeIcon/icon_cuboidLeft.svg.js +7 -3
  104. package/es/assets/attributeIcon/icon_cuboidMore.svg.js +5 -3
  105. package/es/assets/attributeIcon/icon_cuboidRight.svg.js +5 -3
  106. package/es/assets/attributeIcon/icon_cuboidTop.svg.js +12 -3
  107. package/es/assets/attributeIcon/icon_editFEN.svg.js +1 -3
  108. package/es/assets/attributeIcon/icon_editHUANG.svg.js +1 -3
  109. package/es/assets/attributeIcon/icon_editLAN.svg.js +1 -3
  110. package/es/assets/attributeIcon/icon_editLV.svg.js +1 -3
  111. package/es/assets/attributeIcon/icon_editQING.svg.js +1 -3
  112. package/es/constant/annotation.js +1 -113
  113. package/es/constant/annotationTask.js +1 -25
  114. package/es/constant/defaultConfig.js +1 -260
  115. package/es/constant/keyCode.js +1 -36
  116. package/es/constant/style.js +1 -74
  117. package/es/constant/tool.js +1 -220
  118. package/es/core/index.js +1 -148
  119. package/es/core/pointCloud/OrbitControls.js +1 -661
  120. package/es/core/pointCloud/PCDLoader.js +2 -256
  121. package/es/core/pointCloud/annotation.js +1 -211
  122. package/es/core/pointCloud/cache.js +1 -49
  123. package/es/core/pointCloud/index.js +5 -962
  124. package/es/core/pointCloud/matrix.js +1 -109
  125. package/es/core/scheduler.js +1 -228
  126. package/es/core/toolOperation/LineToolOperation.js +1 -1421
  127. package/es/core/toolOperation/ScribbleTool.js +1 -290
  128. package/es/core/toolOperation/TextToolOperation.js +1 -129
  129. package/es/core/toolOperation/ViewOperation.js +1 -549
  130. package/es/core/toolOperation/basicToolOperation.js +1 -877
  131. package/es/core/toolOperation/checkOperation.js +1 -206
  132. package/es/core/toolOperation/cuboidOperation.js +1 -752
  133. package/es/core/toolOperation/cuboidToggleButtonClass.js +7 -150
  134. package/es/core/toolOperation/eventListener.js +1 -35
  135. package/es/core/toolOperation/measureOperation.js +1 -39
  136. package/es/core/toolOperation/pointCloud2dOperation.js +1 -359
  137. package/es/core/toolOperation/pointOperation.js +1 -690
  138. package/es/core/toolOperation/polygonOperation.js +1 -1245
  139. package/es/core/toolOperation/rectOperation.js +1 -1228
  140. package/es/core/toolOperation/segmentByRect.js +1 -172
  141. package/es/core/toolOperation/tagOperation.js +3 -199
  142. package/es/core/toolOperation/textAttributeClass.js +16 -180
  143. package/es/index.js +1 -46
  144. package/es/locales/constants.js +1 -22
  145. package/es/locales/en_US/message.js +1 -23
  146. package/es/locales/index.js +1 -17
  147. package/es/locales/zh_CN/message.js +1 -23
  148. package/es/newCore/CanvasScheduler.js +1 -31
  149. package/es/utils/ActionsHistory.js +1 -78
  150. package/es/utils/ImgUtils.js +1 -21
  151. package/es/utils/MathUtils.js +2 -380
  152. package/es/utils/VectorUtils.js +1 -23
  153. package/es/utils/tool/AttributeUtils.js +1 -212
  154. package/es/utils/tool/AxisUtils.js +1 -335
  155. package/es/utils/tool/CanvasUtils.js +1 -60
  156. package/es/utils/tool/CommonToolUtils.js +1 -172
  157. package/es/utils/tool/CuboidUtils.js +1 -680
  158. package/es/utils/tool/DblClickEventListener.js +1 -100
  159. package/es/utils/tool/DrawUtils.js +3 -490
  160. package/es/utils/tool/EnhanceCommonToolUtils.js +1 -48
  161. package/es/utils/tool/ImgPosUtils.js +1 -56
  162. package/es/utils/tool/LineToolUtils.js +1 -255
  163. package/es/utils/tool/MarkerUtils.js +1 -54
  164. package/es/utils/tool/PolygonUtils.js +1 -458
  165. package/es/utils/tool/RectUtils.js +1 -153
  166. package/es/utils/tool/RenderDomClass.js +7 -55
  167. package/es/utils/tool/RenderDomUtils.js +4 -19
  168. package/es/utils/tool/StyleUtils.js +1 -29
  169. package/es/utils/tool/TagUtils.js +1 -127
  170. package/es/utils/tool/UnitUtils.js +1 -10
  171. package/es/utils/tool/ZoomUtils.js +1 -70
  172. package/es/utils/tool/polygonTool.js +1 -126
  173. package/es/utils/uuid.js +1 -24
  174. package/package.json +3 -4
  175. package/LICENSE +0 -203
  176. package/dist/core/pointCloud/segmentation.js +0 -144
  177. package/dist/core/pointCloud/selector/Sse3dLassoSelector.js +0 -26
  178. package/dist/core/pointCloud/selector/Sse3dSelector.js +0 -16
  179. package/dist/types/core/pointCloud/segmentation.d.ts +0 -0
  180. package/dist/types/core/pointCloud/selector/Sse3dLassoSelector.d.ts +0 -0
  181. package/dist/types/core/pointCloud/selector/Sse3dSelector.d.ts +0 -0
  182. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +0 -12
  183. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +0 -7
  184. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +0 -11
  185. package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +0 -18
  186. package/es/core/pointCloud/segmentation.js +0 -120
  187. package/es/core/pointCloud/selector/Sse3dLassoSelector.js +0 -24
  188. package/es/core/pointCloud/selector/Sse3dSelector.js +0 -14
  189. package/es/core/toolOperation/scribbleTool2.js +0 -249
package/dist/index.js CHANGED
@@ -1,185 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var rectOperation = require('./core/toolOperation/rectOperation.js');
6
- var tagOperation = require('./core/toolOperation/tagOperation.js');
7
- var pointOperation = require('./core/toolOperation/pointOperation.js');
8
- var LineToolOperation = require('./core/toolOperation/LineToolOperation.js');
9
- var TextToolOperation = require('./core/toolOperation/TextToolOperation.js');
10
- var polygonOperation = require('./core/toolOperation/polygonOperation.js');
11
- var measureOperation = require('./core/toolOperation/measureOperation.js');
12
- var basicToolOperation = require('./core/toolOperation/basicToolOperation.js');
13
- var ViewOperation = require('./core/toolOperation/ViewOperation.js');
14
- var ScribbleTool = require('./core/toolOperation/ScribbleTool.js');
15
- var pointCloud2dOperation = require('./core/toolOperation/pointCloud2dOperation.js');
16
- var annotation = require('./constant/annotation.js');
17
- var annotationTask = require('./constant/annotationTask.js');
18
- var keyCode = require('./constant/keyCode.js');
19
- var style = require('./constant/style.js');
20
- var tool = require('./constant/tool.js');
21
- var TagUtils = require('./utils/tool/TagUtils.js');
22
- var uuid = require('./utils/uuid.js');
23
- var EnhanceCommonToolUtils = require('./utils/tool/EnhanceCommonToolUtils.js');
24
- var MarkerUtils = require('./utils/tool/MarkerUtils.js');
25
- var RectUtils = require('./utils/tool/RectUtils.js');
26
- var AxisUtils = require('./utils/tool/AxisUtils.js');
27
- var DrawUtils = require('./utils/tool/DrawUtils.js');
28
- var ImgUtils = require('./utils/ImgUtils.js');
29
- var MathUtils = require('./utils/MathUtils.js');
30
- var AttributeUtils = require('./utils/tool/AttributeUtils.js');
31
- var ActionsHistory = require('./utils/ActionsHistory.js');
32
- var DblClickEventListener = require('./utils/tool/DblClickEventListener.js');
33
- var index = require('./core/index.js');
34
- var UnitUtils = require('./utils/tool/UnitUtils.js');
35
- var StyleUtils = require('./utils/tool/StyleUtils.js');
36
- var CanvasScheduler = require('./newCore/CanvasScheduler.js');
37
- var index$1 = require('./core/pointCloud/index.js');
38
- var matrix = require('./core/pointCloud/matrix.js');
39
- var annotation$1 = require('./core/pointCloud/annotation.js');
40
-
41
- function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); }
42
-
43
- var keyCode__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(keyCode);
44
-
45
- const CommonToolUtils = EnhanceCommonToolUtils["default"];
46
- const toolUtils = EnhanceCommonToolUtils["default"];
47
-
48
- exports.RectOperation = rectOperation.RectOperation;
49
- exports.TagOperation = tagOperation;
50
- exports.PointOperation = pointOperation;
51
- exports.LineToolOperation = LineToolOperation["default"];
52
- exports.TextToolOperation = TextToolOperation;
53
- exports.PolygonOperation = polygonOperation;
54
- exports.MeasureOperation = measureOperation;
55
- exports.BasicToolOperation = basicToolOperation.BasicToolOperation;
56
- exports.ViewOperation = ViewOperation;
57
- exports.ScribbleTool = ScribbleTool;
58
- exports.PointCloud2dOperation = pointCloud2dOperation;
59
- exports.cAnnotation = annotation;
60
- exports.cAnnotationTask = annotationTask;
61
- exports.cKeyCode = keyCode__namespace;
62
- exports.cStyle = style;
63
- exports.CLIENT_TOOL_HEAD_TYPE = tool.CLIENT_TOOL_HEAD_TYPE;
64
- exports.CLIENT_TOOL_NAME = tool.CLIENT_TOOL_NAME;
65
- exports.DEFAULT_FONT = tool.DEFAULT_FONT;
66
- exports.DEFAULT_TEXT_MAX_WIDTH = tool.DEFAULT_TEXT_MAX_WIDTH;
67
- Object.defineProperty(exports, 'EAnnotationMode', {
68
- enumerable: true,
69
- get: function () { return tool.EAnnotationMode; }
70
- });
71
- Object.defineProperty(exports, 'EAuditStatus', {
72
- enumerable: true,
73
- get: function () { return tool.EAuditStatus; }
74
- });
75
- Object.defineProperty(exports, 'ECheckModel', {
76
- enumerable: true,
77
- get: function () { return tool.ECheckModel; }
78
- });
79
- Object.defineProperty(exports, 'EDependPattern', {
80
- enumerable: true,
81
- get: function () { return tool.EDependPattern; }
82
- });
83
- Object.defineProperty(exports, 'EDragTarget', {
84
- enumerable: true,
85
- get: function () { return tool.EDragTarget; }
86
- });
87
- Object.defineProperty(exports, 'EDrawPointPattern', {
88
- enumerable: true,
89
- get: function () { return tool.EDrawPointPattern; }
90
- });
91
- Object.defineProperty(exports, 'EFilterToolOperation', {
92
- enumerable: true,
93
- get: function () { return tool.EFilterToolOperation; }
94
- });
95
- Object.defineProperty(exports, 'ELineColor', {
96
- enumerable: true,
97
- get: function () { return tool.ELineColor; }
98
- });
99
- Object.defineProperty(exports, 'ELineTypes', {
100
- enumerable: true,
101
- get: function () { return tool.ELineTypes; }
102
- });
103
- Object.defineProperty(exports, 'EOperationMode', {
104
- enumerable: true,
105
- get: function () { return tool.EOperationMode; }
106
- });
107
- Object.defineProperty(exports, 'EPageOperator', {
108
- enumerable: true,
109
- get: function () { return tool.EPageOperator; }
110
- });
111
- Object.defineProperty(exports, 'EPointCloudName', {
112
- enumerable: true,
113
- get: function () { return tool.EPointCloudName; }
114
- });
115
- Object.defineProperty(exports, 'EPolygonPattern', {
116
- enumerable: true,
117
- get: function () { return tool.EPolygonPattern; }
118
- });
119
- Object.defineProperty(exports, 'ERectPattern', {
120
- enumerable: true,
121
- get: function () { return tool.ERectPattern; }
122
- });
123
- Object.defineProperty(exports, 'EScribblePattern', {
124
- enumerable: true,
125
- get: function () { return tool.EScribblePattern; }
126
- });
127
- Object.defineProperty(exports, 'ESelectedType', {
128
- enumerable: true,
129
- get: function () { return tool.ESelectedType; }
130
- });
131
- Object.defineProperty(exports, 'ETextType', {
132
- enumerable: true,
133
- get: function () { return tool.ETextType; }
134
- });
135
- Object.defineProperty(exports, 'EThumbnailOption', {
136
- enumerable: true,
137
- get: function () { return tool.EThumbnailOption; }
138
- });
139
- Object.defineProperty(exports, 'EToolName', {
140
- enumerable: true,
141
- get: function () { return tool.EToolName; }
142
- });
143
- Object.defineProperty(exports, 'EToolType', {
144
- enumerable: true,
145
- get: function () { return tool.EToolType; }
146
- });
147
- Object.defineProperty(exports, 'EVideoToolName', {
148
- enumerable: true,
149
- get: function () { return tool.EVideoToolName; }
150
- });
151
- exports.OPERATION_LIST = tool.OPERATION_LIST;
152
- exports.SEGMENT_NUMBER = tool.SEGMENT_NUMBER;
153
- exports.TEXT_ATTRIBUTE_LINE_HEIGHT = tool.TEXT_ATTRIBUTE_LINE_HEIGHT;
154
- exports.TEXT_ATTRIBUTE_MAX_LENGTH = tool.TEXT_ATTRIBUTE_MAX_LENGTH;
155
- exports.TEXT_TYPE = tool.TEXT_TYPE;
156
- exports.TOOL_NAME = tool.TOOL_NAME;
157
- exports.TOOL_NAME_EN = tool.TOOL_NAME_EN;
158
- exports.cTool = tool;
159
- exports.edgeAdsorptionScope = tool.edgeAdsorptionScope;
160
- exports.editStepWidth = tool.editStepWidth;
161
- exports.TagUtils = TagUtils;
162
- exports.uuid = uuid;
163
- exports.MarkerUtils = MarkerUtils;
164
- exports.RectUtils = RectUtils;
165
- exports.AxisUtils = AxisUtils["default"];
166
- exports.DrawUtils = DrawUtils;
167
- exports.ImgUtils = ImgUtils;
168
- exports.MathUtils = MathUtils["default"];
169
- exports.AttributeUtils = AttributeUtils["default"];
170
- exports.ActionsHistory = ActionsHistory;
171
- exports.DblClickEventListener = DblClickEventListener;
172
- exports.AnnotationEngine = index;
173
- exports.UnitUtils = UnitUtils;
174
- exports.StyleUtils = StyleUtils;
175
- exports.CanvasScheduler = CanvasScheduler.CanvasScheduler;
176
- exports.PointCloud = index$1.PointCloud;
177
- exports.createThreeMatrix4 = matrix.createThreeMatrix4;
178
- exports.getCuboidFromPointCloudBox = matrix.getCuboidFromPointCloudBox;
179
- exports.lidar2image = matrix.lidar2image;
180
- exports.pointCloudLidar2image = matrix.pointCloudLidar2image;
181
- exports.rotatePoint = matrix.rotatePoint;
182
- exports.transferKitti2Matrix = matrix.transferKitti2Matrix;
183
- exports.PointCloudAnnotation = annotation$1.PointCloudAnnotation;
184
- exports.CommonToolUtils = CommonToolUtils;
185
- exports.toolUtils = toolUtils;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var rectOperation=require("./core/toolOperation/rectOperation.js"),tagOperation=require("./core/toolOperation/tagOperation.js"),pointOperation=require("./core/toolOperation/pointOperation.js"),LineToolOperation=require("./core/toolOperation/LineToolOperation.js"),TextToolOperation=require("./core/toolOperation/TextToolOperation.js"),polygonOperation=require("./core/toolOperation/polygonOperation.js"),measureOperation=require("./core/toolOperation/measureOperation.js"),basicToolOperation=require("./core/toolOperation/basicToolOperation.js"),ViewOperation=require("./core/toolOperation/ViewOperation.js"),ScribbleTool=require("./core/toolOperation/ScribbleTool.js"),pointCloud2dOperation=require("./core/toolOperation/pointCloud2dOperation.js"),annotation=require("./constant/annotation.js"),annotationTask=require("./constant/annotationTask.js"),keyCode=require("./constant/keyCode.js"),style=require("./constant/style.js"),tool=require("./constant/tool.js"),TagUtils=require("./utils/tool/TagUtils.js"),uuid=require("./utils/uuid.js"),EnhanceCommonToolUtils=require("./utils/tool/EnhanceCommonToolUtils.js"),MarkerUtils=require("./utils/tool/MarkerUtils.js"),RectUtils=require("./utils/tool/RectUtils.js"),AxisUtils=require("./utils/tool/AxisUtils.js"),DrawUtils=require("./utils/tool/DrawUtils.js"),ImgUtils=require("./utils/ImgUtils.js"),MathUtils=require("./utils/MathUtils.js"),AttributeUtils=require("./utils/tool/AttributeUtils.js"),ActionsHistory=require("./utils/ActionsHistory.js"),DblClickEventListener=require("./utils/tool/DblClickEventListener.js"),index=require("./core/index.js"),UnitUtils=require("./utils/tool/UnitUtils.js"),StyleUtils=require("./utils/tool/StyleUtils.js"),CanvasScheduler=require("./newCore/CanvasScheduler.js"),index$1=require("./core/pointCloud/index.js"),matrix=require("./core/pointCloud/matrix.js"),annotation$1=require("./core/pointCloud/annotation.js");function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}var keyCode__namespace=_interopNamespaceDefaultOnly(keyCode);const CommonToolUtils=EnhanceCommonToolUtils.default,toolUtils=EnhanceCommonToolUtils.default;exports.RectOperation=rectOperation.RectOperation,exports.TagOperation=tagOperation,exports.PointOperation=pointOperation,exports.LineToolOperation=LineToolOperation.default,exports.TextToolOperation=TextToolOperation,exports.PolygonOperation=polygonOperation,exports.MeasureOperation=measureOperation,exports.BasicToolOperation=basicToolOperation.BasicToolOperation,exports.ViewOperation=ViewOperation,exports.ScribbleTool=ScribbleTool,exports.PointCloud2dOperation=pointCloud2dOperation,exports.cAnnotation=annotation,exports.cAnnotationTask=annotationTask,exports.cKeyCode=keyCode__namespace,exports.cStyle=style,exports.CLIENT_TOOL_HEAD_TYPE=tool.CLIENT_TOOL_HEAD_TYPE,exports.CLIENT_TOOL_NAME=tool.CLIENT_TOOL_NAME,exports.DEFAULT_FONT=tool.DEFAULT_FONT,exports.DEFAULT_TEXT_MAX_WIDTH=tool.DEFAULT_TEXT_MAX_WIDTH,Object.defineProperty(exports,"EAnnotationMode",{enumerable:!0,get:function(){return tool.EAnnotationMode}}),Object.defineProperty(exports,"EAuditStatus",{enumerable:!0,get:function(){return tool.EAuditStatus}}),Object.defineProperty(exports,"ECheckModel",{enumerable:!0,get:function(){return tool.ECheckModel}}),Object.defineProperty(exports,"EDependPattern",{enumerable:!0,get:function(){return tool.EDependPattern}}),Object.defineProperty(exports,"EDragTarget",{enumerable:!0,get:function(){return tool.EDragTarget}}),Object.defineProperty(exports,"EDrawPointPattern",{enumerable:!0,get:function(){return tool.EDrawPointPattern}}),Object.defineProperty(exports,"EFilterToolOperation",{enumerable:!0,get:function(){return tool.EFilterToolOperation}}),Object.defineProperty(exports,"ELineColor",{enumerable:!0,get:function(){return tool.ELineColor}}),Object.defineProperty(exports,"ELineTypes",{enumerable:!0,get:function(){return tool.ELineTypes}}),Object.defineProperty(exports,"EOperationMode",{enumerable:!0,get:function(){return tool.EOperationMode}}),Object.defineProperty(exports,"EPageOperator",{enumerable:!0,get:function(){return tool.EPageOperator}}),Object.defineProperty(exports,"EPointCloudName",{enumerable:!0,get:function(){return tool.EPointCloudName}}),Object.defineProperty(exports,"EPolygonPattern",{enumerable:!0,get:function(){return tool.EPolygonPattern}}),Object.defineProperty(exports,"ERectPattern",{enumerable:!0,get:function(){return tool.ERectPattern}}),Object.defineProperty(exports,"EScribblePattern",{enumerable:!0,get:function(){return tool.EScribblePattern}}),Object.defineProperty(exports,"ESelectedType",{enumerable:!0,get:function(){return tool.ESelectedType}}),Object.defineProperty(exports,"ETextType",{enumerable:!0,get:function(){return tool.ETextType}}),Object.defineProperty(exports,"EThumbnailOption",{enumerable:!0,get:function(){return tool.EThumbnailOption}}),Object.defineProperty(exports,"EToolName",{enumerable:!0,get:function(){return tool.EToolName}}),Object.defineProperty(exports,"EToolType",{enumerable:!0,get:function(){return tool.EToolType}}),Object.defineProperty(exports,"EVideoToolName",{enumerable:!0,get:function(){return tool.EVideoToolName}}),exports.OPERATION_LIST=tool.OPERATION_LIST,exports.SEGMENT_NUMBER=tool.SEGMENT_NUMBER,exports.TEXT_ATTRIBUTE_LINE_HEIGHT=tool.TEXT_ATTRIBUTE_LINE_HEIGHT,exports.TEXT_ATTRIBUTE_MAX_LENGTH=tool.TEXT_ATTRIBUTE_MAX_LENGTH,exports.TEXT_TYPE=tool.TEXT_TYPE,exports.TOOL_NAME=tool.TOOL_NAME,exports.TOOL_NAME_EN=tool.TOOL_NAME_EN,exports.cTool=tool,exports.edgeAdsorptionScope=tool.edgeAdsorptionScope,exports.editStepWidth=tool.editStepWidth,exports.TagUtils=TagUtils,exports.uuid=uuid,exports.MarkerUtils=MarkerUtils,exports.RectUtils=RectUtils,exports.AxisUtils=AxisUtils.default,exports.DrawUtils=DrawUtils,exports.ImgUtils=ImgUtils,exports.MathUtils=MathUtils.default,exports.AttributeUtils=AttributeUtils.default,exports.ActionsHistory=ActionsHistory,exports.DblClickEventListener=DblClickEventListener,exports.AnnotationEngine=index,exports.UnitUtils=UnitUtils,exports.StyleUtils=StyleUtils,exports.CanvasScheduler=CanvasScheduler.CanvasScheduler,exports.PointCloud=index$1.PointCloud,exports.createThreeMatrix4=matrix.createThreeMatrix4,exports.getCuboidFromPointCloudBox=matrix.getCuboidFromPointCloudBox,exports.lidar2image=matrix.lidar2image,exports.pointCloudLidar2image=matrix.pointCloudLidar2image,exports.rotatePoint=matrix.rotatePoint,exports.transferKitti2Matrix=matrix.transferKitti2Matrix,exports.PointCloudAnnotation=annotation$1.PointCloudAnnotation,exports.CommonToolUtils=CommonToolUtils,exports.toolUtils=toolUtils;
@@ -1,24 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- exports.EMessage = void 0;
6
- (function(EMessage2) {
7
- EMessage2["NoRotateNotice"] = "noRotateNotice";
8
- EMessage2["RectErrorSizeNotice"] = "rectErrorSizeNotice";
9
- EMessage2["TextCheckNumberErrorNotice"] = "textCheckNumberErrorNotice";
10
- EMessage2["TextCheckEnglishErrorNotice"] = "textCheckEnglishErrorNotice";
11
- EMessage2["TextCheckCustomErrorNotice"] = "textCheckCustomErrorNotice";
12
- EMessage2["UpperLimitErrorNotice"] = "UpperLimitErrorNotice";
13
- EMessage2["LowerLimitErrorNotice"] = "LowerLimitErrorNotice";
14
- EMessage2["InvalidImage"] = "InvalidImage";
15
- EMessage2["DisableDelete"] = "DisableDelete";
16
- EMessage2["ClearPartialData"] = "ClearPartialData";
17
- EMessage2["MarkerFinish"] = "MarkerFinish";
18
- EMessage2["LowerLimitPoint"] = "LowerLimitPoint";
19
- EMessage2["NoRotateInDependence"] = "noRotateInDependence";
20
- EMessage2["UnableToReannotation"] = "unableToReannotation";
21
- EMessage2["ForbiddenCreationOutsideBoundary"] = "ForbiddenCreationOutsideBoundary";
22
- EMessage2["SuccessfulEdgeAdsorption"] = "SuccessfulEdgeAdsorption";
23
- EMessage2["ForbidAddNewPoint"] = "ForbidAddNewPoint";
24
- })(exports.EMessage || (exports.EMessage = {}));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EMessage=void 0,function(r){r.NoRotateNotice="noRotateNotice",r.RectErrorSizeNotice="rectErrorSizeNotice",r.TextCheckNumberErrorNotice="textCheckNumberErrorNotice",r.TextCheckEnglishErrorNotice="textCheckEnglishErrorNotice",r.TextCheckCustomErrorNotice="textCheckCustomErrorNotice",r.UpperLimitErrorNotice="UpperLimitErrorNotice",r.LowerLimitErrorNotice="LowerLimitErrorNotice",r.InvalidImage="InvalidImage",r.DisableDelete="DisableDelete",r.ClearPartialData="ClearPartialData",r.MarkerFinish="MarkerFinish",r.LowerLimitPoint="LowerLimitPoint",r.NoRotateInDependence="noRotateInDependence",r.UnableToReannotation="unableToReannotation",r.ForbiddenCreationOutsideBoundary="ForbiddenCreationOutsideBoundary",r.SuccessfulEdgeAdsorption="SuccessfulEdgeAdsorption",r.ForbidAddNewPoint="ForbidAddNewPoint"}(exports.EMessage||(exports.EMessage={}));
@@ -1,25 +1 @@
1
- 'use strict';
2
-
3
- var constants = require('../constants.js');
4
-
5
- const message = {
6
- [constants.EMessage.NoRotateNotice]: "This Image contains data and cannot be rotated",
7
- [constants.EMessage.RectErrorSizeNotice]: "The drawing frame size is smaller than the minimum drawing size",
8
- [constants.EMessage.TextCheckNumberErrorNotice]: "Please enter in number-only format",
9
- [constants.EMessage.TextCheckEnglishErrorNotice]: "Please enter in English only format",
10
- [constants.EMessage.TextCheckCustomErrorNotice]: "Please enter in the required format",
11
- [constants.EMessage.UpperLimitErrorNotice]: "The number of vertices is not more than",
12
- [constants.EMessage.LowerLimitErrorNotice]: "The number of vertices is not less than",
13
- [constants.EMessage.InvalidImage]: "Invalid image, please skip this image",
14
- [constants.EMessage.DisableDelete]: "Disable delete",
15
- [constants.EMessage.ClearPartialData]: "Clear partial data",
16
- [constants.EMessage.MarkerFinish]: "ListAnnotation is finished",
17
- [constants.EMessage.LowerLimitPoint]: "The maximum number of points has been reached",
18
- [constants.EMessage.NoRotateInDependence]: "Disallow rotation in dependent cases",
19
- [constants.EMessage.UnableToReannotation]: "Unabled to reannotation",
20
- [constants.EMessage.ForbiddenCreationOutsideBoundary]: "Fobid creation outside boundary",
21
- [constants.EMessage.SuccessfulEdgeAdsorption]: "Successful edge adsorption",
22
- [constants.EMessage.ForbidAddNewPoint]: "Forbid to add new point in rect-polygon"
23
- };
24
-
25
- module.exports = message;
1
+ "use strict";var constants=require("../constants.js");const message={[constants.EMessage.NoRotateNotice]:"This Image contains data and cannot be rotated",[constants.EMessage.RectErrorSizeNotice]:"The drawing frame size is smaller than the minimum drawing size",[constants.EMessage.TextCheckNumberErrorNotice]:"Please enter in number-only format",[constants.EMessage.TextCheckEnglishErrorNotice]:"Please enter in English only format",[constants.EMessage.TextCheckCustomErrorNotice]:"Please enter in the required format",[constants.EMessage.UpperLimitErrorNotice]:"The number of vertices is not more than",[constants.EMessage.LowerLimitErrorNotice]:"The number of vertices is not less than",[constants.EMessage.InvalidImage]:"Invalid image, please skip this image",[constants.EMessage.DisableDelete]:"Disable delete",[constants.EMessage.ClearPartialData]:"Clear partial data",[constants.EMessage.MarkerFinish]:"ListAnnotation is finished",[constants.EMessage.LowerLimitPoint]:"The maximum number of points has been reached",[constants.EMessage.NoRotateInDependence]:"Disallow rotation in dependent cases",[constants.EMessage.UnableToReannotation]:"Unabled to reannotation",[constants.EMessage.ForbiddenCreationOutsideBoundary]:"Fobid creation outside boundary",[constants.EMessage.SuccessfulEdgeAdsorption]:"Successful edge adsorption",[constants.EMessage.ForbidAddNewPoint]:"Forbid to add new point in rect-polygon"};module.exports=message;
@@ -1,19 +1 @@
1
- 'use strict';
2
-
3
- var annotation = require('../constant/annotation.js');
4
- var message$1 = require('./en_US/message.js');
5
- var message = require('./zh_CN/message.js');
6
-
7
- class Locale {
8
- }
9
- Locale.getMessagesByLocale = (key, locale) => {
10
- switch (locale) {
11
- case annotation.ELang.US:
12
- return message$1[key];
13
- case annotation.ELang.Zh:
14
- default:
15
- return message[key];
16
- }
17
- };
18
-
19
- module.exports = Locale;
1
+ "use strict";var annotation=require("../constant/annotation.js"),message$1=require("./en_US/message.js"),message=require("./zh_CN/message.js");class Locale{}Locale.getMessagesByLocale=(e,s)=>{switch(s){case annotation.ELang.US:return message$1[e];case annotation.ELang.Zh:default:return message[e]}},module.exports=Locale;
@@ -1,25 +1 @@
1
- 'use strict';
2
-
3
- var constants = require('../constants.js');
4
-
5
- const message = {
6
- [constants.EMessage.NoRotateNotice]: "\u672C\u56FE\u542B\u6709\u6570\u636E\uFF0C\u65E0\u6CD5\u8FDB\u884C\u65CB\u8F6C",
7
- [constants.EMessage.RectErrorSizeNotice]: "\u7ED8\u5236\u6846\u5C3A\u5BF8\u5C0F\u4E8E\u6700\u5C0F\u7ED8\u5236\u5C3A\u5BF8",
8
- [constants.EMessage.TextCheckNumberErrorNotice]: "\u8BF7\u6309\u4EC5\u6570\u5B57\u7684\u683C\u5F0F\u8F93\u5165",
9
- [constants.EMessage.TextCheckEnglishErrorNotice]: "\u8BF7\u6309\u4EC5\u82F1\u6587\u7684\u683C\u5F0F\u8F93\u5165",
10
- [constants.EMessage.TextCheckCustomErrorNotice]: "\u8BF7\u6309\u8981\u6C42\u7684\u683C\u5F0F\u8F93\u5165",
11
- [constants.EMessage.UpperLimitErrorNotice]: "\u9876\u70B9\u6570\u4E0D\u591A\u4E8E",
12
- [constants.EMessage.LowerLimitErrorNotice]: "\u9876\u70B9\u6570\u4E0D\u5C11\u4E8E",
13
- [constants.EMessage.InvalidImage]: "\u65E0\u6548\u56FE\u7247\uFF0C\u8BF7\u8DF3\u8FC7\u6B64\u56FE",
14
- [constants.EMessage.DisableDelete]: "\u8BE5\u6570\u636E\u7981\u6B62\u5220\u9664",
15
- [constants.EMessage.ClearPartialData]: "\u5B58\u5728\u90E8\u5206\u6570\u636E\u65E0\u6CD5\u6E05\u9664",
16
- [constants.EMessage.MarkerFinish]: "\u5217\u8868\u6807\u6CE8\u5DF2\u5B8C\u6210",
17
- [constants.EMessage.LowerLimitPoint]: "\u5DF2\u5230\u8FBE\u6807\u70B9\u6570\u91CF\u4E0A\u9650",
18
- [constants.EMessage.NoRotateInDependence]: "\u4F9D\u8D56\u60C5\u51B5\u4E0B\u65E0\u6CD5\u8FDB\u884C\u65CB\u8F6C",
19
- [constants.EMessage.UnableToReannotation]: "\u65E0\u6CD5\u8FDB\u884C\u7EED\u6807\u64CD\u4F5C",
20
- [constants.EMessage.ForbiddenCreationOutsideBoundary]: "\u8FB9\u754C\u5916\u7981\u6B62\u521B\u5EFA",
21
- [constants.EMessage.SuccessfulEdgeAdsorption]: "\u8FB9\u7F18\u5438\u9644\u6210\u529F",
22
- [constants.EMessage.ForbidAddNewPoint]: "\u6846\u4F53\u65E0\u6CD5\u6DFB\u52A0\u70B9"
23
- };
24
-
25
- module.exports = message;
1
+ "use strict";var constants=require("../constants.js");const message={[constants.EMessage.NoRotateNotice]:"\u672C\u56FE\u542B\u6709\u6570\u636E\uFF0C\u65E0\u6CD5\u8FDB\u884C\u65CB\u8F6C",[constants.EMessage.RectErrorSizeNotice]:"\u7ED8\u5236\u6846\u5C3A\u5BF8\u5C0F\u4E8E\u6700\u5C0F\u7ED8\u5236\u5C3A\u5BF8",[constants.EMessage.TextCheckNumberErrorNotice]:"\u8BF7\u6309\u4EC5\u6570\u5B57\u7684\u683C\u5F0F\u8F93\u5165",[constants.EMessage.TextCheckEnglishErrorNotice]:"\u8BF7\u6309\u4EC5\u82F1\u6587\u7684\u683C\u5F0F\u8F93\u5165",[constants.EMessage.TextCheckCustomErrorNotice]:"\u8BF7\u6309\u8981\u6C42\u7684\u683C\u5F0F\u8F93\u5165",[constants.EMessage.UpperLimitErrorNotice]:"\u9876\u70B9\u6570\u4E0D\u591A\u4E8E",[constants.EMessage.LowerLimitErrorNotice]:"\u9876\u70B9\u6570\u4E0D\u5C11\u4E8E",[constants.EMessage.InvalidImage]:"\u65E0\u6548\u56FE\u7247\uFF0C\u8BF7\u8DF3\u8FC7\u6B64\u56FE",[constants.EMessage.DisableDelete]:"\u8BE5\u6570\u636E\u7981\u6B62\u5220\u9664",[constants.EMessage.ClearPartialData]:"\u5B58\u5728\u90E8\u5206\u6570\u636E\u65E0\u6CD5\u6E05\u9664",[constants.EMessage.MarkerFinish]:"\u5217\u8868\u6807\u6CE8\u5DF2\u5B8C\u6210",[constants.EMessage.LowerLimitPoint]:"\u5DF2\u5230\u8FBE\u6807\u70B9\u6570\u91CF\u4E0A\u9650",[constants.EMessage.NoRotateInDependence]:"\u4F9D\u8D56\u60C5\u51B5\u4E0B\u65E0\u6CD5\u8FDB\u884C\u65CB\u8F6C",[constants.EMessage.UnableToReannotation]:"\u65E0\u6CD5\u8FDB\u884C\u7EED\u6807\u64CD\u4F5C",[constants.EMessage.ForbiddenCreationOutsideBoundary]:"\u8FB9\u754C\u5916\u7981\u6B62\u521B\u5EFA",[constants.EMessage.SuccessfulEdgeAdsorption]:"\u8FB9\u7F18\u5438\u9644\u6210\u529F",[constants.EMessage.ForbidAddNewPoint]:"\u6846\u4F53\u65E0\u6CD5\u6DFB\u52A0\u70B9"};module.exports=message;
@@ -1,35 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- class CanvasScheduler {
6
- constructor(props) {
7
- this.container = props.container;
8
- }
9
- createCanvas(id, options) {
10
- if (typeof id !== "string") {
11
- this.container.appendChild(id);
12
- id.style.position = "absolute";
13
- id.style.left = "0";
14
- id.style.top = "0";
15
- return id;
16
- }
17
- const canvas = document.createElement("canvas");
18
- canvas.id = id;
19
- if (options && options.size) {
20
- canvas.width = options.size.width;
21
- canvas.height = options.size.height;
22
- }
23
- this.container.appendChild(canvas);
24
- return canvas;
25
- }
26
- destroyCanvas(id) {
27
- const dom = document.getElementById(id);
28
- if (dom) {
29
- this.container.removeChild(dom);
30
- }
31
- return dom;
32
- }
33
- }
34
-
35
- exports.CanvasScheduler = CanvasScheduler;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});class CanvasScheduler{constructor(e){this.container=e.container}createCanvas(e,t){if(typeof e!="string")return this.container.appendChild(e),e.style.position="absolute",e.style.left="0",e.style.top="0",e;const n=document.createElement("canvas");return n.id=e,t&&t.size&&(n.width=t.size.width,n.height=t.size.height),this.container.appendChild(n),n}destroyCanvas(e){const t=document.getElementById(e);return t&&this.container.removeChild(t),t}}exports.CanvasScheduler=CanvasScheduler;
@@ -83,7 +83,7 @@ export declare class PointCloud {
83
83
  * @param boxParams
84
84
  * @param color
85
85
  */
86
- generateBox(boxParams: IPointCloudBox, color?: number): void;
86
+ generateBox(boxParams: IPointCloudBox, color?: THREE.ColorRepresentation): void;
87
87
  getAllAttributeColor(boxes: IPointCloudBox[]): {
88
88
  [k: string]: any;
89
89
  };
@@ -94,7 +94,7 @@ export declare class PointCloud {
94
94
  addSphereToSense: (sphereParams: IPointCloudSphere, color?: string) => void;
95
95
  generateSphere: (sphereParams: IPointCloudSphere) => void;
96
96
  generateSpheres: (spheres: IPointCloudSphere[]) => void;
97
- AddBoxToSense: (boxParams: IPointCloudBox, color?: number) => void;
97
+ AddBoxToSense: (boxParams: IPointCloudBox, color?: THREE.ColorRepresentation) => void;
98
98
  generateBoxes(boxes: IPointCloudBox[]): void;
99
99
  /**
100
100
  * Get OrthographicCamera Params to Change
@@ -1,84 +1 @@
1
- 'use strict';
2
-
3
- var _ = require('lodash');
4
-
5
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
-
7
- var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
8
-
9
- class ActionsHistory {
10
- constructor(historyChanged) {
11
- this.record = [];
12
- this.recordIndex = -1;
13
- this.minRecordIndex = -1;
14
- this.emitHistoryChanged = () => {
15
- if (this.historyChanged) {
16
- const isEmit = this.constructor.name === "ActionsHistory" ? true : this.record.length > 0;
17
- if (isEmit) {
18
- this.historyChanged(this.undoEnabled, this.redoEnabled);
19
- }
20
- }
21
- };
22
- this.historyChanged = historyChanged;
23
- }
24
- get undoEnabled() {
25
- return this.recordIndex > this.minRecordIndex;
26
- }
27
- get redoEnabled() {
28
- return this.recordIndex < this.record.length - 1;
29
- }
30
- pushHistory(action) {
31
- if (this.recordIndex !== this.record.length - 1) {
32
- const newRecord = this.record.slice(0, Math.min(this.recordIndex + 1, this.record.length));
33
- this.record = newRecord;
34
- }
35
- this.record.push(___default["default"].cloneDeepWith(action));
36
- this.recordIndex += 1;
37
- this.emitHistoryChanged();
38
- }
39
- updateHistory(newRecord) {
40
- this.record[this.recordIndex] = ___default["default"].cloneDeep(newRecord);
41
- }
42
- applyAttribute(id, key, value) {
43
- if (id) {
44
- this.record.forEach((lines) => {
45
- const line = lines.find((i) => i.id === id);
46
- if (line) {
47
- line[key] = value;
48
- }
49
- });
50
- }
51
- }
52
- undo() {
53
- if (this.undoEnabled) {
54
- this.recordIndex -= 1;
55
- this.emitHistoryChanged();
56
- return ___default["default"].cloneDeep(this.record[this.recordIndex]) || [];
57
- }
58
- }
59
- redo() {
60
- if (this.redoEnabled) {
61
- this.recordIndex += 1;
62
- this.emitHistoryChanged();
63
- return ___default["default"].cloneDeep(this.record[this.recordIndex]);
64
- }
65
- }
66
- init() {
67
- this.record = [[]];
68
- this.recordIndex = 0;
69
- this.emitHistoryChanged();
70
- }
71
- empty() {
72
- this.record = [];
73
- this.recordIndex = -1;
74
- this.emitHistoryChanged();
75
- }
76
- initRecord(data, isExitData = false) {
77
- const existData = data.length > 0 || isExitData;
78
- this.record = existData ? [___default["default"].cloneDeep(data)] : [];
79
- this.minRecordIndex = existData ? 0 : -1;
80
- this.recordIndex = 0;
81
- }
82
- }
83
-
84
- module.exports = ActionsHistory;
1
+ "use strict";var _=require("lodash");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_);class ActionsHistory{constructor(e){this.record=[],this.recordIndex=-1,this.minRecordIndex=-1,this.emitHistoryChanged=()=>{this.historyChanged&&(this.constructor.name==="ActionsHistory"?!0:this.record.length>0)&&this.historyChanged(this.undoEnabled,this.redoEnabled)},this.historyChanged=e}get undoEnabled(){return this.recordIndex>this.minRecordIndex}get redoEnabled(){return this.recordIndex<this.record.length-1}pushHistory(e){if(this.recordIndex!==this.record.length-1){const r=this.record.slice(0,Math.min(this.recordIndex+1,this.record.length));this.record=r}this.record.push(___default.default.cloneDeepWith(e)),this.recordIndex+=1,this.emitHistoryChanged()}updateHistory(e){this.record[this.recordIndex]=___default.default.cloneDeep(e)}applyAttribute(e,r,i){e&&this.record.forEach(s=>{const d=s.find(o=>o.id===e);d&&(d[r]=i)})}undo(){if(this.undoEnabled)return this.recordIndex-=1,this.emitHistoryChanged(),___default.default.cloneDeep(this.record[this.recordIndex])||[]}redo(){if(this.redoEnabled)return this.recordIndex+=1,this.emitHistoryChanged(),___default.default.cloneDeep(this.record[this.recordIndex])}init(){this.record=[[]],this.recordIndex=0,this.emitHistoryChanged()}empty(){this.record=[],this.recordIndex=-1,this.emitHistoryChanged()}initRecord(e,r=!1){const i=e.length>0||r;this.record=i?[___default.default.cloneDeep(e)]:[],this.minRecordIndex=i?0:-1,this.recordIndex=0}}module.exports=ActionsHistory;
@@ -1,23 +1 @@
1
- 'use strict';
2
-
3
- class ImgUtils {
4
- static load(src) {
5
- return new Promise((resolve, reject) => {
6
- const imgNode = new Image();
7
- imgNode.crossOrigin = "anonymous";
8
- if (src.startsWith("file")) {
9
- imgNode.src = encodeURI(src);
10
- } else {
11
- imgNode.src = src;
12
- }
13
- imgNode.onload = () => {
14
- resolve(imgNode);
15
- };
16
- imgNode.onerror = () => {
17
- reject(imgNode);
18
- };
19
- });
20
- }
21
- }
22
-
23
- module.exports = ImgUtils;
1
+ "use strict";class ImgUtils{static load(s){return new Promise((o,r)=>{const e=new Image;e.crossOrigin="anonymous",s.startsWith("file")?e.src=encodeURI(s):e.src=s,e.onload=()=>{o(e)},e.onerror=()=>{r(e)}})}}module.exports=ImgUtils;