@mlightcad/cad-simple-viewer 1.5.5 → 1.5.7

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 (462) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +69 -1
  3. package/dist/{index.js → cad-simple-viewer.js} +34247 -29923
  4. package/dist/cad-simple-viewer.umd.cjs +913 -0
  5. package/dist/dxf-parser-worker.js +2091 -0
  6. package/dist/libredwg-parser-worker.js +5388 -5122
  7. package/dist/mtext-renderer-worker.js +3061 -2858
  8. package/lib/app/AcApContext.d.ts.map +1 -1
  9. package/lib/app/AcApContext.js +15 -2
  10. package/lib/app/AcApContext.js.map +1 -1
  11. package/lib/app/AcApDocManager.d.ts +63 -0
  12. package/lib/app/AcApDocManager.d.ts.map +1 -1
  13. package/lib/app/AcApDocManager.js +195 -23
  14. package/lib/app/AcApDocManager.js.map +1 -1
  15. package/lib/app/AcApDocument.d.ts +81 -0
  16. package/lib/app/AcApDocument.d.ts.map +1 -1
  17. package/lib/app/AcApDocument.js +154 -0
  18. package/lib/app/AcApDocument.js.map +1 -1
  19. package/lib/app/AcApLayerSessionState.d.ts +15 -0
  20. package/lib/app/AcApLayerSessionState.d.ts.map +1 -0
  21. package/lib/app/AcApLayerSessionState.js +2 -0
  22. package/lib/app/AcApLayerSessionState.js.map +1 -0
  23. package/lib/app/AcApOpenFileDialog.d.ts +35 -0
  24. package/lib/app/AcApOpenFileDialog.d.ts.map +1 -0
  25. package/lib/app/AcApOpenFileDialog.js +192 -0
  26. package/lib/app/AcApOpenFileDialog.js.map +1 -0
  27. package/lib/app/AcApWebworkerReadiness.d.ts +18 -0
  28. package/lib/app/AcApWebworkerReadiness.d.ts.map +1 -0
  29. package/lib/app/AcApWebworkerReadiness.js +126 -0
  30. package/lib/app/AcApWebworkerReadiness.js.map +1 -0
  31. package/lib/app/AcDbOpenDatabaseOptions.d.ts +29 -0
  32. package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -1
  33. package/lib/app/AcDbOpenDatabaseOptions.js +10 -1
  34. package/lib/app/AcDbOpenDatabaseOptions.js.map +1 -1
  35. package/lib/app/index.d.ts +4 -0
  36. package/lib/app/index.d.ts.map +1 -1
  37. package/lib/app/index.js +3 -0
  38. package/lib/app/index.js.map +1 -1
  39. package/lib/command/AcApCacheFontCmd.d.ts +25 -0
  40. package/lib/command/AcApCacheFontCmd.d.ts.map +1 -0
  41. package/lib/command/AcApCacheFontCmd.js +142 -0
  42. package/lib/command/AcApCacheFontCmd.js.map +1 -0
  43. package/lib/command/AcApOpenCmd.d.ts +3 -22
  44. package/lib/command/AcApOpenCmd.d.ts.map +1 -1
  45. package/lib/command/AcApOpenCmd.js +3 -22
  46. package/lib/command/AcApOpenCmd.js.map +1 -1
  47. package/lib/command/AcApRedoCmd.d.ts +10 -0
  48. package/lib/command/AcApRedoCmd.d.ts.map +1 -0
  49. package/lib/command/AcApRedoCmd.js +85 -0
  50. package/lib/command/AcApRedoCmd.js.map +1 -0
  51. package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
  52. package/lib/command/AcApSysVarCmd.js +5 -11
  53. package/lib/command/AcApSysVarCmd.js.map +1 -1
  54. package/lib/command/AcApUndoCmd.d.ts +10 -0
  55. package/lib/command/AcApUndoCmd.d.ts.map +1 -0
  56. package/lib/command/AcApUndoCmd.js +85 -0
  57. package/lib/command/AcApUndoCmd.js.map +1 -0
  58. package/lib/command/convert/AcApPngConvertor.d.ts +1 -1
  59. package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -1
  60. package/lib/command/convert/AcApPngConvertor.js +5 -2
  61. package/lib/command/convert/AcApPngConvertor.js.map +1 -1
  62. package/lib/command/draw/AcApArcCmd.d.ts.map +1 -1
  63. package/lib/command/draw/AcApArcCmd.js +2 -5
  64. package/lib/command/draw/AcApArcCmd.js.map +1 -1
  65. package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -1
  66. package/lib/command/draw/AcApEllipseCmd.js +14 -9
  67. package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
  68. package/lib/command/draw/AcApHatchCmd.d.ts +1 -1
  69. package/lib/command/draw/AcApLineCmd.d.ts.map +1 -1
  70. package/lib/command/draw/AcApLineCmd.js +8 -2
  71. package/lib/command/draw/AcApLineCmd.js.map +1 -1
  72. package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
  73. package/lib/command/draw/AcApMLineCmd.js +4 -2
  74. package/lib/command/draw/AcApMLineCmd.js.map +1 -1
  75. package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -1
  76. package/lib/command/draw/AcApPolygonCmd.js +2 -5
  77. package/lib/command/draw/AcApPolygonCmd.js.map +1 -1
  78. package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -1
  79. package/lib/command/draw/AcApPolylineCmd.js +3 -0
  80. package/lib/command/draw/AcApPolylineCmd.js.map +1 -1
  81. package/lib/command/draw/AcApRectCmd.d.ts +6 -0
  82. package/lib/command/draw/AcApRectCmd.d.ts.map +1 -1
  83. package/lib/command/draw/AcApRectCmd.js +12 -10
  84. package/lib/command/draw/AcApRectCmd.js.map +1 -1
  85. package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -1
  86. package/lib/command/draw/AcApSplineCmd.js +2 -0
  87. package/lib/command/draw/AcApSplineCmd.js.map +1 -1
  88. package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -1
  89. package/lib/command/draw/AcApXLineCmd.js +1 -1
  90. package/lib/command/draw/AcApXLineCmd.js.map +1 -1
  91. package/lib/command/index.d.ts +3 -0
  92. package/lib/command/index.d.ts.map +1 -1
  93. package/lib/command/index.js +3 -0
  94. package/lib/command/index.js.map +1 -1
  95. package/lib/command/layer/AcApLayerCmd.d.ts +3 -194
  96. package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -1
  97. package/lib/command/layer/AcApLayerCmd.js +64 -398
  98. package/lib/command/layer/AcApLayerCmd.js.map +1 -1
  99. package/lib/command/layer/AcApLayerCurCmd.d.ts +2 -34
  100. package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -1
  101. package/lib/command/layer/AcApLayerCurCmd.js +18 -77
  102. package/lib/command/layer/AcApLayerCurCmd.js.map +1 -1
  103. package/lib/command/layer/AcApLayerDelCmd.d.ts +2 -32
  104. package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -1
  105. package/lib/command/layer/AcApLayerDelCmd.js +26 -169
  106. package/lib/command/layer/AcApLayerDelCmd.js.map +1 -1
  107. package/lib/command/layer/AcApLayerFreezeCmd.d.ts +2 -16
  108. package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -1
  109. package/lib/command/layer/AcApLayerFreezeCmd.js +32 -54
  110. package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -1
  111. package/lib/command/layer/AcApLayerIsoCmd.d.ts +2 -31
  112. package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -1
  113. package/lib/command/layer/AcApLayerIsoCmd.js +19 -198
  114. package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -1
  115. package/lib/command/layer/AcApLayerLockCmd.d.ts +2 -40
  116. package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -1
  117. package/lib/command/layer/AcApLayerLockCmd.js +18 -65
  118. package/lib/command/layer/AcApLayerLockCmd.js.map +1 -1
  119. package/lib/command/layer/AcApLayerMutationCmd.d.ts +13 -0
  120. package/lib/command/layer/AcApLayerMutationCmd.d.ts.map +1 -0
  121. package/lib/command/layer/AcApLayerMutationCmd.js +42 -0
  122. package/lib/command/layer/AcApLayerMutationCmd.js.map +1 -0
  123. package/lib/command/layer/AcApLayerOffCmd.d.ts +2 -9
  124. package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -1
  125. package/lib/command/layer/AcApLayerOffCmd.js +32 -43
  126. package/lib/command/layer/AcApLayerOffCmd.js.map +1 -1
  127. package/lib/command/layer/AcApLayerOnCmd.d.ts +2 -22
  128. package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -1
  129. package/lib/command/layer/AcApLayerOnCmd.js +8 -62
  130. package/lib/command/layer/AcApLayerOnCmd.js.map +1 -1
  131. package/lib/command/layer/AcApLayerPCmd.d.ts +2 -75
  132. package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -1
  133. package/lib/command/layer/AcApLayerPCmd.js +6 -165
  134. package/lib/command/layer/AcApLayerPCmd.js.map +1 -1
  135. package/lib/command/layer/AcApLayerThawCmd.d.ts +2 -29
  136. package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -1
  137. package/lib/command/layer/AcApLayerThawCmd.js +8 -74
  138. package/lib/command/layer/AcApLayerThawCmd.js.map +1 -1
  139. package/lib/command/layer/AcApLayerUnisoCmd.d.ts +2 -44
  140. package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -1
  141. package/lib/command/layer/AcApLayerUnisoCmd.js +10 -122
  142. package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -1
  143. package/lib/command/layer/AcApLayerUnlockCmd.d.ts +2 -40
  144. package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -1
  145. package/lib/command/layer/AcApLayerUnlockCmd.js +18 -65
  146. package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -1
  147. package/lib/command/modify/AcApCopyCmd.d.ts +12 -0
  148. package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -1
  149. package/lib/command/modify/AcApCopyCmd.js +67 -177
  150. package/lib/command/modify/AcApCopyCmd.js.map +1 -1
  151. package/lib/command/modify/AcApCopyPreviewJig.d.ts +21 -0
  152. package/lib/command/modify/AcApCopyPreviewJig.d.ts.map +1 -0
  153. package/lib/command/modify/AcApCopyPreviewJig.js +61 -0
  154. package/lib/command/modify/AcApCopyPreviewJig.js.map +1 -0
  155. package/lib/command/modify/AcApEraseCmd.d.ts +0 -6
  156. package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -1
  157. package/lib/command/modify/AcApEraseCmd.js +11 -38
  158. package/lib/command/modify/AcApEraseCmd.js.map +1 -1
  159. package/lib/command/modify/AcApHideObjectsCmd.d.ts +0 -7
  160. package/lib/command/modify/AcApHideObjectsCmd.d.ts.map +1 -1
  161. package/lib/command/modify/AcApHideObjectsCmd.js +1 -8
  162. package/lib/command/modify/AcApHideObjectsCmd.js.map +1 -1
  163. package/lib/command/modify/AcApMoveCmd.d.ts +0 -6
  164. package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -1
  165. package/lib/command/modify/AcApMoveCmd.js +26 -105
  166. package/lib/command/modify/AcApMoveCmd.js.map +1 -1
  167. package/lib/command/modify/AcApMovePreviewJig.d.ts +18 -0
  168. package/lib/command/modify/AcApMovePreviewJig.d.ts.map +1 -0
  169. package/lib/command/modify/AcApMovePreviewJig.js +45 -0
  170. package/lib/command/modify/AcApMovePreviewJig.js.map +1 -0
  171. package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
  172. package/lib/command/modify/AcApOffsetCmd.js +14 -37
  173. package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
  174. package/lib/command/modify/AcApRotateCmd.d.ts +2 -2
  175. package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
  176. package/lib/command/modify/AcApRotateCmd.js +38 -204
  177. package/lib/command/modify/AcApRotateCmd.js.map +1 -1
  178. package/lib/command/modify/AcApRotatePreviewJig.d.ts +47 -0
  179. package/lib/command/modify/AcApRotatePreviewJig.d.ts.map +1 -0
  180. package/lib/command/modify/AcApRotatePreviewJig.js +97 -0
  181. package/lib/command/modify/AcApRotatePreviewJig.js.map +1 -0
  182. package/lib/command/modify/AcApUnisolateObjectsCmd.d.ts.map +1 -1
  183. package/lib/command/modify/AcApUnisolateObjectsCmd.js +3 -3
  184. package/lib/command/modify/AcApUnisolateObjectsCmd.js.map +1 -1
  185. package/lib/editor/command/AcEdCommand.d.ts +24 -0
  186. package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
  187. package/lib/editor/command/AcEdCommand.js +71 -5
  188. package/lib/editor/command/AcEdCommand.js.map +1 -1
  189. package/lib/editor/global/AcEdUiColor.d.ts +13 -13
  190. package/lib/editor/global/AcEdUiColor.d.ts.map +1 -1
  191. package/lib/editor/global/AcEdUiColor.js +21 -20
  192. package/lib/editor/global/AcEdUiColor.js.map +1 -1
  193. package/lib/editor/global/eventBus.d.ts +16 -2
  194. package/lib/editor/global/eventBus.d.ts.map +1 -1
  195. package/lib/editor/global/eventBus.js.map +1 -1
  196. package/lib/editor/grip/AcEdGripAppearance.d.ts +18 -0
  197. package/lib/editor/grip/AcEdGripAppearance.d.ts.map +1 -0
  198. package/lib/editor/grip/AcEdGripAppearance.js +30 -0
  199. package/lib/editor/grip/AcEdGripAppearance.js.map +1 -0
  200. package/lib/editor/grip/AcEdGripEditSession.d.ts +29 -0
  201. package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -0
  202. package/lib/editor/grip/AcEdGripEditSession.js +83 -0
  203. package/lib/editor/grip/AcEdGripEditSession.js.map +1 -0
  204. package/lib/editor/grip/AcEdGripHandle.d.ts +21 -0
  205. package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -0
  206. package/lib/editor/grip/AcEdGripHandle.js +62 -0
  207. package/lib/editor/grip/AcEdGripHandle.js.map +1 -0
  208. package/lib/editor/grip/AcEdGripManager.d.ts +171 -0
  209. package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -0
  210. package/lib/editor/grip/AcEdGripManager.js +376 -0
  211. package/lib/editor/grip/AcEdGripManager.js.map +1 -0
  212. package/lib/editor/grip/AcEdGripPolicy.d.ts +6 -0
  213. package/lib/editor/grip/AcEdGripPolicy.d.ts.map +1 -0
  214. package/lib/editor/grip/AcEdGripPolicy.js +30 -0
  215. package/lib/editor/grip/AcEdGripPolicy.js.map +1 -0
  216. package/lib/editor/grip/AcEdGripPreviewJig.d.ts +21 -0
  217. package/lib/editor/grip/AcEdGripPreviewJig.d.ts.map +1 -0
  218. package/lib/editor/grip/AcEdGripPreviewJig.js +73 -0
  219. package/lib/editor/grip/AcEdGripPreviewJig.js.map +1 -0
  220. package/lib/editor/grip/index.d.ts +5 -0
  221. package/lib/editor/grip/index.d.ts.map +1 -0
  222. package/lib/editor/grip/index.js +5 -0
  223. package/lib/editor/grip/index.js.map +1 -0
  224. package/lib/editor/index.d.ts +1 -0
  225. package/lib/editor/index.d.ts.map +1 -1
  226. package/lib/editor/index.js +1 -0
  227. package/lib/editor/index.js.map +1 -1
  228. package/lib/editor/input/AcEdBatchPreview.d.ts +96 -0
  229. package/lib/editor/input/AcEdBatchPreview.d.ts.map +1 -0
  230. package/lib/editor/input/AcEdBatchPreview.js +125 -0
  231. package/lib/editor/input/AcEdBatchPreview.js.map +1 -0
  232. package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
  233. package/lib/editor/input/AcEdCursorManager.js +2 -2
  234. package/lib/editor/input/AcEdCursorManager.js.map +1 -1
  235. package/lib/editor/input/AcEdOsnapResolver.d.ts +34 -0
  236. package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -0
  237. package/lib/editor/input/AcEdOsnapResolver.js +117 -0
  238. package/lib/editor/input/AcEdOsnapResolver.js.map +1 -0
  239. package/lib/editor/input/AcEdPreviewJig.d.ts +1 -1
  240. package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -1
  241. package/lib/editor/input/AcEdPreviewJig.js +14 -0
  242. package/lib/editor/input/AcEdPreviewJig.js.map +1 -1
  243. package/lib/editor/input/AcEdSelectionPreviewJig.d.ts +109 -0
  244. package/lib/editor/input/AcEdSelectionPreviewJig.d.ts.map +1 -0
  245. package/lib/editor/input/AcEdSelectionPreviewJig.js +185 -0
  246. package/lib/editor/input/AcEdSelectionPreviewJig.js.map +1 -0
  247. package/lib/editor/input/handler/AcEdAngleHandler.d.ts +2 -1
  248. package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -1
  249. package/lib/editor/input/handler/AcEdAngleHandler.js +6 -0
  250. package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -1
  251. package/lib/editor/input/handler/AcEdInputHandler.d.ts +20 -1
  252. package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -1
  253. package/lib/editor/input/handler/AcEdKeywordHandler.d.ts +2 -1
  254. package/lib/editor/input/handler/AcEdKeywordHandler.d.ts.map +1 -1
  255. package/lib/editor/input/handler/AcEdKeywordHandler.js +3 -0
  256. package/lib/editor/input/handler/AcEdKeywordHandler.js.map +1 -1
  257. package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +2 -1
  258. package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -1
  259. package/lib/editor/input/handler/AcEdNumericalHandler.js +6 -0
  260. package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -1
  261. package/lib/editor/input/handler/AcEdPointHandler.d.ts +17 -1
  262. package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -1
  263. package/lib/editor/input/handler/AcEdPointHandler.js +89 -0
  264. package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -1
  265. package/lib/editor/input/handler/AcEdStringHandler.d.ts +2 -1
  266. package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -1
  267. package/lib/editor/input/handler/AcEdStringHandler.js +3 -0
  268. package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -1
  269. package/lib/editor/input/index.d.ts +3 -0
  270. package/lib/editor/input/index.d.ts.map +1 -1
  271. package/lib/editor/input/index.js +3 -0
  272. package/lib/editor/input/index.js.map +1 -1
  273. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +7 -0
  274. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
  275. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +17 -0
  276. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
  277. package/lib/editor/input/session/AcEdInputSession.d.ts +11 -1
  278. package/lib/editor/input/session/AcEdInputSession.d.ts.map +1 -1
  279. package/lib/editor/input/session/AcEdInputSession.js.map +1 -1
  280. package/lib/editor/input/session/AcEdPromptInputSession.d.ts +51 -0
  281. package/lib/editor/input/session/AcEdPromptInputSession.d.ts.map +1 -0
  282. package/lib/editor/input/session/AcEdPromptInputSession.js +109 -0
  283. package/lib/editor/input/session/AcEdPromptInputSession.js.map +1 -0
  284. package/lib/editor/input/session/index.d.ts +1 -0
  285. package/lib/editor/input/session/index.d.ts.map +1 -1
  286. package/lib/editor/input/session/index.js +1 -0
  287. package/lib/editor/input/session/index.js.map +1 -1
  288. package/lib/editor/input/ui/AcEdCommandLine.d.ts +10 -0
  289. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  290. package/lib/editor/input/ui/AcEdCommandLine.js +67 -35
  291. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  292. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +0 -11
  293. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  294. package/lib/editor/input/ui/AcEdFloatingInput.js +9 -119
  295. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  296. package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -1
  297. package/lib/editor/input/ui/AcEdFloatingInputBox.js +10 -2
  298. package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -1
  299. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
  300. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +9 -4
  301. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
  302. package/lib/editor/input/ui/AcEdInputManager.d.ts +26 -23
  303. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  304. package/lib/editor/input/ui/AcEdInputManager.js +135 -83
  305. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  306. package/lib/editor/input/ui/AcEdMTextEditor.js +2 -2
  307. package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
  308. package/lib/editor/view/AcEdBaseView.d.ts +44 -2
  309. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  310. package/lib/editor/view/AcEdBaseView.js +26 -12
  311. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  312. package/lib/editor/view/AcEdSpatialQueryResult.d.ts +28 -0
  313. package/lib/editor/view/AcEdSpatialQueryResult.d.ts.map +1 -1
  314. package/lib/editor/view/AcEdSpatialQueryResult.js +65 -1
  315. package/lib/editor/view/AcEdSpatialQueryResult.js.map +1 -1
  316. package/lib/i18n/AcApI18n.d.ts +42 -0
  317. package/lib/i18n/AcApI18n.d.ts.map +1 -1
  318. package/lib/i18n/AcApI18n.js +56 -4
  319. package/lib/i18n/AcApI18n.js.map +1 -1
  320. package/lib/i18n/en/command.d.ts +26 -0
  321. package/lib/i18n/en/command.d.ts.map +1 -1
  322. package/lib/i18n/en/command.js +26 -0
  323. package/lib/i18n/en/command.js.map +1 -1
  324. package/lib/i18n/en/jig.d.ts +26 -0
  325. package/lib/i18n/en/jig.d.ts.map +1 -1
  326. package/lib/i18n/en/jig.js +134 -108
  327. package/lib/i18n/en/jig.js.map +1 -1
  328. package/lib/i18n/en/main.d.ts +3 -0
  329. package/lib/i18n/en/main.d.ts.map +1 -1
  330. package/lib/i18n/en/main.js +4 -1
  331. package/lib/i18n/en/main.js.map +1 -1
  332. package/lib/i18n/zh/command.d.ts +26 -0
  333. package/lib/i18n/zh/command.d.ts.map +1 -1
  334. package/lib/i18n/zh/command.js +26 -0
  335. package/lib/i18n/zh/command.js.map +1 -1
  336. package/lib/i18n/zh/jig.d.ts +26 -0
  337. package/lib/i18n/zh/jig.d.ts.map +1 -1
  338. package/lib/i18n/zh/jig.js +134 -108
  339. package/lib/i18n/zh/jig.js.map +1 -1
  340. package/lib/i18n/zh/main.d.ts +3 -0
  341. package/lib/i18n/zh/main.d.ts.map +1 -1
  342. package/lib/i18n/zh/main.js +4 -1
  343. package/lib/i18n/zh/main.js.map +1 -1
  344. package/lib/index.d.ts +1 -0
  345. package/lib/index.d.ts.map +1 -1
  346. package/lib/index.js +1 -0
  347. package/lib/index.js.map +1 -1
  348. package/lib/plugin/AcApLazyPluginRegistration.d.ts +3 -8
  349. package/lib/plugin/AcApLazyPluginRegistration.d.ts.map +1 -1
  350. package/lib/service/AcApEntitySelection.d.ts +42 -0
  351. package/lib/service/AcApEntitySelection.d.ts.map +1 -0
  352. package/lib/service/AcApEntitySelection.js +156 -0
  353. package/lib/service/AcApEntitySelection.js.map +1 -0
  354. package/lib/service/AcApEntityService.d.ts +115 -0
  355. package/lib/service/AcApEntityService.d.ts.map +1 -0
  356. package/lib/service/AcApEntityService.js +194 -0
  357. package/lib/service/AcApEntityService.js.map +1 -0
  358. package/lib/{command/layer → service}/AcApLayerIsoState.d.ts +6 -24
  359. package/lib/service/AcApLayerIsoState.d.ts.map +1 -0
  360. package/lib/service/AcApLayerIsoState.js +28 -0
  361. package/lib/service/AcApLayerIsoState.js.map +1 -0
  362. package/lib/service/AcApLayerService.d.ts +400 -0
  363. package/lib/service/AcApLayerService.d.ts.map +1 -0
  364. package/lib/service/AcApLayerService.js +1240 -0
  365. package/lib/service/AcApLayerService.js.map +1 -0
  366. package/lib/service/AcApLayerStore.d.ts +198 -0
  367. package/lib/service/AcApLayerStore.d.ts.map +1 -0
  368. package/lib/service/AcApLayerStore.js +335 -0
  369. package/lib/service/AcApLayerStore.js.map +1 -0
  370. package/lib/service/AcApServiceEdit.d.ts +18 -0
  371. package/lib/service/AcApServiceEdit.d.ts.map +1 -0
  372. package/lib/service/AcApServiceEdit.js +34 -0
  373. package/lib/service/AcApServiceEdit.js.map +1 -0
  374. package/lib/service/index.d.ts +16 -0
  375. package/lib/service/index.d.ts.map +1 -0
  376. package/lib/service/index.js +16 -0
  377. package/lib/service/index.js.map +1 -0
  378. package/lib/service/types.d.ts +116 -0
  379. package/lib/service/types.d.ts.map +1 -0
  380. package/lib/service/types.js +5 -0
  381. package/lib/service/types.js.map +1 -0
  382. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +22 -7
  383. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
  384. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +58 -12
  385. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
  386. package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts +2 -2
  387. package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts.map +1 -1
  388. package/lib/spatialIndex/AcTrLinearSpatialIndex.js +9 -3
  389. package/lib/spatialIndex/AcTrLinearSpatialIndex.js.map +1 -1
  390. package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts +2 -2
  391. package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
  392. package/lib/spatialIndex/AcTrRBushSpatialIndex.js +19 -5
  393. package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
  394. package/lib/spatialIndex/AcTrSpatialIndex.d.ts +10 -1
  395. package/lib/spatialIndex/AcTrSpatialIndex.d.ts.map +1 -1
  396. package/lib/spatialIndex/AcTrSpatialIndex.js +7 -1
  397. package/lib/spatialIndex/AcTrSpatialIndex.js.map +1 -1
  398. package/lib/util/AcApDatabaseEdit.d.ts +11 -0
  399. package/lib/util/AcApDatabaseEdit.d.ts.map +1 -0
  400. package/lib/util/AcApDatabaseEdit.js +20 -0
  401. package/lib/util/AcApDatabaseEdit.js.map +1 -0
  402. package/lib/util/AcApFontUtil.d.ts +14 -2
  403. package/lib/util/AcApFontUtil.d.ts.map +1 -1
  404. package/lib/util/AcApFontUtil.js +18 -0
  405. package/lib/util/AcApFontUtil.js.map +1 -1
  406. package/lib/util/AcApGeTransform.d.ts +10 -0
  407. package/lib/util/AcApGeTransform.d.ts.map +1 -0
  408. package/lib/util/AcApGeTransform.js +15 -0
  409. package/lib/util/AcApGeTransform.js.map +1 -0
  410. package/lib/util/index.d.ts +2 -0
  411. package/lib/util/index.d.ts.map +1 -1
  412. package/lib/util/index.js +2 -0
  413. package/lib/util/index.js.map +1 -1
  414. package/lib/view/AcEdViewKeyHandler.d.ts +32 -0
  415. package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -0
  416. package/lib/view/AcEdViewKeyHandler.js +101 -0
  417. package/lib/view/AcEdViewKeyHandler.js.map +1 -0
  418. package/lib/view/AcTrEntityDisplayController.d.ts +46 -0
  419. package/lib/view/AcTrEntityDisplayController.d.ts.map +1 -0
  420. package/lib/view/AcTrEntityDisplayController.js +114 -0
  421. package/lib/view/AcTrEntityDisplayController.js.map +1 -0
  422. package/lib/view/AcTrGroupWcsBboxAssert.d.ts +43 -0
  423. package/lib/view/AcTrGroupWcsBboxAssert.d.ts.map +1 -0
  424. package/lib/view/AcTrGroupWcsBboxAssert.js +84 -0
  425. package/lib/view/AcTrGroupWcsBboxAssert.js.map +1 -0
  426. package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts +49 -0
  427. package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts.map +1 -0
  428. package/lib/view/AcTrInheritedLayerMaterialMapper.js +138 -0
  429. package/lib/view/AcTrInheritedLayerMaterialMapper.js.map +1 -0
  430. package/lib/view/AcTrLayer.d.ts +33 -2
  431. package/lib/view/AcTrLayer.d.ts.map +1 -1
  432. package/lib/view/AcTrLayer.js +75 -2
  433. package/lib/view/AcTrLayer.js.map +1 -1
  434. package/lib/view/AcTrLayerAppearanceController.d.ts +55 -0
  435. package/lib/view/AcTrLayerAppearanceController.d.ts.map +1 -0
  436. package/lib/view/AcTrLayerAppearanceController.js +86 -0
  437. package/lib/view/AcTrLayerAppearanceController.js.map +1 -0
  438. package/lib/view/AcTrLayout.d.ts +37 -2
  439. package/lib/view/AcTrLayout.d.ts.map +1 -1
  440. package/lib/view/AcTrLayout.js +161 -15
  441. package/lib/view/AcTrLayout.js.map +1 -1
  442. package/lib/view/AcTrProgressiveOpenFitController.d.ts +64 -0
  443. package/lib/view/AcTrProgressiveOpenFitController.d.ts.map +1 -0
  444. package/lib/view/AcTrProgressiveOpenFitController.js +209 -0
  445. package/lib/view/AcTrProgressiveOpenFitController.js.map +1 -0
  446. package/lib/view/AcTrScene.d.ts +47 -1
  447. package/lib/view/AcTrScene.d.ts.map +1 -1
  448. package/lib/view/AcTrScene.js +78 -3
  449. package/lib/view/AcTrScene.js.map +1 -1
  450. package/lib/view/AcTrView2d.d.ts +118 -27
  451. package/lib/view/AcTrView2d.d.ts.map +1 -1
  452. package/lib/view/AcTrView2d.js +584 -362
  453. package/lib/view/AcTrView2d.js.map +1 -1
  454. package/lib/view/index.d.ts +3 -0
  455. package/lib/view/index.d.ts.map +1 -1
  456. package/lib/view/index.js +3 -0
  457. package/lib/view/index.js.map +1 -1
  458. package/package.json +13 -11
  459. package/dist/index.umd.cjs +0 -897
  460. package/lib/command/layer/AcApLayerIsoState.d.ts.map +0 -1
  461. package/lib/command/layer/AcApLayerIsoState.js +0 -53
  462. package/lib/command/layer/AcApLayerIsoState.js.map +0 -1
