@mlightcad/cad-simple-viewer 1.4.13 → 1.5.0

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 (406) hide show
  1. package/dist/index.js +16972 -11328
  2. package/dist/index.umd.cjs +158 -34
  3. package/dist/libredwg-parser-worker.js +4828 -4464
  4. package/dist/mtext-renderer-worker.js +3587 -3534
  5. package/lib/app/AcApDocManager.d.ts +14 -5
  6. package/lib/app/AcApDocManager.d.ts.map +1 -1
  7. package/lib/app/AcApDocManager.js +62 -19
  8. package/lib/app/AcApDocManager.js.map +1 -1
  9. package/lib/command/AcApLogCmd.d.ts +1 -1
  10. package/lib/command/AcApLogCmd.d.ts.map +1 -1
  11. package/lib/command/AcApLogCmd.js +1 -1
  12. package/lib/command/AcApLogCmd.js.map +1 -1
  13. package/lib/command/AcApOpenCmd.d.ts +1 -1
  14. package/lib/command/AcApOpenCmd.d.ts.map +1 -1
  15. package/lib/command/AcApOpenCmd.js +1 -2
  16. package/lib/command/AcApOpenCmd.js.map +1 -1
  17. package/lib/command/AcApPanCmd.d.ts +1 -1
  18. package/lib/command/AcApPanCmd.d.ts.map +1 -1
  19. package/lib/command/AcApPanCmd.js +1 -2
  20. package/lib/command/AcApPanCmd.js.map +1 -1
  21. package/lib/command/AcApQNewCmd.d.ts +1 -1
  22. package/lib/command/AcApQNewCmd.d.ts.map +1 -1
  23. package/lib/command/AcApQNewCmd.js +1 -1
  24. package/lib/command/AcApQNewCmd.js.map +1 -1
  25. package/lib/command/AcApRegenCmd.d.ts +1 -1
  26. package/lib/command/AcApRegenCmd.d.ts.map +1 -1
  27. package/lib/command/AcApRegenCmd.js +1 -1
  28. package/lib/command/AcApRegenCmd.js.map +1 -1
  29. package/lib/command/AcApSelectCmd.d.ts +1 -1
  30. package/lib/command/AcApSelectCmd.d.ts.map +1 -1
  31. package/lib/command/AcApSelectCmd.js +1 -2
  32. package/lib/command/AcApSelectCmd.js.map +1 -1
  33. package/lib/command/{AcApConvertToDxfCmd.d.ts → convert/AcApConvertToDxfCmd.d.ts} +2 -2
  34. package/lib/command/convert/AcApConvertToDxfCmd.d.ts.map +1 -0
  35. package/lib/command/{AcApConvertToDxfCmd.js → convert/AcApConvertToDxfCmd.js} +1 -1
  36. package/lib/command/convert/AcApConvertToDxfCmd.js.map +1 -0
  37. package/lib/command/{AcApConvertToPngCmd.d.ts → convert/AcApConvertToPngCmd.d.ts} +23 -5
  38. package/lib/command/convert/AcApConvertToPngCmd.d.ts.map +1 -0
  39. package/lib/command/{AcApConvertToPngCmd.js → convert/AcApConvertToPngCmd.js} +88 -15
  40. package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -0
  41. package/lib/command/{AcApConvertToSvgCmd.d.ts → convert/AcApConvertToSvgCmd.d.ts} +2 -2
  42. package/lib/command/convert/AcApConvertToSvgCmd.d.ts.map +1 -0
  43. package/lib/command/{AcApConvertToSvgCmd.js → convert/AcApConvertToSvgCmd.js} +1 -1
  44. package/lib/command/convert/AcApConvertToSvgCmd.js.map +1 -0
  45. package/lib/command/convert/AcApDxfConvertor.d.ts.map +1 -0
  46. package/lib/command/{AcApDxfConvertor.js → convert/AcApDxfConvertor.js} +1 -1
  47. package/lib/command/convert/AcApDxfConvertor.js.map +1 -0
  48. package/lib/command/{AcApPngConvertor.d.ts → convert/AcApPngConvertor.d.ts} +20 -35
  49. package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -0
  50. package/lib/command/{AcApPngConvertor.js → convert/AcApPngConvertor.js} +99 -71
  51. package/lib/command/convert/AcApPngConvertor.js.map +1 -0
  52. package/lib/command/convert/AcApSvgConvertor.d.ts.map +1 -0
  53. package/lib/command/{AcApSvgConvertor.js → convert/AcApSvgConvertor.js} +1 -1
  54. package/lib/command/convert/AcApSvgConvertor.js.map +1 -0
  55. package/lib/command/convert/index.d.ts +6 -0
  56. package/lib/command/convert/index.d.ts.map +1 -0
  57. package/lib/command/convert/index.js +6 -0
  58. package/lib/command/convert/index.js.map +1 -0
  59. package/lib/command/draw/AcApArcCmd.d.ts +297 -0
  60. package/lib/command/draw/AcApArcCmd.d.ts.map +1 -0
  61. package/lib/command/{AcApArcCmd.js → draw/AcApArcCmd.js} +793 -12
  62. package/lib/command/draw/AcApArcCmd.js.map +1 -0
  63. package/lib/command/{AcApCircleCmd.d.ts → draw/AcApCircleCmd.d.ts} +2 -2
  64. package/lib/command/draw/AcApCircleCmd.d.ts.map +1 -0
  65. package/lib/command/{AcApCircleCmd.js → draw/AcApCircleCmd.js} +3 -3
  66. package/lib/command/draw/AcApCircleCmd.js.map +1 -0
  67. package/lib/command/{AcApDimLinearCmd.d.ts → draw/AcApDimLinearCmd.d.ts} +2 -2
  68. package/lib/command/draw/AcApDimLinearCmd.d.ts.map +1 -0
  69. package/lib/command/{AcApDimLinearCmd.js → draw/AcApDimLinearCmd.js} +3 -3
  70. package/lib/command/draw/AcApDimLinearCmd.js.map +1 -0
  71. package/lib/command/{AcApEllipseCmd.d.ts → draw/AcApEllipseCmd.d.ts} +2 -2
  72. package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -0
  73. package/lib/command/{AcApEllipseCmd.js → draw/AcApEllipseCmd.js} +3 -3
  74. package/lib/command/draw/AcApEllipseCmd.js.map +1 -0
  75. package/lib/command/{AcApHatchCmd.d.ts → draw/AcApHatchCmd.d.ts} +54 -17
  76. package/lib/command/draw/AcApHatchCmd.d.ts.map +1 -0
  77. package/lib/command/{AcApHatchCmd.js → draw/AcApHatchCmd.js} +122 -30
  78. package/lib/command/draw/AcApHatchCmd.js.map +1 -0
  79. package/lib/command/{AcApLineCmd.d.ts → draw/AcApLineCmd.d.ts} +2 -2
  80. package/lib/command/draw/AcApLineCmd.d.ts.map +1 -0
  81. package/lib/command/{AcApLineCmd.js → draw/AcApLineCmd.js} +3 -3
  82. package/lib/command/draw/AcApLineCmd.js.map +1 -0
  83. package/lib/command/draw/AcApMLineCmd.d.ts +31 -0
  84. package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -0
  85. package/lib/command/draw/AcApMLineCmd.js +531 -0
  86. package/lib/command/draw/AcApMLineCmd.js.map +1 -0
  87. package/lib/command/{AcApMTextCmd.d.ts → draw/AcApMTextCmd.d.ts} +2 -2
  88. package/lib/command/draw/AcApMTextCmd.d.ts.map +1 -0
  89. package/lib/command/{AcApMTextCmd.js → draw/AcApMTextCmd.js} +3 -3
  90. package/lib/command/draw/AcApMTextCmd.js.map +1 -0
  91. package/lib/command/draw/AcApPointCmd.d.ts +16 -0
  92. package/lib/command/draw/AcApPointCmd.d.ts.map +1 -0
  93. package/lib/command/draw/AcApPointCmd.js +98 -0
  94. package/lib/command/draw/AcApPointCmd.js.map +1 -0
  95. package/lib/command/{AcApPolygonCmd.d.ts → draw/AcApPolygonCmd.d.ts} +2 -2
  96. package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -0
  97. package/lib/command/{AcApPolygonCmd.js → draw/AcApPolygonCmd.js} +3 -3
  98. package/lib/command/draw/AcApPolygonCmd.js.map +1 -0
  99. package/lib/command/{AcApPolylineCmd.d.ts → draw/AcApPolylineCmd.d.ts} +2 -2
  100. package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -0
  101. package/lib/command/{AcApPolylineCmd.js → draw/AcApPolylineCmd.js} +3 -3
  102. package/lib/command/draw/AcApPolylineCmd.js.map +1 -0
  103. package/lib/command/draw/AcApRayCmd.d.ts +10 -0
  104. package/lib/command/draw/AcApRayCmd.d.ts.map +1 -0
  105. package/lib/command/draw/AcApRayCmd.js +145 -0
  106. package/lib/command/draw/AcApRayCmd.js.map +1 -0
  107. package/lib/command/{AcApRectCmd.d.ts → draw/AcApRectCmd.d.ts} +2 -2
  108. package/lib/command/draw/AcApRectCmd.d.ts.map +1 -0
  109. package/lib/command/{AcApRectCmd.js → draw/AcApRectCmd.js} +3 -3
  110. package/lib/command/draw/AcApRectCmd.js.map +1 -0
  111. package/lib/command/{AcApSplineCmd.d.ts → draw/AcApSplineCmd.d.ts} +2 -2
  112. package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -0
  113. package/lib/command/{AcApSplineCmd.js → draw/AcApSplineCmd.js} +3 -3
  114. package/lib/command/draw/AcApSplineCmd.js.map +1 -0
  115. package/lib/command/draw/AcApXLineCmd.d.ts +25 -0
  116. package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -0
  117. package/lib/command/draw/AcApXLineCmd.js +210 -0
  118. package/lib/command/draw/AcApXLineCmd.js.map +1 -0
  119. package/lib/command/draw/index.d.ts +16 -0
  120. package/lib/command/draw/index.d.ts.map +1 -0
  121. package/lib/command/draw/index.js +16 -0
  122. package/lib/command/draw/index.js.map +1 -0
  123. package/lib/command/index.d.ts +6 -32
  124. package/lib/command/index.d.ts.map +1 -1
  125. package/lib/command/index.js +6 -32
  126. package/lib/command/index.js.map +1 -1
  127. package/lib/command/layer/AcApLayerCloseCmd.d.ts +23 -0
  128. package/lib/command/layer/AcApLayerCloseCmd.d.ts.map +1 -0
  129. package/lib/command/layer/AcApLayerCloseCmd.js +86 -0
  130. package/lib/command/layer/AcApLayerCloseCmd.js.map +1 -0
  131. package/lib/command/{AcApLayerCmd.d.ts → layer/AcApLayerCmd.d.ts} +3 -5
  132. package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -0
  133. package/lib/command/{AcApLayerCmd.js → layer/AcApLayerCmd.js} +5 -8
  134. package/lib/command/layer/AcApLayerCmd.js.map +1 -0
  135. package/lib/command/layer/AcApLayerCurCmd.d.ts +43 -0
  136. package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -0
  137. package/lib/command/layer/AcApLayerCurCmd.js +183 -0
  138. package/lib/command/layer/AcApLayerCurCmd.js.map +1 -0
  139. package/lib/command/layer/AcApLayerDelCmd.d.ts +112 -0
  140. package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -0
  141. package/lib/command/layer/AcApLayerDelCmd.js +446 -0
  142. package/lib/command/layer/AcApLayerDelCmd.js.map +1 -0
  143. package/lib/command/layer/AcApLayerFreezeCmd.d.ts +103 -0
  144. package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -0
  145. package/lib/command/layer/AcApLayerFreezeCmd.js +398 -0
  146. package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -0
  147. package/lib/command/layer/AcApLayerIsoCmd.d.ts +99 -0
  148. package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -0
  149. package/lib/command/layer/AcApLayerIsoCmd.js +485 -0
  150. package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -0
  151. package/lib/command/layer/AcApLayerIsoState.d.ts +68 -0
  152. package/lib/command/layer/AcApLayerIsoState.d.ts.map +1 -0
  153. package/lib/command/layer/AcApLayerIsoState.js +53 -0
  154. package/lib/command/layer/AcApLayerIsoState.js.map +1 -0
  155. package/lib/command/layer/AcApLayerLockCmd.d.ts +50 -0
  156. package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -0
  157. package/lib/command/layer/AcApLayerLockCmd.js +175 -0
  158. package/lib/command/layer/AcApLayerLockCmd.js.map +1 -0
  159. package/lib/command/layer/AcApLayerOffCmd.d.ts +95 -0
  160. package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -0
  161. package/lib/command/layer/AcApLayerOffCmd.js +384 -0
  162. package/lib/command/layer/AcApLayerOffCmd.js.map +1 -0
  163. package/lib/command/layer/AcApLayerOnCmd.d.ts +30 -0
  164. package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -0
  165. package/lib/command/layer/AcApLayerOnCmd.js +138 -0
  166. package/lib/command/layer/AcApLayerOnCmd.js.map +1 -0
  167. package/lib/command/layer/AcApLayerPCmd.d.ts +83 -0
  168. package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -0
  169. package/lib/command/layer/AcApLayerPCmd.js +241 -0
  170. package/lib/command/layer/AcApLayerPCmd.js.map +1 -0
  171. package/lib/command/layer/AcApLayerThawCmd.d.ts +37 -0
  172. package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -0
  173. package/lib/command/layer/AcApLayerThawCmd.js +150 -0
  174. package/lib/command/layer/AcApLayerThawCmd.js.map +1 -0
  175. package/lib/command/layer/AcApLayerUnisoCmd.d.ts +52 -0
  176. package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -0
  177. package/lib/command/layer/AcApLayerUnisoCmd.js +199 -0
  178. package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -0
  179. package/lib/command/layer/AcApLayerUnlockCmd.d.ts +50 -0
  180. package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -0
  181. package/lib/command/layer/AcApLayerUnlockCmd.js +175 -0
  182. package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -0
  183. package/lib/command/layer/index.d.ts +14 -0
  184. package/lib/command/layer/index.d.ts.map +1 -0
  185. package/lib/command/layer/index.js +14 -0
  186. package/lib/command/layer/index.js.map +1 -0
  187. package/lib/command/{AcApClearMeasurementsCmd.d.ts → measure/AcApClearMeasurementsCmd.d.ts} +2 -2
  188. package/lib/command/measure/AcApClearMeasurementsCmd.d.ts.map +1 -0
  189. package/lib/command/{AcApClearMeasurementsCmd.js → measure/AcApClearMeasurementsCmd.js} +1 -1
  190. package/lib/command/measure/AcApClearMeasurementsCmd.js.map +1 -0
  191. package/lib/command/{AcApMeasureAngleCmd.d.ts → measure/AcApMeasureAngleCmd.d.ts} +2 -2
  192. package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -0
  193. package/lib/command/{AcApMeasureAngleCmd.js → measure/AcApMeasureAngleCmd.js} +3 -3
  194. package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -0
  195. package/lib/command/{AcApMeasureArcCmd.d.ts → measure/AcApMeasureArcCmd.d.ts} +2 -2
  196. package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -0
  197. package/lib/command/{AcApMeasureArcCmd.js → measure/AcApMeasureArcCmd.js} +3 -3
  198. package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -0
  199. package/lib/command/{AcApMeasureAreaCmd.d.ts → measure/AcApMeasureAreaCmd.d.ts} +2 -2
  200. package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -0
  201. package/lib/command/{AcApMeasureAreaCmd.js → measure/AcApMeasureAreaCmd.js} +3 -3
  202. package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -0
  203. package/lib/command/{AcApMeasureDistanceCmd.d.ts → measure/AcApMeasureDistanceCmd.d.ts} +2 -2
  204. package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -0
  205. package/lib/command/{AcApMeasureDistanceCmd.js → measure/AcApMeasureDistanceCmd.js} +3 -3
  206. package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -0
  207. package/lib/command/measure/index.d.ts +6 -0
  208. package/lib/command/measure/index.d.ts.map +1 -0
  209. package/lib/command/measure/index.js +6 -0
  210. package/lib/command/measure/index.js.map +1 -0
  211. package/lib/command/modify/AcApCopyCmd.d.ts +94 -0
  212. package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -0
  213. package/lib/command/modify/AcApCopyCmd.js +549 -0
  214. package/lib/command/modify/AcApCopyCmd.js.map +1 -0
  215. package/lib/command/{AcApEraseCmd.d.ts → modify/AcApEraseCmd.d.ts} +2 -2
  216. package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -0
  217. package/lib/command/{AcApEraseCmd.js → modify/AcApEraseCmd.js} +3 -5
  218. package/lib/command/modify/AcApEraseCmd.js.map +1 -0
  219. package/lib/command/{AcApMoveCmd.d.ts → modify/AcApMoveCmd.d.ts} +2 -2
  220. package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -0
  221. package/lib/command/{AcApMoveCmd.js → modify/AcApMoveCmd.js} +3 -4
  222. package/lib/command/modify/AcApMoveCmd.js.map +1 -0
  223. package/lib/command/modify/AcApRotateCmd.d.ts +81 -0
  224. package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -0
  225. package/lib/command/modify/AcApRotateCmd.js +487 -0
  226. package/lib/command/modify/AcApRotateCmd.js.map +1 -0
  227. package/lib/command/modify/index.d.ts +5 -0
  228. package/lib/command/modify/index.d.ts.map +1 -0
  229. package/lib/command/modify/index.js +5 -0
  230. package/lib/command/modify/index.js.map +1 -0
  231. package/lib/command/{AcApBaseRevCmd.d.ts → review/AcApBaseRevCmd.d.ts} +2 -2
  232. package/lib/command/review/AcApBaseRevCmd.d.ts.map +1 -0
  233. package/lib/command/{AcApBaseRevCmd.js → review/AcApBaseRevCmd.js} +2 -2
  234. package/lib/command/review/AcApBaseRevCmd.js.map +1 -0
  235. package/lib/command/{AcApRevCircleCmd.d.ts → review/AcApRevCircleCmd.d.ts} +1 -1
  236. package/lib/command/review/AcApRevCircleCmd.d.ts.map +1 -0
  237. package/lib/command/{AcApRevCircleCmd.js → review/AcApRevCircleCmd.js} +4 -4
  238. package/lib/command/review/AcApRevCircleCmd.js.map +1 -0
  239. package/lib/command/{AcApRevCloudCmd.d.ts → review/AcApRevCloudCmd.d.ts} +2 -2
  240. package/lib/command/review/AcApRevCloudCmd.d.ts.map +1 -0
  241. package/lib/command/{AcApRevCloudCmd.js → review/AcApRevCloudCmd.js} +3 -3
  242. package/lib/command/review/AcApRevCloudCmd.js.map +1 -0
  243. package/lib/command/{AcApRevRectCmd.d.ts → review/AcApRevRectCmd.d.ts} +1 -1
  244. package/lib/command/review/AcApRevRectCmd.d.ts.map +1 -0
  245. package/lib/command/{AcApRevRectCmd.js → review/AcApRevRectCmd.js} +3 -3
  246. package/lib/command/review/AcApRevRectCmd.js.map +1 -0
  247. package/lib/command/{AcApRevVisibilityCmd.d.ts → review/AcApRevVisibilityCmd.d.ts} +1 -1
  248. package/lib/command/review/AcApRevVisibilityCmd.d.ts.map +1 -0
  249. package/lib/command/{AcApRevVisibilityCmd.js → review/AcApRevVisibilityCmd.js} +2 -2
  250. package/lib/command/review/AcApRevVisibilityCmd.js.map +1 -0
  251. package/lib/command/{AcApSketchCmd.d.ts → review/AcApSketchCmd.d.ts} +2 -2
  252. package/lib/command/review/AcApSketchCmd.d.ts.map +1 -0
  253. package/lib/command/{AcApSketchCmd.js → review/AcApSketchCmd.js} +3 -3
  254. package/lib/command/review/AcApSketchCmd.js.map +1 -0
  255. package/lib/command/review/index.d.ts +7 -0
  256. package/lib/command/review/index.d.ts.map +1 -0
  257. package/lib/command/review/index.js +7 -0
  258. package/lib/command/review/index.js.map +1 -0
  259. package/lib/editor/global/eventBus.d.ts +4 -6
  260. package/lib/editor/global/eventBus.d.ts.map +1 -1
  261. package/lib/editor/global/eventBus.js.map +1 -1
  262. package/lib/editor/input/AcEditor.d.ts +17 -0
  263. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  264. package/lib/editor/input/AcEditor.js +23 -0
  265. package/lib/editor/input/AcEditor.js.map +1 -1
  266. package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts +6 -0
  267. package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts.map +1 -1
  268. package/lib/editor/input/prompt/AcEdPromptBoxOptions.js +16 -0
  269. package/lib/editor/input/prompt/AcEdPromptBoxOptions.js.map +1 -1
  270. package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +6 -0
  271. package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
  272. package/lib/editor/input/prompt/AcEdPromptPointOptions.js +16 -0
  273. package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
  274. package/lib/editor/input/ui/AcEdCommandLine.d.ts +25 -23
  275. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  276. package/lib/editor/input/ui/AcEdCommandLine.js +101 -43
  277. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  278. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  279. package/lib/editor/input/ui/AcEdFloatingInput.js +4 -2
  280. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  281. package/lib/editor/input/ui/AcEdInputManager.d.ts +21 -0
  282. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  283. package/lib/editor/input/ui/AcEdInputManager.js +34 -4
  284. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  285. package/lib/editor/input/ui/AcEdMessageType.d.ts +10 -0
  286. package/lib/editor/input/ui/AcEdMessageType.d.ts.map +1 -0
  287. package/lib/editor/input/ui/AcEdMessageType.js +2 -0
  288. package/lib/editor/input/ui/AcEdMessageType.js.map +1 -0
  289. package/lib/editor/input/ui/index.d.ts +1 -0
  290. package/lib/editor/input/ui/index.d.ts.map +1 -1
  291. package/lib/editor/input/ui/index.js +1 -0
  292. package/lib/editor/input/ui/index.js.map +1 -1
  293. package/lib/editor/view/AcEdBaseView.d.ts +3 -8
  294. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  295. package/lib/editor/view/AcEdBaseView.js +3 -5
  296. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  297. package/lib/editor/view/AcEdHoverController.d.ts +2 -3
  298. package/lib/editor/view/AcEdHoverController.d.ts.map +1 -1
  299. package/lib/editor/view/AcEdHoverController.js +7 -0
  300. package/lib/editor/view/AcEdHoverController.js.map +1 -1
  301. package/lib/editor/view/AcEdSelectionAction.d.ts +108 -0
  302. package/lib/editor/view/AcEdSelectionAction.d.ts.map +1 -0
  303. package/lib/editor/view/AcEdSelectionAction.js +74 -0
  304. package/lib/editor/view/AcEdSelectionAction.js.map +1 -0
  305. package/lib/editor/view/index.d.ts +1 -0
  306. package/lib/editor/view/index.d.ts.map +1 -1
  307. package/lib/editor/view/index.js +1 -0
  308. package/lib/editor/view/index.js.map +1 -1
  309. package/lib/i18n/en/command.d.ts +135 -15
  310. package/lib/i18n/en/command.d.ts.map +1 -1
  311. package/lib/i18n/en/command.js +144 -24
  312. package/lib/i18n/en/command.js.map +1 -1
  313. package/lib/i18n/en/jig.d.ts +571 -212
  314. package/lib/i18n/en/jig.d.ts.map +1 -1
  315. package/lib/i18n/en/jig.js +661 -302
  316. package/lib/i18n/en/jig.js.map +1 -1
  317. package/lib/i18n/zh/command.d.ts +135 -15
  318. package/lib/i18n/zh/command.d.ts.map +1 -1
  319. package/lib/i18n/zh/command.js +145 -25
  320. package/lib/i18n/zh/command.js.map +1 -1
  321. package/lib/i18n/zh/jig.d.ts +571 -212
  322. package/lib/i18n/zh/jig.d.ts.map +1 -1
  323. package/lib/i18n/zh/jig.js +660 -301
  324. package/lib/i18n/zh/jig.js.map +1 -1
  325. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +136 -2
  326. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
  327. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +154 -16
  328. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
  329. package/lib/view/AcTrLayout.d.ts +17 -0
  330. package/lib/view/AcTrLayout.d.ts.map +1 -1
  331. package/lib/view/AcTrLayout.js +34 -2
  332. package/lib/view/AcTrLayout.js.map +1 -1
  333. package/lib/view/AcTrPickResultUtil.d.ts +4 -0
  334. package/lib/view/AcTrPickResultUtil.d.ts.map +1 -0
  335. package/lib/view/AcTrPickResultUtil.js +54 -0
  336. package/lib/view/AcTrPickResultUtil.js.map +1 -0
  337. package/lib/view/AcTrView2d.d.ts +25 -0
  338. package/lib/view/AcTrView2d.d.ts.map +1 -1
  339. package/lib/view/AcTrView2d.js +225 -100
  340. package/lib/view/AcTrView2d.js.map +1 -1
  341. package/package.json +6 -6
  342. package/lib/command/AcApArcCmd.d.ts +0 -140
  343. package/lib/command/AcApArcCmd.d.ts.map +0 -1
  344. package/lib/command/AcApArcCmd.js.map +0 -1
  345. package/lib/command/AcApBaseRevCmd.d.ts.map +0 -1
  346. package/lib/command/AcApBaseRevCmd.js.map +0 -1
  347. package/lib/command/AcApCircleCmd.d.ts.map +0 -1
  348. package/lib/command/AcApCircleCmd.js.map +0 -1
  349. package/lib/command/AcApClearMeasurementsCmd.d.ts.map +0 -1
  350. package/lib/command/AcApClearMeasurementsCmd.js.map +0 -1
  351. package/lib/command/AcApConvertToDxfCmd.d.ts.map +0 -1
  352. package/lib/command/AcApConvertToDxfCmd.js.map +0 -1
  353. package/lib/command/AcApConvertToPngCmd.d.ts.map +0 -1
  354. package/lib/command/AcApConvertToPngCmd.js.map +0 -1
  355. package/lib/command/AcApConvertToSvgCmd.d.ts.map +0 -1
  356. package/lib/command/AcApConvertToSvgCmd.js.map +0 -1
  357. package/lib/command/AcApDimLinearCmd.d.ts.map +0 -1
  358. package/lib/command/AcApDimLinearCmd.js.map +0 -1
  359. package/lib/command/AcApDxfConvertor.d.ts.map +0 -1
  360. package/lib/command/AcApDxfConvertor.js.map +0 -1
  361. package/lib/command/AcApEllipseCmd.d.ts.map +0 -1
  362. package/lib/command/AcApEllipseCmd.js.map +0 -1
  363. package/lib/command/AcApEraseCmd.d.ts.map +0 -1
  364. package/lib/command/AcApEraseCmd.js.map +0 -1
  365. package/lib/command/AcApHatchCmd.d.ts.map +0 -1
  366. package/lib/command/AcApHatchCmd.js.map +0 -1
  367. package/lib/command/AcApLayerCmd.d.ts.map +0 -1
  368. package/lib/command/AcApLayerCmd.js.map +0 -1
  369. package/lib/command/AcApLineCmd.d.ts.map +0 -1
  370. package/lib/command/AcApLineCmd.js.map +0 -1
  371. package/lib/command/AcApMTextCmd.d.ts.map +0 -1
  372. package/lib/command/AcApMTextCmd.js.map +0 -1
  373. package/lib/command/AcApMeasureAngleCmd.d.ts.map +0 -1
  374. package/lib/command/AcApMeasureAngleCmd.js.map +0 -1
  375. package/lib/command/AcApMeasureArcCmd.d.ts.map +0 -1
  376. package/lib/command/AcApMeasureArcCmd.js.map +0 -1
  377. package/lib/command/AcApMeasureAreaCmd.d.ts.map +0 -1
  378. package/lib/command/AcApMeasureAreaCmd.js.map +0 -1
  379. package/lib/command/AcApMeasureDistanceCmd.d.ts.map +0 -1
  380. package/lib/command/AcApMeasureDistanceCmd.js.map +0 -1
  381. package/lib/command/AcApMoveCmd.d.ts.map +0 -1
  382. package/lib/command/AcApMoveCmd.js.map +0 -1
  383. package/lib/command/AcApPngConvertor.d.ts.map +0 -1
  384. package/lib/command/AcApPngConvertor.js.map +0 -1
  385. package/lib/command/AcApPolygonCmd.d.ts.map +0 -1
  386. package/lib/command/AcApPolygonCmd.js.map +0 -1
  387. package/lib/command/AcApPolylineCmd.d.ts.map +0 -1
  388. package/lib/command/AcApPolylineCmd.js.map +0 -1
  389. package/lib/command/AcApRectCmd.d.ts.map +0 -1
  390. package/lib/command/AcApRectCmd.js.map +0 -1
  391. package/lib/command/AcApRevCircleCmd.d.ts.map +0 -1
  392. package/lib/command/AcApRevCircleCmd.js.map +0 -1
  393. package/lib/command/AcApRevCloudCmd.d.ts.map +0 -1
  394. package/lib/command/AcApRevCloudCmd.js.map +0 -1
  395. package/lib/command/AcApRevRectCmd.d.ts.map +0 -1
  396. package/lib/command/AcApRevRectCmd.js.map +0 -1
  397. package/lib/command/AcApRevVisibilityCmd.d.ts.map +0 -1
  398. package/lib/command/AcApRevVisibilityCmd.js.map +0 -1
  399. package/lib/command/AcApSketchCmd.d.ts.map +0 -1
  400. package/lib/command/AcApSketchCmd.js.map +0 -1
  401. package/lib/command/AcApSplineCmd.d.ts.map +0 -1
  402. package/lib/command/AcApSplineCmd.js.map +0 -1
  403. package/lib/command/AcApSvgConvertor.d.ts.map +0 -1
  404. package/lib/command/AcApSvgConvertor.js.map +0 -1
  405. /package/lib/command/{AcApDxfConvertor.d.ts → convert/AcApDxfConvertor.d.ts} +0 -0
  406. /package/lib/command/{AcApSvgConvertor.d.ts → convert/AcApSvgConvertor.d.ts} +0 -0
