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