@@ -49,65 +49,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
50
  }
51
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
- import { AcCmColor, AcCmColorMethod, AcDbLayerTableRecord } from '@mlightcad/data-model';
78
52
  import { AcApDocManager } from '../../app';
79
- import { AcEdCommand, AcEdOpenMode, AcEdPromptKeywordOptions, AcEdPromptStatus, AcEdPromptStringOptions } from '../../editor';
53
+ import { AcEdOpenMode, AcEdPromptKeywordOptions, AcEdPromptStatus, AcEdPromptStringOptions } from '../../editor';
80
54
  import { AcApI18n } from '../../i18n';
55
+ import { AcApLayerService } from '../../service';
56
+ import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
81
57
  /**
82
58
  * AutoCAD-style command-line layer command (`-LAYER`).
83
- *
84
- * This command intentionally avoids any dialog UI and keeps all interactions
85
- * in command line prompts.
86
59
  */
87
60
  var AcApLayerCmd = /** @class */ (function (_super) {
88
61
  __extends(AcApLayerCmd, _super);
89
- /**
90
- * Creates a command-line `-LAYER` command instance.
91
- *
92
- * The command is registered as a write-mode command because layer operations
93
- * can modify database state (current layer, visibility, lock state, color,
94
- * descriptions, and table records).
95
- */
96
62
  function AcApLayerCmd() {
97
63
  var _this = _super.call(this) || this;
98
64
  _this.mode = AcEdOpenMode.Write;
99
65
  return _this;
100
66
  }
101
- /**
102
- * Runs the interactive `-LAYER` loop.
103
- *
104
- * The command keeps prompting for top-level options until the user cancels
105
- * or confirms an empty input. Each selected keyword dispatches to one
106
- * dedicated branch handler.
107
- *
108
- * @param context - Active application context containing view and document.
109
- * @returns Resolves when the command exits.
110
- */
111
67
  AcApLayerCmd.prototype.execute = function (context) {
112
68
  return __awaiter(this, void 0, void 0, function () {
113
69
  var action, _a;
@@ -189,16 +145,12 @@ var AcApLayerCmd = /** @class */ (function (_super) {
189
145
  });
190
146
  });
191
147
  };
192
- /**
193
- * Prompts for one top-level `-LAYER` action keyword.
194
- *
195
- * The prompt is keyword-only and supports empty-enter termination (`allowNone`).
196
- *
197
- * @returns Selected top-level keyword, or `undefined` when canceled/finished.
198
- */
148
+ AcApLayerCmd.prototype.layerService = function (context) {
149
+ return new AcApLayerService(context.doc.database);
150
+ };
199
151
  AcApLayerCmd.prototype.promptMainKeyword = function () {
200
152
  return __awaiter(this, void 0, void 0, function () {
201
- var prompt, result, keyword;
153
+ var prompt, result;
202
154
  return __generator(this, function (_a) {
203
155
  switch (_a.label) {
204
156
  case 0:
@@ -221,137 +173,22 @@ var AcApLayerCmd = /** @class */ (function (_super) {
221
173
  result = _a.sent();
222
174
  if (result.status !== AcEdPromptStatus.OK)
223
175
  return [2 /*return*/, undefined];
224
- keyword = result.stringResult;
225
- return [2 /*return*/, keyword];
176
+ return [2 /*return*/, result.stringResult];
226
177
  }
227
178
  });
228
179
  });
229
180
  };
230
- /**
231
- * Adds one localized keyword entry to the main `-LAYER` prompt.
232
- *
233
- * @param prompt - Target keyword prompt to receive the keyword option.
234
- * @param keyword - Translation-key suffix for `jig.layer.keywords.*`.
235
- */
236
181
  AcApLayerCmd.prototype.addKeyword = function (prompt, keyword) {
237
182
  prompt.keywords.add(AcApI18n.t("jig.layer.keywords.".concat(keyword, ".display")), AcApI18n.t("jig.layer.keywords.".concat(keyword, ".global")), AcApI18n.t("jig.layer.keywords.".concat(keyword, ".local")));
238
183
  };
239
- /**
240
- * Emits one user-facing message through the command-line output.
241
- *
242
- * @param message - Message text to display.
243
- * @param type - Message severity category.
244
- */
245
- AcApLayerCmd.prototype.notify = function (message, type) {
246
- if (type === void 0) { type = 'info'; }
247
- AcApDocManager.instance.editor.showMessage(message, type);
248
- };
249
- /**
250
- * Prints all layer states to browser console and reports summary in UI.
251
- *
252
- * The list contains the current-layer marker and common status columns
253
- * (on/off, frozen, locked, color).
254
- *
255
- * @param context - Active command context used to resolve the layer table.
256
- */
257
184
  AcApLayerCmd.prototype.listLayers = function (context) {
258
- var db = context.doc.database;
259
- var layers = __spreadArray([], __read(db.tables.layerTable.newIterator()), false);
260
- var rows = layers.map(function (layer) { return ({
261
- name: layer.name,
262
- current: db.clayer === layer.name ? '*' : '',
263
- on: layer.isOff ? 'No' : 'Yes',
264
- frozen: layer.isFrozen ? 'Yes' : 'No',
265
- locked: layer.isLocked ? 'Yes' : 'No',
266
- color: layer.color.toString()
267
- }); });
185
+ var rows = this.layerService(context).getLayerSummaries();
268
186
  console.table(rows);
269
- this.notify("".concat(AcApI18n.t('jig.layer.listSummary'), " (").concat(rows.length, ")"), 'info');
270
- };
271
- /**
272
- * Parses a raw layer-name input string into a distinct name list.
273
- *
274
- * Supported forms:
275
- * - `*` to target all existing layer names.
276
- * - Comma-separated names (e.g. `A,B,C`).
277
- *
278
- * @param input - Raw user input from command line.
279
- * @param allNames - All existing layer names, used for wildcard expansion.
280
- * @returns Deduplicated list of requested layer names.
281
- */
282
- AcApLayerCmd.prototype.parseLayerNameInput = function (input, allNames) {
283
- var raw = input.trim();
284
- if (!raw)
285
- return [];
286
- if (raw === '*')
287
- return __spreadArray([], __read(allNames), false);
288
- var names = raw
289
- .split(',')
290
- .map(function (v) { return v.trim(); })
291
- .filter(Boolean);
292
- return __spreadArray([], __read(new Set(names)), false);
293
- };
294
- /**
295
- * Resolves layer records by name and separates missing names.
296
- *
297
- * @param context - Active command context with access to layer table.
298
- * @param names - Layer names to resolve.
299
- * @returns Object containing matched records and unresolved names.
300
- */
301
- AcApLayerCmd.prototype.resolveLayers = function (context, names) {
302
- var table = context.doc.database.tables.layerTable;
303
- var layers = [];
304
- var missing = [];
305
- names.forEach(function (name) {
306
- var layer = table.getAt(name);
307
- if (layer)
308
- layers.push(layer);
309
- else
310
- missing.push(name);
311
- });
312
- return { layers: layers, missing: missing };
313
- };
314
- /**
315
- * Sets or clears the frozen bit in `standardFlags`.
316
- *
317
- * The explicit bit operation is used to ensure both freeze and thaw are
318
- * applied deterministically.
319
- *
320
- * @param layer - Target layer table record.
321
- * @param frozen - `true` to freeze, `false` to thaw.
322
- */
323
- AcApLayerCmd.prototype.setLayerFrozen = function (layer, frozen) {
324
- var _a;
325
- var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
326
- layer.standardFlags = frozen ? flags | 0x01 : flags & ~0x01;
187
+ this.showMessage("".concat(AcApI18n.t('jig.layer.listSummary'), " (").concat(rows.length, ")"), 'info');
327
188
  };
328
- /**
329
- * Sets or clears the locked bit in `standardFlags`.
330
- *
331
- * The explicit bit operation is used to ensure both lock and unlock are
332
- * applied deterministically.
333
- *
334
- * @param layer - Target layer table record.
335
- * @param locked - `true` to lock, `false` to unlock.
336
- */
337
- AcApLayerCmd.prototype.setLayerLocked = function (layer, locked) {
338
- var _a;
339
- var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
340
- layer.standardFlags = locked ? flags | 0x04 : flags & ~0x04;
341
- };
342
- /**
343
- * Prompts for one or more layer names and parses them into a list.
344
- *
345
- * This helper powers batch operations such as on/off/freeze/thaw/lock/unlock
346
- * and supports wildcard `*` plus comma-separated names.
347
- *
348
- * @param message - Prompt message shown in command line.
349
- * @param context - Active command context used for wildcard expansion.
350
- * @returns Parsed layer names, or `undefined` when canceled/invalid.
351
- */
352
189
  AcApLayerCmd.prototype.promptLayerNames = function (message, context) {
353
190
  return __awaiter(this, void 0, void 0, function () {
354
- var prompt, result, allNames, names;
191
+ var prompt, result, service, names;
355
192
  var _a;
356
193
  return __generator(this, function (_b) {
357
194
  switch (_b.label) {
@@ -363,10 +200,10 @@ var AcApLayerCmd = /** @class */ (function (_super) {
363
200
  result = _b.sent();
364
201
  if (result.status !== AcEdPromptStatus.OK)
365
202
  return [2 /*return*/, undefined];
366
- allNames = __spreadArray([], __read(context.doc.database.tables.layerTable.newIterator()), false).map(function (layer) { return layer.name; });
367
- names = this.parseLayerNameInput((_a = result.stringResult) !== null && _a !== void 0 ? _a : '', allNames);
203
+ service = this.layerService(context);
204
+ names = service.parseLayerNameInput((_a = result.stringResult) !== null && _a !== void 0 ? _a : '');
368
205
  if (!names.length) {
369
- this.notify(AcApI18n.t('jig.layer.emptyInput'), 'warning');
206
+ this.showMessage(AcApI18n.t('jig.layer.emptyInput'), 'warning');
370
207
  return [2 /*return*/, undefined];
371
208
  }
372
209
  return [2 /*return*/, names];
@@ -374,12 +211,6 @@ var AcApLayerCmd = /** @class */ (function (_super) {
374
211
  });
375
212
  });
376
213
  };
377
- /**
378
- * Prompts for a single layer name.
379
- *
380
- * @param message - Prompt message shown in command line.
381
- * @returns Trimmed layer name, or `undefined` when canceled/empty.
382
- */
383
214
  AcApLayerCmd.prototype.promptSingleLayerName = function (message) {
384
215
  return __awaiter(this, void 0, void 0, function () {
385
216
  var prompt, result, name;
@@ -400,65 +231,31 @@ var AcApLayerCmd = /** @class */ (function (_super) {
400
231
  });
401
232
  });
402
233
  };
403
- /**
404
- * Handles the `New` branch.
405
- *
406
- * Creates one or more missing layers while keeping existing ones unchanged.
407
- * The method reports creation count and duplicate names separately.
408
- *
409
- * @param context - Active command context used to access the layer table.
410
- * @returns Resolves when branch execution completes.
411
- */
412
234
  AcApLayerCmd.prototype.runNew = function (context) {
413
235
  return __awaiter(this, void 0, void 0, function () {
414
- var names, table, created, existed;
415
- return __generator(this, function (_a) {
416
- switch (_a.label) {
236
+ var names, _a, created, existed;
237
+ return __generator(this, function (_b) {
238
+ switch (_b.label) {
417
239
  case 0: return [4 /*yield*/, this.promptLayerNames(AcApI18n.t('jig.layer.newPrompt'), context)];
418
240
  case 1:
419
- names = _a.sent();
241
+ names = _b.sent();
420
242
  if (!names)
421
243
  return [2 /*return*/];
422
- table = context.doc.database.tables.layerTable;
423
- created = 0;
424
- existed = [];
425
- names.forEach(function (name) {
426
- if (table.has(name)) {
427
- existed.push(name);
428
- return;
429
- }
430
- table.add(new AcDbLayerTableRecord({
431
- name: name,
432
- isOff: false,
433
- isPlottable: true,
434
- color: new AcCmColor(AcCmColorMethod.ByACI, 7),
435
- linetype: 'Continuous'
436
- }));
437
- created++;
438
- });
244
+ _a = this.layerService(context).createLayers(names), created = _a.created, existed = _a.existed;
439
245
  if (created > 0) {
440
- this.notify("".concat(AcApI18n.t('jig.layer.created'), ": ").concat(created), 'success');
246
+ this.showMessage("".concat(AcApI18n.t('jig.layer.created'), ": ").concat(created), 'success');
441
247
  }
442
248
  if (existed.length > 0) {
443
- this.notify("".concat(AcApI18n.t('jig.layer.alreadyExists'), ": ").concat(existed.join(', ')), 'warning');
249
+ this.showMessage("".concat(AcApI18n.t('jig.layer.alreadyExists'), ": ").concat(existed.join(', ')), 'warning');
444
250
  }
445
251
  return [2 /*return*/];
446
252
  }
447
253
  });
448
254
  });
449
255
  };
450
- /**
451
- * Handles the `Set` branch.
452
- *
453
- * Sets one existing layer as current (`CLAYER`) and ensures the target is
454
- * visible/unfrozen before assignment.
455
- *
456
- * @param context - Active command context.
457
- * @returns Resolves when branch execution completes.
458
- */
459
256
  AcApLayerCmd.prototype.runSet = function (context) {
460
257
  return __awaiter(this, void 0, void 0, function () {
461
- var name, layer;
258
+ var name;
462
259
  return __generator(this, function (_a) {
463
260
  switch (_a.label) {
464
261
  case 0: return [4 /*yield*/, this.promptSingleLayerName(AcApI18n.t('jig.layer.setPrompt'))];
@@ -466,31 +263,17 @@ var AcApLayerCmd = /** @class */ (function (_super) {
466
263
  name = _a.sent();
467
264
  if (!name)
468
265
  return [2 /*return*/];
469
- layer = context.doc.database.tables.layerTable.getAt(name);
470
- if (!layer) {
471
- this.notify("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(name), 'warning');
472
- return [2 /*return*/];
266
+ if (!this.layerService(context).setCurrentLayer(name)) {
267
+ this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(name), 'warning');
473
268
  }
474
- layer.isOff = false;
475
- this.setLayerFrozen(layer, false);
476
- context.doc.database.clayer = layer.name;
477
269
  return [2 /*return*/];
478
270
  }
479
271
  });
480
272
  });
481
273
  };
482
- /**
483
- * Handles the `Make` branch.
484
- *
485
- * Creates the layer if missing, then makes it current. The resulting current
486
- * layer is turned on and thawed.
487
- *
488
- * @param context - Active command context.
489
- * @returns Resolves when branch execution completes.
490
- */
491
274
  AcApLayerCmd.prototype.runMake = function (context) {
492
275
  return __awaiter(this, void 0, void 0, function () {
493
- var name, table, layer;
276
+ var name;
494
277
  return __generator(this, function (_a) {
495
278
  switch (_a.label) {
496
279
  case 0: return [4 /*yield*/, this.promptSingleLayerName(AcApI18n.t('jig.layer.makePrompt'))];
@@ -498,194 +281,90 @@ var AcApLayerCmd = /** @class */ (function (_super) {
498
281
  name = _a.sent();
499
282
  if (!name)
500
283
  return [2 /*return*/];
501
- table = context.doc.database.tables.layerTable;
502
- layer = table.getAt(name);
503
- if (!layer) {
504
- layer = new AcDbLayerTableRecord({
505
- name: name,
506
- isOff: false,
507
- isPlottable: true,
508
- color: new AcCmColor(AcCmColorMethod.ByACI, 7),
509
- linetype: 'Continuous'
510
- });
511
- table.add(layer);
512
- }
513
- layer.isOff = false;
514
- this.setLayerFrozen(layer, false);
515
- context.doc.database.clayer = layer.name;
284
+ this.layerService(context).makeLayer(name);
516
285
  return [2 /*return*/];
517
286
  }
518
287
  });
519
288
  });
520
289
  };
521
- /**
522
- * Handles `On` and `Off` branches.
523
- *
524
- * Batch toggles visibility for selected layers. Turning off the current layer
525
- * is skipped and reported as warning.
526
- *
527
- * @param context - Active command context.
528
- * @param off - `true` for `Off`, `false` for `On`.
529
- * @returns Resolves when branch execution completes.
530
- */
531
290
  AcApLayerCmd.prototype.runOnOff = function (context, off) {
532
291
  return __awaiter(this, void 0, void 0, function () {
533
- var names, db, _a, layers, missing, skippedCurrent;
534
- return __generator(this, function (_b) {
535
- switch (_b.label) {
292
+ var names, service, missing, skippedCurrent;
293
+ return __generator(this, function (_a) {
294
+ switch (_a.label) {
536
295
  case 0: return [4 /*yield*/, this.promptLayerNames(off
537
296
  ? AcApI18n.t('jig.layer.offPrompt')
538
297
  : AcApI18n.t('jig.layer.onPrompt'), context)];
539
298
  case 1:
540
- names = _b.sent();
299
+ names = _a.sent();
541
300
  if (!names)
542
301
  return [2 /*return*/];
543
- db = context.doc.database;
544
- _a = this.resolveLayers(context, names), layers = _a.layers, missing = _a.missing;
302
+ service = this.layerService(context);
303
+ missing = service.resolveLayers(names).missing;
545
304
  if (missing.length > 0) {
546
- this.notify("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
305
+ this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
547
306
  }
548
- skippedCurrent = [];
549
- layers.forEach(function (layer) {
550
- if (off && layer.name === db.clayer) {
551
- skippedCurrent.push(layer.name);
552
- return;
553
- }
554
- layer.isOff = off;
555
- });
307
+ skippedCurrent = service.setLayersVisibility(names, off).skippedCurrent;
556
308
  if (skippedCurrent.length > 0) {
557
- this.notify(AcApI18n.t('jig.layer.cannotChangeCurrent'), 'warning');
309
+ this.showMessage(AcApI18n.t('jig.layer.cannotChangeCurrent'), 'warning');
558
310
  }
559
311
  return [2 /*return*/];
560
312
  }
561
313
  });
562
314
  });
563
315
  };
564
- /**
565
- * Handles `Freeze` and `Thaw` branches.
566
- *
567
- * Batch toggles frozen state using explicit bit operations. Freezing the
568
- * current layer is skipped and reported as warning.
569
- *
570
- * @param context - Active command context.
571
- * @param freeze - `true` for `Freeze`, `false` for `Thaw`.
572
- * @returns Resolves when branch execution completes.
573
- */
574
316
  AcApLayerCmd.prototype.runFreeze = function (context, freeze) {
575
317
  return __awaiter(this, void 0, void 0, function () {
576
- var names, db, _a, layers, missing, skippedCurrent;
577
- var _this = this;
578
- return __generator(this, function (_b) {
579
- switch (_b.label) {
318
+ var names, service, missing, skippedCurrent;
319
+ return __generator(this, function (_a) {
320
+ switch (_a.label) {
580
321
  case 0: return [4 /*yield*/, this.promptLayerNames(freeze
581
322
  ? AcApI18n.t('jig.layer.freezePrompt')
582
323
  : AcApI18n.t('jig.layer.thawPrompt'), context)];
583
324
  case 1:
584
- names = _b.sent();
325
+ names = _a.sent();
585
326
  if (!names)
586
327
  return [2 /*return*/];
587
- db = context.doc.database;
588
- _a = this.resolveLayers(context, names), layers = _a.layers, missing = _a.missing;
328
+ service = this.layerService(context);
329
+ missing = service.resolveLayers(names).missing;
589
330
  if (missing.length > 0) {
590
- this.notify("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
331
+ this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
591
332
  }
592
- skippedCurrent = [];
593
- layers.forEach(function (layer) {
594
- if (freeze && layer.name === db.clayer) {
595
- skippedCurrent.push(layer.name);
596
- return;
597
- }
598
- _this.setLayerFrozen(layer, freeze);
599
- });
333
+ skippedCurrent = service.setLayersFrozen(names, freeze).skippedCurrent;
600
334
  if (skippedCurrent.length > 0) {
601
- this.notify(AcApI18n.t('jig.layer.cannotChangeCurrent'), 'warning');
335
+ this.showMessage(AcApI18n.t('jig.layer.cannotChangeCurrent'), 'warning');
602
336
  }
603
337
  return [2 /*return*/];
604
338
  }
605
339
  });
606
340
  });
607
341
  };
608
- /**
609
- * Handles `Lock` and `Unlock` branches.
610
- *
611
- * Batch toggles lock state using explicit bit operations.
612
- *
613
- * @param context - Active command context.
614
- * @param lock - `true` for `Lock`, `false` for `Unlock`.
615
- * @returns Resolves when branch execution completes.
616
- */
617
342
  AcApLayerCmd.prototype.runLock = function (context, lock) {
618
343
  return __awaiter(this, void 0, void 0, function () {
619
- var names, _a, layers, missing;
620
- var _this = this;
621
- return __generator(this, function (_b) {
622
- switch (_b.label) {
344
+ var names, service, missing;
345
+ return __generator(this, function (_a) {
346
+ switch (_a.label) {
623
347
  case 0: return [4 /*yield*/, this.promptLayerNames(lock
624
348
  ? AcApI18n.t('jig.layer.lockPrompt')
625
349
  : AcApI18n.t('jig.layer.unlockPrompt'), context)];
626
350
  case 1:
627
- names = _b.sent();
351
+ names = _a.sent();
628
352
  if (!names)
629
353
  return [2 /*return*/];
630
- _a = this.resolveLayers(context, names), layers = _a.layers, missing = _a.missing;
354
+ service = this.layerService(context);
355
+ missing = service.resolveLayers(names).missing;
631
356
  if (missing.length > 0) {
632
- this.notify("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
357
+ this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
633
358
  }
634
- layers.forEach(function (layer) { return _this.setLayerLocked(layer, lock); });
359
+ service.setLayersLocked(names, lock);
635
360
  return [2 /*return*/];
636
361
  }
637
362
  });
638
363
  });
639
364
  };
640
- /**
641
- * Parses one color input token into `AcCmColor`.
642
- *
643
- * Supported formats:
644
- * - ACI index (`1..255`)
645
- * - RGB string accepted by `AcCmColor.fromString`
646
- * - CSS color names accepted by `AcCmColor.fromString`
647
- *
648
- * `ByLayer` and `ByBlock` are rejected for explicit layer color assignment.
649
- *
650
- * @param input - Raw color input string.
651
- * @returns Parsed color object, or `undefined` when invalid/unsupported.
652
- */
653
- AcApLayerCmd.prototype.parseColorInput = function (input) {
654
- var value = input.trim();
655
- if (!value)
656
- return undefined;
657
- if (/^\d+$/.test(value)) {
658
- var index = Number(value);
659
- if (index >= 1 && index <= 255) {
660
- return new AcCmColor(AcCmColorMethod.ByACI, index);
661
- }
662
- return undefined;
663
- }
664
- var color = AcCmColor.fromString(value);
665
- if (!color)
666
- return undefined;
667
- if (color.isByACI) {
668
- var index = color.colorIndex;
669
- if (index == null || index < 1 || index > 255) {
670
- return undefined;
671
- }
672
- }
673
- if (color.isByLayer || color.isByBlock)
674
- return undefined;
675
- return color;
676
- };
677
- /**
678
- * Handles the `Color` branch.
679
- *
680
- * Prompts target layers first, then prompts color value and applies a cloned
681
- * color instance to each resolved layer.
682
- *
683
- * @param context - Active command context.
684
- * @returns Resolves when branch execution completes.
685
- */
686
365
  AcApLayerCmd.prototype.runColor = function (context) {
687
366
  return __awaiter(this, void 0, void 0, function () {
688
- var names, _a, layers, missing, colorPrompt, colorResult, color;
367
+ var names, service, _a, layers, missing, colorPrompt, colorResult, color;
689
368
  var _b;
690
369
  return __generator(this, function (_c) {
691
370
  switch (_c.label) {
@@ -694,9 +373,10 @@ var AcApLayerCmd = /** @class */ (function (_super) {
694
373
  names = _c.sent();
695
374
  if (!names)
696
375
  return [2 /*return*/];
697
- _a = this.resolveLayers(context, names), layers = _a.layers, missing = _a.missing;
376
+ service = this.layerService(context);
377
+ _a = service.resolveLayers(names), layers = _a.layers, missing = _a.missing;
698
378
  if (missing.length > 0) {
699
- this.notify("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
379
+ this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
700
380
  }
701
381
  if (layers.length === 0)
702
382
  return [2 /*return*/];
@@ -707,31 +387,20 @@ var AcApLayerCmd = /** @class */ (function (_super) {
707
387
  colorResult = _c.sent();
708
388
  if (colorResult.status !== AcEdPromptStatus.OK)
709
389
  return [2 /*return*/];
710
- color = this.parseColorInput((_b = colorResult.stringResult) !== null && _b !== void 0 ? _b : '');
390
+ color = service.parseColorInput((_b = colorResult.stringResult) !== null && _b !== void 0 ? _b : '');
711
391
  if (!color) {
712
- this.notify(AcApI18n.t('jig.layer.invalidColor'), 'warning');
392
+ this.showMessage(AcApI18n.t('jig.layer.invalidColor'), 'warning');
713
393
  return [2 /*return*/];
714
394
  }
715
- layers.forEach(function (layer) {
716
- layer.color = color.clone();
717
- });
395
+ service.setLayersColor(names, color);
718
396
  return [2 /*return*/];
719
397
  }
720
398
  });
721
399
  });
722
400
  };
723
- /**
724
- * Handles the `Description` branch.
725
- *
726
- * Updates the description text of one specified layer. Empty description is
727
- * allowed and treated as clear.
728
- *
729
- * @param context - Active command context.
730
- * @returns Resolves when branch execution completes.
731
- */
732
401
  AcApLayerCmd.prototype.runDescription = function (context) {
733
402
  return __awaiter(this, void 0, void 0, function () {
734
- var name, layer, descPrompt, result;
403
+ var name, descPrompt, result;
735
404
  var _a;
736
405
  return __generator(this, function (_b) {
737
406
  switch (_b.label) {
@@ -740,11 +409,6 @@ var AcApLayerCmd = /** @class */ (function (_super) {
740
409
  name = _b.sent();
741
410
  if (!name)
742
411
  return [2 /*return*/];
743
- layer = context.doc.database.tables.layerTable.getAt(name);
744
- if (!layer) {
745
- this.notify("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(name), 'warning');
746
- return [2 /*return*/];
747
- }
748
412
  descPrompt = new AcEdPromptStringOptions(AcApI18n.t('jig.layer.descriptionValuePrompt'));
749
413
  descPrompt.allowSpaces = true;
750
414
  descPrompt.allowEmpty = true;
@@ -753,13 +417,15 @@ var AcApLayerCmd = /** @class */ (function (_super) {
753
417
  result = _b.sent();
754
418
  if (result.status !== AcEdPromptStatus.OK)
755
419
  return [2 /*return*/];
756
- layer.description = (_a = result.stringResult) !== null && _a !== void 0 ? _a : '';
420
+ if (!this.layerService(context).setLayerDescription(name, (_a = result.stringResult) !== null && _a !== void 0 ? _a : '')) {
421
+ this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(name), 'warning');
422
+ }
757
423
  return [2 /*return*/];
758
424
  }
759
425
  });
760
426
  });
761
427
  };
762
428
  return AcApLayerCmd;
763
- }(AcEdCommand));
429
+ }(AcApLayerMutationCmd));
764
430
  export { AcApLayerCmd };
765
431
  //# sourceMappingURL=AcApLayerCmd.js.map