@@ -0,0 +1,446 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ var __generator = (this && this.__generator) || function (thisArg, body) {
26
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
27
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ function verb(n) { return function (v) { return step([n, v]); }; }
29
+ function step(op) {
30
+ if (f) throw new TypeError("Generator is already executing.");
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
+ if (y = 0, t) op = [op[0] & 2, t.value];
34
+ switch (op[0]) {
35
+ case 0: case 1: t = op; break;
36
+ case 4: _.label++; return { value: op[1], done: false };
37
+ case 5: _.label++; y = op[1]; op = [0]; continue;
38
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
+ default:
40
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
+ if (t[2]) _.ops.pop();
45
+ _.trys.pop(); continue;
46
+ }
47
+ op = body.call(thisArg, _);
48
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
+ }
51
+ };
52
+ var __read = (this && this.__read) || function (o, n) {
53
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
54
+ if (!m) return o;
55
+ var i = m.call(o), r, ar = [], e;
56
+ try {
57
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
58
+ }
59
+ catch (error) { e = { error: error }; }
60
+ finally {
61
+ try {
62
+ if (r && !r.done && (m = i["return"])) m.call(i);
63
+ }
64
+ finally { if (e) throw e.error; }
65
+ }
66
+ return ar;
67
+ };
68
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
69
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
70
+ if (ar || !(i in from)) {
71
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
72
+ ar[i] = from[i];
73
+ }
74
+ }
75
+ return to.concat(ar || Array.prototype.slice.call(from));
76
+ };
77
+ var __values = (this && this.__values) || function(o) {
78
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
79
+ if (m) return m.call(o);
80
+ if (o && typeof o.length === "number") return {
81
+ next: function () {
82
+ if (o && i >= o.length) o = void 0;
83
+ return { value: o && o[i++], done: !o };
84
+ }
85
+ };
86
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
87
+ };
88
+ import { AcApDocManager } from '../../app';
89
+ import { AcEdCommand, AcEdOpenMode, AcEdPromptEntityOptions, AcEdPromptStatus, AcEdPromptStringOptions } from '../../editor';
90
+ import { AcApI18n } from '../../i18n';
91
+ /**
92
+ * AutoCAD-like `LAYDEL` command.
93
+ *
94
+ * Supported workflows:
95
+ * - Pick an entity to delete its layer and every object on that layer.
96
+ * - Switch to the `Name` branch to delete a layer by name.
97
+ * - Use `Undo` to restore the most recently deleted layer in the current
98
+ * command session.
99
+ */
100
+ var AcApLayerDelCmd = /** @class */ (function (_super) {
101
+ __extends(AcApLayerDelCmd, _super);
102
+ /**
103
+ * Creates a write-enabled `LAYDEL` command instance.
104
+ */
105
+ function AcApLayerDelCmd() {
106
+ var _this = _super.call(this) || this;
107
+ _this._history = [];
108
+ _this.mode = AcEdOpenMode.Write;
109
+ return _this;
110
+ }
111
+ /**
112
+ * Runs the interactive layer deletion workflow until the user cancels.
113
+ *
114
+ * The command supports both entity-based and name-based deletion paths and
115
+ * keeps an in-memory undo history for the current command session only.
116
+ *
117
+ * @param context - Active application context used to inspect and mutate the drawing.
118
+ * @returns Resolves when the command loop ends.
119
+ */
120
+ AcApLayerDelCmd.prototype.execute = function (context) {
121
+ return __awaiter(this, void 0, void 0, function () {
122
+ var action;
123
+ return __generator(this, function (_a) {
124
+ switch (_a.label) {
125
+ case 0:
126
+ this._history = [];
127
+ _a.label = 1;
128
+ case 1:
129
+ if (!true) return [3 /*break*/, 7];
130
+ return [4 /*yield*/, this.promptMainAction()];
131
+ case 2:
132
+ action = _a.sent();
133
+ if (!action)
134
+ return [2 /*return*/];
135
+ if (!(action.type === 'keyword')) return [3 /*break*/, 6];
136
+ if (!(action.keyword === 'Name')) return [3 /*break*/, 4];
137
+ return [4 /*yield*/, this.runNameBranch(context)];
138
+ case 3:
139
+ _a.sent();
140
+ return [3 /*break*/, 5];
141
+ case 4:
142
+ this.runUndo(context);
143
+ _a.label = 5;
144
+ case 5: return [3 /*break*/, 1];
145
+ case 6:
146
+ this.deleteLayerByEntity(context, action.objectId);
147
+ return [3 /*break*/, 1];
148
+ case 7: return [2 /*return*/];
149
+ }
150
+ });
151
+ });
152
+ };
153
+ /**
154
+ * Sends a localized status message through the command-line output.
155
+ *
156
+ * @param message - Text to display to the user.
157
+ * @param type - Visual severity mapped to command-line message styles.
158
+ */
159
+ AcApLayerDelCmd.prototype.notify = function (message, type) {
160
+ if (type === void 0) { type = 'info'; }
161
+ AcApDocManager.instance.editor.showMessage(message, type);
162
+ };
163
+ /**
164
+ * Registers a localized keyword on an entity or string prompt.
165
+ *
166
+ * @param prompt - Prompt instance that should expose the keyword.
167
+ * @param keyword - I18n keyword identifier under `jig.laydel.keywords`.
168
+ */
169
+ AcApLayerDelCmd.prototype.addKeyword = function (prompt, keyword) {
170
+ prompt.keywords.add(AcApI18n.t("jig.laydel.keywords.".concat(keyword, ".display")), AcApI18n.t("jig.laydel.keywords.".concat(keyword, ".global")), AcApI18n.t("jig.laydel.keywords.".concat(keyword, ".local")));
171
+ };
172
+ /**
173
+ * Prompts for the main `LAYDEL` action.
174
+ *
175
+ * Users can either pick an entity to infer the target layer or switch to a
176
+ * keyword branch such as `Name` or `Undo`.
177
+ *
178
+ * @returns Resolved action, or `undefined` when the prompt is canceled.
179
+ */
180
+ AcApLayerDelCmd.prototype.promptMainAction = function () {
181
+ return __awaiter(this, void 0, void 0, function () {
182
+ var prompt, result;
183
+ return __generator(this, function (_a) {
184
+ switch (_a.label) {
185
+ case 0:
186
+ prompt = new AcEdPromptEntityOptions(AcApI18n.t('jig.laydel.selectPrompt'));
187
+ prompt.allowNone = true;
188
+ prompt.allowObjectOnLockedLayer = true;
189
+ prompt.setRejectMessage(AcApI18n.t('jig.laydel.invalidSelection'));
190
+ this.addKeyword(prompt, 'name');
191
+ this.addKeyword(prompt, 'undo');
192
+ return [4 /*yield*/, AcApDocManager.instance.editor.getEntity(prompt)];
193
+ case 1:
194
+ result = _a.sent();
195
+ if (result.status === AcEdPromptStatus.OK && result.objectId) {
196
+ return [2 /*return*/, { type: 'entity', objectId: result.objectId }];
197
+ }
198
+ if (result.status === AcEdPromptStatus.Keyword &&
199
+ (result.stringResult === 'Name' || result.stringResult === 'Undo')) {
200
+ return [2 /*return*/, { type: 'keyword', keyword: result.stringResult }];
201
+ }
202
+ return [2 /*return*/, undefined];
203
+ }
204
+ });
205
+ });
206
+ };
207
+ /**
208
+ * Runs the layer-name branch until the user exits that submenu.
209
+ *
210
+ * @param context - Active application context used to list, delete, or restore layers.
211
+ * @returns Resolves when the name submenu ends.
212
+ */
213
+ AcApLayerDelCmd.prototype.runNameBranch = function (context) {
214
+ return __awaiter(this, void 0, void 0, function () {
215
+ var action;
216
+ return __generator(this, function (_a) {
217
+ switch (_a.label) {
218
+ case 0:
219
+ if (!true) return [3 /*break*/, 2];
220
+ return [4 /*yield*/, this.promptLayerNameAction()];
221
+ case 1:
222
+ action = _a.sent();
223
+ if (!action)
224
+ return [2 /*return*/];
225
+ if (action.type === 'keyword') {
226
+ if (action.keyword === '?') {
227
+ this.listLayers(context);
228
+ }
229
+ else {
230
+ this.runUndo(context);
231
+ }
232
+ return [3 /*break*/, 0];
233
+ }
234
+ this.deleteLayerByName(context, action.layerName);
235
+ return [3 /*break*/, 0];
236
+ case 2: return [2 /*return*/];
237
+ }
238
+ });
239
+ });
240
+ };
241
+ /**
242
+ * Prompts for a layer name or one of the name-branch keywords.
243
+ *
244
+ * @returns Resolved name action, or `undefined` when canceled or left blank.
245
+ */
246
+ AcApLayerDelCmd.prototype.promptLayerNameAction = function () {
247
+ return __awaiter(this, void 0, void 0, function () {
248
+ var prompt, result, layerName;
249
+ var _a;
250
+ return __generator(this, function (_b) {
251
+ switch (_b.label) {
252
+ case 0:
253
+ prompt = new AcEdPromptStringOptions(AcApI18n.t('jig.laydel.namePrompt'));
254
+ prompt.allowSpaces = true;
255
+ prompt.allowEmpty = true;
256
+ this.addKeyword(prompt, 'list');
257
+ this.addKeyword(prompt, 'undo');
258
+ return [4 /*yield*/, AcApDocManager.instance.editor.getString(prompt)];
259
+ case 1:
260
+ result = _b.sent();
261
+ if (result.status === AcEdPromptStatus.Keyword &&
262
+ (result.stringResult === '?' || result.stringResult === 'Undo')) {
263
+ return [2 /*return*/, { type: 'keyword', keyword: result.stringResult }];
264
+ }
265
+ if (result.status !== AcEdPromptStatus.OK)
266
+ return [2 /*return*/, undefined];
267
+ layerName = ((_a = result.stringResult) !== null && _a !== void 0 ? _a : '').trim();
268
+ if (!layerName)
269
+ return [2 /*return*/, undefined];
270
+ return [2 /*return*/, { type: 'name', layerName: layerName }];
271
+ }
272
+ });
273
+ });
274
+ };
275
+ /**
276
+ * Prints a snapshot of all current layers to the console and notifies the UI.
277
+ *
278
+ * @param context - Active application context providing access to the layer table.
279
+ */
280
+ AcApLayerDelCmd.prototype.listLayers = function (context) {
281
+ var db = context.doc.database;
282
+ var rows = __spreadArray([], __read(db.tables.layerTable.newIterator()), false).map(function (layer) { return ({
283
+ name: layer.name,
284
+ current: db.clayer === layer.name ? '*' : '',
285
+ on: layer.isOff ? 'No' : 'Yes',
286
+ frozen: layer.isFrozen ? 'Yes' : 'No',
287
+ locked: layer.isLocked ? 'Yes' : 'No'
288
+ }); });
289
+ console.table(rows);
290
+ this.notify(AcApI18n.t('jig.laydel.layerListSummary'), 'info');
291
+ };
292
+ /**
293
+ * Resolves the selected entity's layer name and delegates to layer deletion by name.
294
+ *
295
+ * @param context - Active application context containing the current database.
296
+ * @param objectId - Identifier of the entity selected by the user.
297
+ */
298
+ AcApLayerDelCmd.prototype.deleteLayerByEntity = function (context, objectId) {
299
+ var _a;
300
+ var entity = context.doc.database.tables.blockTable.getEntityById(objectId);
301
+ var layerName = (_a = entity === null || entity === void 0 ? void 0 : entity.layer) === null || _a === void 0 ? void 0 : _a.trim();
302
+ if (!layerName) {
303
+ this.notify(AcApI18n.t('jig.laydel.invalidSelection'), 'warning');
304
+ return;
305
+ }
306
+ this.deleteLayerByName(context, layerName);
307
+ };
308
+ /**
309
+ * Deletes a layer and every entity currently assigned to it.
310
+ *
311
+ * The removed layer record and cloned entities are stored in `_history` so
312
+ * that `Undo` can reconstruct the previous state during the same run.
313
+ *
314
+ * @param context - Active application context containing the drawing to mutate.
315
+ * @param layerName - Name of the layer to remove.
316
+ */
317
+ AcApLayerDelCmd.prototype.deleteLayerByName = function (context, layerName) {
318
+ var db = context.doc.database;
319
+ var layer = db.tables.layerTable.getAt(layerName);
320
+ if (!layer) {
321
+ this.notify("".concat(AcApI18n.t('jig.laydel.layerNotFound'), ": ").concat(layerName));
322
+ return;
323
+ }
324
+ if (layer.name === '0') {
325
+ this.notify(AcApI18n.t('jig.laydel.cannotDeleteZeroLayer'), 'warning');
326
+ return;
327
+ }
328
+ if (layer.name === db.clayer) {
329
+ this.notify(AcApI18n.t('jig.laydel.cannotDeleteCurrent'), 'warning');
330
+ return;
331
+ }
332
+ var deletedEntities = this.collectLayerEntities(context, layer.name);
333
+ this.removeLayerEntities(context, deletedEntities);
334
+ var deletedLayer = layer.clone();
335
+ db.tables.layerTable.remove(layer.name);
336
+ db.events.layerErased.dispatch({ database: db, layer: layer });
337
+ this._history.push({
338
+ layer: deletedLayer,
339
+ entities: deletedEntities
340
+ });
341
+ context.view.selectionSet.clear();
342
+ AcApDocManager.instance.regen();
343
+ this.notify("".concat(AcApI18n.t('jig.laydel.deleted'), ": ").concat(layer.name), 'success');
344
+ };
345
+ /**
346
+ * Captures clones of every entity that belongs to the specified layer.
347
+ *
348
+ * Each snapshot also records the owning block record so undo can restore the
349
+ * entities to the correct container.
350
+ *
351
+ * @param context - Active application context containing the current database.
352
+ * @param layerName - Layer whose entities should be collected.
353
+ * @returns Cloned entity snapshots grouped later by owner during deletion or undo.
354
+ */
355
+ AcApLayerDelCmd.prototype.collectLayerEntities = function (context, layerName) {
356
+ var e_1, _a, e_2, _b;
357
+ var snapshots = [];
358
+ try {
359
+ for (var _c = __values(context.doc.database.tables.blockTable.newIterator()), _d = _c.next(); !_d.done; _d = _c.next()) {
360
+ var blockRecord = _d.value;
361
+ try {
362
+ for (var _e = (e_2 = void 0, __values(blockRecord.newIterator())), _f = _e.next(); !_f.done; _f = _e.next()) {
363
+ var entity = _f.value;
364
+ if (entity.layer !== layerName)
365
+ continue;
366
+ snapshots.push({
367
+ ownerId: blockRecord.objectId,
368
+ objectId: entity.objectId,
369
+ entity: entity.clone()
370
+ });
371
+ }
372
+ }
373
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
374
+ finally {
375
+ try {
376
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
377
+ }
378
+ finally { if (e_2) throw e_2.error; }
379
+ }
380
+ }
381
+ }
382
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
383
+ finally {
384
+ try {
385
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
386
+ }
387
+ finally { if (e_1) throw e_1.error; }
388
+ }
389
+ return snapshots;
390
+ };
391
+ /**
392
+ * Removes the captured entities from their owning block records.
393
+ *
394
+ * @param context - Active application context containing the current database.
395
+ * @param deletedEntities - Entity snapshots to remove from the drawing.
396
+ */
397
+ AcApLayerDelCmd.prototype.removeLayerEntities = function (context, deletedEntities) {
398
+ var idsByOwner = new Map();
399
+ deletedEntities.forEach(function (_a) {
400
+ var _b;
401
+ var ownerId = _a.ownerId, objectId = _a.objectId;
402
+ var ids = (_b = idsByOwner.get(ownerId)) !== null && _b !== void 0 ? _b : [];
403
+ ids.push(objectId);
404
+ idsByOwner.set(ownerId, ids);
405
+ });
406
+ idsByOwner.forEach(function (ids, ownerId) {
407
+ var _a;
408
+ (_a = context.doc.database.tables.blockTable.getIdAt(ownerId)) === null || _a === void 0 ? void 0 : _a.removeEntity(ids);
409
+ });
410
+ };
411
+ /**
412
+ * Restores the most recently deleted layer and its entities.
413
+ *
414
+ * @param context - Active application context containing the current database and view.
415
+ */
416
+ AcApLayerDelCmd.prototype.runUndo = function (context) {
417
+ var entry = this._history.pop();
418
+ if (!entry) {
419
+ this.notify(AcApI18n.t('jig.laydel.nothingToUndo'), 'warning');
420
+ return;
421
+ }
422
+ var db = context.doc.database;
423
+ if (!db.tables.layerTable.has(entry.layer.name)) {
424
+ db.tables.layerTable.add(entry.layer.clone());
425
+ }
426
+ var entitiesByOwner = new Map();
427
+ entry.entities.forEach(function (_a) {
428
+ var _b;
429
+ var ownerId = _a.ownerId, entity = _a.entity;
430
+ var entities = (_b = entitiesByOwner.get(ownerId)) !== null && _b !== void 0 ? _b : [];
431
+ entities.push(entity.clone());
432
+ entitiesByOwner.set(ownerId, entities);
433
+ });
434
+ entitiesByOwner.forEach(function (entities, ownerId) {
435
+ var _a;
436
+ var owner = (_a = db.tables.blockTable.getIdAt(ownerId)) !== null && _a !== void 0 ? _a : db.tables.blockTable.modelSpace;
437
+ owner.appendEntity(entities);
438
+ });
439
+ context.view.selectionSet.clear();
440
+ AcApDocManager.instance.regen();
441
+ this.notify("".concat(AcApI18n.t('jig.laydel.restored'), ": ").concat(entry.layer.name), 'success');
442
+ };
443
+ return AcApLayerDelCmd;
444
+ }(AcEdCommand));
445
+ export { AcApLayerDelCmd };
446
+ //# sourceMappingURL=AcApLayerDelCmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApLayerDelCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerDelCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,WAAW,EAEX,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAiFrC;;;;;;;;GAQG;AACH;IAAqC,mCAAW;IAG9C;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QAND,cAAQ,GAAyB,EAAE,CAAA;QAOzC,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CA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AA,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAA;YACnD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;YAC7B,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACxC,CAAC,CAAC,CAAA;QAEF,eAAe,CAAC,OAAO,CAAC,UAAC,QAAQ,EAAE,OAAO;;YACxC,IAAM,KAAK,GACT,MAAA,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAA;YAC1E,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA;QAC9B,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;QACjC,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;QAC/B,IAAI,CAAC,MAAM,CACT,UAAG,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,eAAK,KAAK,CAAC,KAAK,CAAC,IAAI,CAAE,EAC3D,SAAS,CACV,CAAA;IACH,CAAC;IACH,sBAAC;AAAD,CAAC,AAtUD,CAAqC,WAAW,GAsU/C"}
@@ -0,0 +1,103 @@
1
+ import { AcApContext } from '../../app';
2
+ import { AcEdCommand } from '../../editor';
3
+ /**
4
+ * AutoCAD-like `LAYFRZ` command.
5
+ *
6
+ * The command repeatedly asks the user to pick an entity and freezes the
7
+ * corresponding layer. It also supports the AutoCAD-style `Settings` and
8
+ * `Undo` branches during the same command session.
9
+ *
10
+ * Current viewer limitations:
11
+ * - Only one global viewport is available, so `Vpfreeze` behaves like
12
+ * `Freeze`.
13
+ * - Nested block/xref sub-entity picking is not exposed yet, so the block
14
+ * selection setting is stored for future use but does not currently change
15
+ * the resolved target layer.
16
+ */
17
+ export declare class AcApLayerFreezeCmd extends AcEdCommand {
18
+ private static _settings;
19
+ private _history;
20
+ private _vpfreezeHintShown;
21
+ /**
22
+ * Creates a write-enabled `LAYFRZ` command instance.
23
+ */
24
+ constructor();
25
+ /**
26
+ * Runs the interactive freeze-layer workflow until the user cancels.
27
+ *
28
+ * The command keeps its per-run undo stack in memory and reuses the static
29
+ * settings selected in previous `LAYFRZ` invocations.
30
+ *
31
+ * @param context - Active application context used to read and update the current drawing.
32
+ * @returns Resolves when the command loop ends.
33
+ */
34
+ execute(context: AcApContext): Promise<void>;
35
+ /**
36
+ * Sends a localized status message through the command-line output.
37
+ *
38
+ * @param message - Text to display to the user.
39
+ * @param type - Visual severity mapped to command-line message styles.
40
+ */
41
+ private notify;
42
+ /**
43
+ * Registers a localized keyword on an entity or keyword prompt.
44
+ *
45
+ * @param prompt - Prompt instance that should expose the keyword to the user.
46
+ * @param key - I18n keyword identifier under `jig.layfrz.keywords`.
47
+ */
48
+ private addKeyword;
49
+ /**
50
+ * Prompts for either a picked entity or one of the top-level command keywords.
51
+ *
52
+ * @returns Resolved selection or keyword action, or `undefined` when the user cancels.
53
+ */
54
+ private promptSelection;
55
+ /**
56
+ * Opens the `Settings` branch and keeps prompting until the user exits it.
57
+ *
58
+ * @returns Resolves when the settings submenu is closed.
59
+ */
60
+ private runSettings;
61
+ /**
62
+ * Prompts for the viewport-freeze mode to store for subsequent selections.
63
+ *
64
+ * `Vpfreeze` currently falls back to a global freeze because the viewer does
65
+ * not expose per-viewport layer state.
66
+ *
67
+ * @returns Resolves when the prompt is dismissed or the setting is updated.
68
+ */
69
+ private promptViewportMode;
70
+ /**
71
+ * Prompts for how nested block selections should resolve their target layer.
72
+ *
73
+ * The chosen value is persisted for later use even though nested selection is
74
+ * not yet implemented in the viewer.
75
+ *
76
+ * @returns Resolves when the prompt is dismissed or the setting is updated.
77
+ */
78
+ private promptBlockSelectionMode;
79
+ /**
80
+ * Toggles the frozen flag on a layer table record.
81
+ *
82
+ * @param layer - Layer record to update.
83
+ * @param frozen - Whether the layer should be marked frozen.
84
+ */
85
+ private setLayerFrozen;
86
+ /**
87
+ * Resolves the picked entity's layer and freezes it when allowed.
88
+ *
89
+ * The method validates the selection, prevents freezing the current layer,
90
+ * records undo history, and clears the selection set after a successful edit.
91
+ *
92
+ * @param context - Active application context containing the current database and view.
93
+ * @param objectId - Identifier of the entity selected by the user.
94
+ */
95
+ private freezeEntityLayer;
96
+ /**
97
+ * Restores the most recently frozen layer state captured during this run.
98
+ *
99
+ * @param context - Active application context containing the current database and view.
100
+ */
101
+ private runUndo;
102
+ }
103
+ //# sourceMappingURL=AcApLayerFreezeCmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApLayerFreezeCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerFreezeCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,WAAW,EAMZ,MAAM,cAAc,CAAA;AA4ErB;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,OAAO,CAAC,MAAM,CAAC,SAAS,CAA0C;IAElE,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,kBAAkB,CAAQ;IAElC;;OAEG;;IAMH;;;;;;;;OAQG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;IAsBlC;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAId;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAoBlB;;;;OAIG;YACW,eAAe;IA8B7B;;;;OAIG;YACW,WAAW;IAwBzB;;;;;;;OAOG;YACW,kBAAkB;IAqChC;;;;;;;OAOG;YACW,wBAAwB;IAuCtC;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAKtB;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAkDzB;;;;OAIG;IACH,OAAO,CAAC,OAAO;CAyBhB"}