@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
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Interactive DOM grip square rendered in container-local screen coordinates.
3
+ */
4
+ var AcEdGripHandle = /** @class */ (function () {
5
+ function AcEdGripHandle(_host, appearance) {
6
+ this._host = _host;
7
+ this._state = 'normal';
8
+ AcEdGripHandle.injectCSS();
9
+ var hostPosition = getComputedStyle(this._host).position;
10
+ if (hostPosition === 'static') {
11
+ this._host.style.position = 'relative';
12
+ }
13
+ this._el = document.createElement('div');
14
+ this._el.className = 'ml-grip-handle ml-grip-handle-normal';
15
+ this.applyAppearance(appearance);
16
+ this._host.appendChild(this._el);
17
+ }
18
+ Object.defineProperty(AcEdGripHandle.prototype, "element", {
19
+ get: function () {
20
+ return this._el;
21
+ },
22
+ enumerable: false,
23
+ configurable: true
24
+ });
25
+ Object.defineProperty(AcEdGripHandle.prototype, "state", {
26
+ get: function () {
27
+ return this._state;
28
+ },
29
+ enumerable: false,
30
+ configurable: true
31
+ });
32
+ AcEdGripHandle.prototype.setState = function (state) {
33
+ if (this._state === state)
34
+ return;
35
+ this._state = state;
36
+ this._el.className = "ml-grip-handle ml-grip-handle-".concat(state);
37
+ };
38
+ AcEdGripHandle.prototype.setPosition = function (pos) {
39
+ this._el.style.left = "".concat(pos.x, "px");
40
+ this._el.style.top = "".concat(pos.y, "px");
41
+ };
42
+ AcEdGripHandle.prototype.applyAppearance = function (appearance) {
43
+ this._el.style.width = "".concat(appearance.size, "px");
44
+ this._el.style.height = "".concat(appearance.size, "px");
45
+ this._el.style.setProperty('--ml-ui-grip-normal', appearance.colorCss);
46
+ this._el.style.setProperty('--ml-ui-grip-hot', appearance.hotColorCss);
47
+ };
48
+ AcEdGripHandle.prototype.destroy = function () {
49
+ this._el.remove();
50
+ };
51
+ AcEdGripHandle.injectCSS = function () {
52
+ if (document.getElementById('ml-grip-handle-style'))
53
+ return;
54
+ var style = document.createElement('style');
55
+ style.id = 'ml-grip-handle-style';
56
+ style.textContent = "\n .ml-grip-handle {\n position: absolute;\n pointer-events: auto;\n transform: translate(-50%, -50%);\n z-index: 5;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .ml-grip-handle-normal {\n background: var(--ml-ui-grip-normal, #0080ff);\n }\n\n .ml-grip-handle-hover,\n .ml-grip-handle-hot {\n background: var(--ml-ui-grip-hot, #ff0000);\n }\n ";
57
+ document.head.appendChild(style);
58
+ };
59
+ return AcEdGripHandle;
60
+ }());
61
+ export { AcEdGripHandle };
62
+ //# sourceMappingURL=AcEdGripHandle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcEdGripHandle.js","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripHandle.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH;IAIE,wBACmB,KAAkB,EACnC,UAA8B;QADb,UAAK,GAAL,KAAK,CAAa;QAH7B,WAAM,GAAwB,QAAQ,CAAA;QAM5C,cAAc,CAAC,SAAS,EAAE,CAAA;QAE1B,IAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAA;QAC1D,IAAI,YAAY,KAAK,QAAQ,EAAE,CAAC;YA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C,QAAQ,CAAC,CAAA;QACtE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;IACxE,CAAC;IAED,gCAAO,GAAP;QACE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IACnB,CAAC;IAEc,wBAAS,GAAxB;QACE,IAAI,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC;YAAE,OAAM;QAE3D,IAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QAC7C,KAAK,CAAC,EAAE,GAAG,sBAAsB,CAAA;QACjC,KAAK,CAAC,WAAW,GAAG,+bAkBnB,CAAA;QACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IACH,qBAAC;AAAD,CAAC,AA7ED,IA6EC"}
@@ -0,0 +1,171 @@
1
+ import { AcEdBaseView } from '../view/AcEdBaseView';
2
+ /**
3
+ * Manages grip point display and drag editing for the active view.
4
+ *
5
+ * Grip handles are shown for entities in the view's selection set when the
6
+ * editor is idle, the document is writable, and selection count is within the
7
+ * `GRIPOBJLIMIT` system variable. Grip size and colours follow `GRIPSIZE`,
8
+ * `GRIPCOLOR`, and `GRIPHOT`. The manager listens for selection, view,
9
+ * command, and system-variable changes to refresh or reposition handles.
10
+ *
11
+ * Clicking a grip starts an {@link AcEdGripEditSession} that previews and
12
+ * commits entity geometry changes; while dragging, all grip handles are hidden.
13
+ *
14
+ * ## Key Responsibilities
15
+ * - **Display**: Create and position grip handles from entity grip points
16
+ * - **Interaction**: Route hover, hot, and mousedown events to edit sessions
17
+ * - **Lifecycle**: Subscribe/unsubscribe view events and dispose DOM on teardown
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const gripManager = new AcEdGripManager(view);
22
+ * // Handles appear automatically when entities are selected.
23
+ * // On view dispose:
24
+ * gripManager.dispose();
25
+ * ```
26
+ */
27
+ export declare class AcEdGripManager {
28
+ /** View that owns selection, coordinate conversion, and the handle container. */
29
+ private readonly _view;
30
+ /** Active grip entries, one per grip point on each selected entity. */
31
+ private readonly _entries;
32
+ /** In-progress grip drag session, or `null` when not editing. */
33
+ private _editSession;
34
+ /** Entry currently under the pointer during mousedown (hot grip), if any. */
35
+ private _hotEntry;
36
+ /** Stable listener reference for selection/command refresh. */
37
+ private readonly _boundRefresh;
38
+ /** Stable listener reference for view pan/zoom/resize repositioning. */
39
+ private readonly _boundReposition;
40
+ /** Stable listener reference for grip-related system variable changes. */
41
+ private readonly _boundSysVarChanged;
42
+ /**
43
+ * Creates a grip manager bound to the given view.
44
+ *
45
+ * Registers event listeners on the view's selection set, editor, view
46
+ * events, and `GRIPOBJLIMIT` system variable so grips stay in sync with
47
+ * application state.
48
+ *
49
+ * @param view - The CAD view whose selection and container host grip handles
50
+ */
51
+ constructor(view: AcEdBaseView);
52
+ /**
53
+ * Whether a grip drag edit is currently in progress.
54
+ *
55
+ * While `true`, hover styling on other handles is suppressed and grip
56
+ * handles are hidden until the session ends.
57
+ */
58
+ get isDragging(): boolean;
59
+ /**
60
+ * Tears down the manager and releases all resources.
61
+ *
62
+ * Unsubscribes from view events, cancels any active edit session, and
63
+ * destroys all grip handle DOM elements.
64
+ */
65
+ dispose(): void;
66
+ /**
67
+ * Rebuilds the grip handle set from the current selection.
68
+ *
69
+ * Clears existing entries first. If grips are not allowed (read-only mode,
70
+ * active command, MText editor, or selection over limit), no new handles are
71
+ * created. Otherwise, iterates selected entities, queries grip points via
72
+ * `subGetGripPoints()`, creates handles, wires pointer events, and positions
73
+ * each entry in container coordinates.
74
+ */
75
+ refresh(): void;
76
+ /**
77
+ * Determines whether grip handles may be shown for the current view state.
78
+ *
79
+ * Delegates to {@link acedShouldShowGrips} using document open mode, editor
80
+ * activity, MText input focus, selection count, and `GRIPOBJLIMIT`.
81
+ *
82
+ * @returns `true` if grips should be displayed; otherwise `false`
83
+ */
84
+ private canShowGrips;
85
+ /**
86
+ * Subscribes to events that require a full grip refresh or reposition.
87
+ *
88
+ * Refresh triggers: selection added/removed, command start/end,
89
+ * `GRIPOBJLIMIT` sysvar change. Reposition triggers: view changed, view resize.
90
+ * Appearance updates: `GRIPSIZE`, `GRIPCOLOR`, `GRIPHOT` sysvar changes.
91
+ */
92
+ private bindEvents;
93
+ /**
94
+ * Removes all event listeners registered by {@link bindEvents}.
95
+ */
96
+ private unbindEvents;
97
+ /**
98
+ * Reacts to grip-related system variable changes.
99
+ */
100
+ private onGripSysVarChanged;
101
+ /**
102
+ * Updates size and colours on existing grip handles from current sysvars.
103
+ */
104
+ private applyAppearance;
105
+ /**
106
+ * Attaches pointer event handlers to a grip handle element.
107
+ *
108
+ * - **mouseenter**: Sets hover state unless a drag is active
109
+ * - **mouseleave**: Reverts to normal unless this entry is the hot grip
110
+ * - **mousedown** (left button): Marks hot, prevents default propagation,
111
+ * and starts a grip edit session when grips are allowed
112
+ *
113
+ * @param entry - The grip entry whose handle receives the listeners
114
+ */
115
+ private wireHandleEvents;
116
+ /**
117
+ * Begins a grip drag edit for the given entry.
118
+ *
119
+ * Resolves the entity from the document, hides all grip handles for the
120
+ * duration of the drag, and constructs an {@link AcEdGripEditSession} that
121
+ * calls {@link endEdit} when the session completes.
122
+ *
123
+ * If the entity no longer exists, {@link endEdit} is invoked immediately.
124
+ *
125
+ * @param entry - The grip entry that was activated by the user
126
+ */
127
+ private startEdit;
128
+ /**
129
+ * Completes or aborts the current grip edit and restores grip display.
130
+ *
131
+ * Clears the edit session and hot entry, then rebuilds handles via
132
+ * {@link refresh} so geometry and selection state are reflected on screen.
133
+ */
134
+ private endEdit;
135
+ /**
136
+ * Removes all visible grip handles while a drag edit is in progress.
137
+ *
138
+ * Called when starting an edit so only the preview jig is shown, not the
139
+ * static grip squares.
140
+ */
141
+ private hideEntriesForDrag;
142
+ /**
143
+ * Updates a single grip handle's screen position from its WCS point.
144
+ *
145
+ * Converts world coordinates to canvas, then to container-local pixels,
146
+ * and applies the result to the handle's DOM element.
147
+ *
148
+ * @param entry - The grip entry to reposition
149
+ */
150
+ private positionEntry;
151
+ /**
152
+ * Repositions every active grip handle after a view transform or resize.
153
+ *
154
+ * Does not recreate entries; only updates DOM positions from stored WCS points.
155
+ */
156
+ private repositionAll;
157
+ /**
158
+ * Destroys all grip handle DOM elements and clears the entry list.
159
+ *
160
+ * Also resets {@link _hotEntry}. Does not cancel an active edit session;
161
+ * use {@link clear} for full teardown including session cancellation.
162
+ */
163
+ private clearEntries;
164
+ /**
165
+ * Cancels any in-progress edit and removes all grip handles.
166
+ *
167
+ * Used by {@link dispose} and internally when a full reset is required.
168
+ */
169
+ private clear;
170
+ }
171
+ //# sourceMappingURL=AcEdGripManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcEdGripManager.d.ts","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripManager.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AA0BnD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,eAAe;IAC1B,iFAAiF;IACjF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,uEAAuE;IACvE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,iEAAiE;IACjE,OAAO,CAAC,YAAY,CAAmC;IACvD,6EAA6E;IAC7E,OAAO,CAAC,SAAS,CAA6B;IAE9C,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuB;IACrD,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA6B;IAC9D,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CACC;IAErC;;;;;;;;OAQG;gBACS,IAAI,EAAE,YAAY;IAK9B;;;;;OAKG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;;;;OAKG;IACH,OAAO;IAKP;;;;;;;;OAQG;IACH,OAAO;IA+BP;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAgBpB;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;IAelB;;OAEG;IACH,OAAO,CAAC,YAAY;IAepB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;OAEG;IACH,OAAO,CAAC,eAAe;IAavB;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;IA0BxB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,SAAS;IA0BjB;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IAMf;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa;IAMrB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAMrB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAQpB;;;;OAIG;IACH,OAAO,CAAC,KAAK;CAKd"}
@@ -0,0 +1,376 @@
1
+ var __values = (this && this.__values) || function(o) {
2
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
+ if (m) return m.call(o);
4
+ if (o && typeof o.length === "number") return {
5
+ next: function () {
6
+ if (o && i >= o.length) o = void 0;
7
+ return { value: o && o[i++], done: !o };
8
+ }
9
+ };
10
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
+ };
12
+ import { AcDbSystemVariables, AcDbSysVarManager } from '@mlightcad/data-model';
13
+ import { AcApDocManager } from '../../app';
14
+ import { AcEdMTextEditor } from '../input/ui/AcEdMTextEditor';
15
+ import { isGripAppearanceSysVar, readGripAppearance } from './AcEdGripAppearance';
16
+ import { AcEdGripEditSession } from './AcEdGripEditSession';
17
+ import { AcEdGripHandle } from './AcEdGripHandle';
18
+ import { acedShouldShowGrips } from './AcEdGripPolicy';
19
+ /**
20
+ * Manages grip point display and drag editing for the active view.
21
+ *
22
+ * Grip handles are shown for entities in the view's selection set when the
23
+ * editor is idle, the document is writable, and selection count is within the
24
+ * `GRIPOBJLIMIT` system variable. Grip size and colours follow `GRIPSIZE`,
25
+ * `GRIPCOLOR`, and `GRIPHOT`. The manager listens for selection, view,
26
+ * command, and system-variable changes to refresh or reposition handles.
27
+ *
28
+ * Clicking a grip starts an {@link AcEdGripEditSession} that previews and
29
+ * commits entity geometry changes; while dragging, all grip handles are hidden.
30
+ *
31
+ * ## Key Responsibilities
32
+ * - **Display**: Create and position grip handles from entity grip points
33
+ * - **Interaction**: Route hover, hot, and mousedown events to edit sessions
34
+ * - **Lifecycle**: Subscribe/unsubscribe view events and dispose DOM on teardown
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * const gripManager = new AcEdGripManager(view);
39
+ * // Handles appear automatically when entities are selected.
40
+ * // On view dispose:
41
+ * gripManager.dispose();
42
+ * ```
43
+ */
44
+ var AcEdGripManager = /** @class */ (function () {
45
+ /**
46
+ * Creates a grip manager bound to the given view.
47
+ *
48
+ * Registers event listeners on the view's selection set, editor, view
49
+ * events, and `GRIPOBJLIMIT` system variable so grips stay in sync with
50
+ * application state.
51
+ *
52
+ * @param view - The CAD view whose selection and container host grip handles
53
+ */
54
+ function AcEdGripManager(view) {
55
+ var _this = this;
56
+ /** Active grip entries, one per grip point on each selected entity. */
57
+ this._entries = [];
58
+ /** In-progress grip drag session, or `null` when not editing. */
59
+ this._editSession = null;
60
+ /** Entry currently under the pointer during mousedown (hot grip), if any. */
61
+ this._hotEntry = null;
62
+ /** Stable listener reference for selection/command refresh. */
63
+ this._boundRefresh = function () { return _this.refresh(); };
64
+ /** Stable listener reference for view pan/zoom/resize repositioning. */
65
+ this._boundReposition = function () { return _this.repositionAll(); };
66
+ /** Stable listener reference for grip-related system variable changes. */
67
+ this._boundSysVarChanged = function (args) {
68
+ return _this.onGripSysVarChanged(args.name);
69
+ };
70
+ this._view = view;
71
+ this.bindEvents();
72
+ }
73
+ Object.defineProperty(AcEdGripManager.prototype, "isDragging", {
74
+ /**
75
+ * Whether a grip drag edit is currently in progress.
76
+ *
77
+ * While `true`, hover styling on other handles is suppressed and grip
78
+ * handles are hidden until the session ends.
79
+ */
80
+ get: function () {
81
+ return this._editSession != null;
82
+ },
83
+ enumerable: false,
84
+ configurable: true
85
+ });
86
+ /**
87
+ * Tears down the manager and releases all resources.
88
+ *
89
+ * Unsubscribes from view events, cancels any active edit session, and
90
+ * destroys all grip handle DOM elements.
91
+ */
92
+ AcEdGripManager.prototype.dispose = function () {
93
+ this.unbindEvents();
94
+ this.clear();
95
+ };
96
+ /**
97
+ * Rebuilds the grip handle set from the current selection.
98
+ *
99
+ * Clears existing entries first. If grips are not allowed (read-only mode,
100
+ * active command, MText editor, or selection over limit), no new handles are
101
+ * created. Otherwise, iterates selected entities, queries grip points via
102
+ * `subGetGripPoints()`, creates handles, wires pointer events, and positions
103
+ * each entry in container coordinates.
104
+ */
105
+ AcEdGripManager.prototype.refresh = function () {
106
+ var e_1, _a;
107
+ this.clearEntries();
108
+ if (!this.canShowGrips()) {
109
+ return;
110
+ }
111
+ var doc = AcApDocManager.instance.curDocument;
112
+ var blockTable = doc.database.tables.blockTable;
113
+ var appearance = readGripAppearance(doc.database);
114
+ try {
115
+ for (var _b = __values(this._view.selectionSet.ids), _c = _b.next(); !_c.done; _c = _b.next()) {
116
+ var entityId = _c.value;
117
+ var entity = blockTable.getEntityById(entityId);
118
+ if (!entity)
119
+ continue;
120
+ var gripPoints = entity.subGetGripPoints();
121
+ for (var gripIndex = 0; gripIndex < gripPoints.length; ++gripIndex) {
122
+ var wcsPoint = gripPoints[gripIndex];
123
+ var handle = new AcEdGripHandle(this._view.container, appearance);
124
+ var entry = {
125
+ entityId: entityId,
126
+ gripIndex: gripIndex,
127
+ wcsPoint: wcsPoint,
128
+ handle: handle
129
+ };
130
+ this.wireHandleEvents(entry);
131
+ this._entries.push(entry);
132
+ this.positionEntry(entry);
133
+ }
134
+ }
135
+ }
136
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
137
+ finally {
138
+ try {
139
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
140
+ }
141
+ finally { if (e_1) throw e_1.error; }
142
+ }
143
+ };
144
+ /**
145
+ * Determines whether grip handles may be shown for the current view state.
146
+ *
147
+ * Delegates to {@link acedShouldShowGrips} using document open mode, editor
148
+ * activity, MText input focus, selection count, and `GRIPOBJLIMIT`.
149
+ *
150
+ * @returns `true` if grips should be displayed; otherwise `false`
151
+ */
152
+ AcEdGripManager.prototype.canShowGrips = function () {
153
+ var doc = AcApDocManager.instance.curDocument;
154
+ var gripObjLimit = AcDbSysVarManager.instance().getVar(AcDbSystemVariables.GRIPOBJLIMIT, doc.database);
155
+ return acedShouldShowGrips(doc.openMode, this._view.editor.isActive, !!AcEdMTextEditor.getActiveInputBox(), this._view.selectionSet.count, gripObjLimit);
156
+ };
157
+ /**
158
+ * Subscribes to events that require a full grip refresh or reposition.
159
+ *
160
+ * Refresh triggers: selection added/removed, command start/end,
161
+ * `GRIPOBJLIMIT` sysvar change. Reposition triggers: view changed, view resize.
162
+ * Appearance updates: `GRIPSIZE`, `GRIPCOLOR`, `GRIPHOT` sysvar changes.
163
+ */
164
+ AcEdGripManager.prototype.bindEvents = function () {
165
+ var _a = this._view, selectionSet = _a.selectionSet, editor = _a.editor, events = _a.events;
166
+ selectionSet.events.selectionAdded.addEventListener(this._boundRefresh);
167
+ selectionSet.events.selectionRemoved.addEventListener(this._boundRefresh);
168
+ events.viewChanged.addEventListener(this._boundReposition);
169
+ events.viewResize.addEventListener(this._boundReposition);
170
+ editor.events.commandWillStart.addEventListener(this._boundRefresh);
171
+ editor.events.commandEnded.addEventListener(this._boundRefresh);
172
+ AcDbSysVarManager.instance().events.sysVarChanged.addEventListener(this._boundSysVarChanged);
173
+ };
174
+ /**
175
+ * Removes all event listeners registered by {@link bindEvents}.
176
+ */
177
+ AcEdGripManager.prototype.unbindEvents = function () {
178
+ var _a = this._view, selectionSet = _a.selectionSet, editor = _a.editor, events = _a.events;
179
+ selectionSet.events.selectionAdded.removeEventListener(this._boundRefresh);
180
+ selectionSet.events.selectionRemoved.removeEventListener(this._boundRefresh);
181
+ events.viewChanged.removeEventListener(this._boundReposition);
182
+ events.viewResize.removeEventListener(this._boundReposition);
183
+ editor.events.commandWillStart.removeEventListener(this._boundRefresh);
184
+ editor.events.commandEnded.removeEventListener(this._boundRefresh);
185
+ AcDbSysVarManager.instance().events.sysVarChanged.removeEventListener(this._boundSysVarChanged);
186
+ };
187
+ /**
188
+ * Reacts to grip-related system variable changes.
189
+ */
190
+ AcEdGripManager.prototype.onGripSysVarChanged = function (name) {
191
+ var normalized = name.toLowerCase();
192
+ if (normalized === AcDbSystemVariables.GRIPOBJLIMIT.toLowerCase()) {
193
+ this.refresh();
194
+ return;
195
+ }
196
+ if (isGripAppearanceSysVar(normalized)) {
197
+ this.applyAppearance();
198
+ }
199
+ };
200
+ /**
201
+ * Updates size and colours on existing grip handles from current sysvars.
202
+ */
203
+ AcEdGripManager.prototype.applyAppearance = function () {
204
+ var e_2, _a;
205
+ if (this._entries.length === 0) {
206
+ return;
207
+ }
208
+ var appearance = readGripAppearance(AcApDocManager.instance.curDocument.database);
209
+ try {
210
+ for (var _b = __values(this._entries), _c = _b.next(); !_c.done; _c = _b.next()) {
211
+ var entry = _c.value;
212
+ entry.handle.applyAppearance(appearance);
213
+ }
214
+ }
215
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
216
+ finally {
217
+ try {
218
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
219
+ }
220
+ finally { if (e_2) throw e_2.error; }
221
+ }
222
+ };
223
+ /**
224
+ * Attaches pointer event handlers to a grip handle element.
225
+ *
226
+ * - **mouseenter**: Sets hover state unless a drag is active
227
+ * - **mouseleave**: Reverts to normal unless this entry is the hot grip
228
+ * - **mousedown** (left button): Marks hot, prevents default propagation,
229
+ * and starts a grip edit session when grips are allowed
230
+ *
231
+ * @param entry - The grip entry whose handle receives the listeners
232
+ */
233
+ AcEdGripManager.prototype.wireHandleEvents = function (entry) {
234
+ var _this = this;
235
+ var element = entry.handle.element;
236
+ element.addEventListener('mouseenter', function () {
237
+ if (_this.isDragging)
238
+ return;
239
+ entry.handle.setState('hover');
240
+ });
241
+ element.addEventListener('mouseleave', function () {
242
+ if (_this._hotEntry === entry)
243
+ return;
244
+ entry.handle.setState('normal');
245
+ });
246
+ element.addEventListener('mousedown', function (e) {
247
+ if (e.button !== 0)
248
+ return;
249
+ if (!_this.canShowGrips())
250
+ return;
251
+ e.preventDefault();
252
+ e.stopPropagation();
253
+ _this._hotEntry = entry;
254
+ entry.handle.setState('hot');
255
+ _this.startEdit(entry);
256
+ });
257
+ };
258
+ /**
259
+ * Begins a grip drag edit for the given entry.
260
+ *
261
+ * Resolves the entity from the document, hides all grip handles for the
262
+ * duration of the drag, and constructs an {@link AcEdGripEditSession} that
263
+ * calls {@link endEdit} when the session completes.
264
+ *
265
+ * If the entity no longer exists, {@link endEdit} is invoked immediately.
266
+ *
267
+ * @param entry - The grip entry that was activated by the user
268
+ */
269
+ AcEdGripManager.prototype.startEdit = function (entry) {
270
+ var _this = this;
271
+ var entity = AcApDocManager.instance.curDocument.database.tables.blockTable.getEntityById(entry.entityId);
272
+ if (!entity) {
273
+ this.endEdit();
274
+ return;
275
+ }
276
+ this.hideEntriesForDrag();
277
+ var target = {
278
+ entityId: entry.entityId,
279
+ gripIndex: entry.gripIndex,
280
+ gripBaseWcs: entry.wcsPoint
281
+ };
282
+ this._editSession = new AcEdGripEditSession(this._view, entity, target, function () { return _this.endEdit(); });
283
+ };
284
+ /**
285
+ * Completes or aborts the current grip edit and restores grip display.
286
+ *
287
+ * Clears the edit session and hot entry, then rebuilds handles via
288
+ * {@link refresh} so geometry and selection state are reflected on screen.
289
+ */
290
+ AcEdGripManager.prototype.endEdit = function () {
291
+ this._editSession = null;
292
+ this._hotEntry = null;
293
+ this.refresh();
294
+ };
295
+ /**
296
+ * Removes all visible grip handles while a drag edit is in progress.
297
+ *
298
+ * Called when starting an edit so only the preview jig is shown, not the
299
+ * static grip squares.
300
+ */
301
+ AcEdGripManager.prototype.hideEntriesForDrag = function () {
302
+ this.clearEntries();
303
+ };
304
+ /**
305
+ * Updates a single grip handle's screen position from its WCS point.
306
+ *
307
+ * Converts world coordinates to canvas, then to container-local pixels,
308
+ * and applies the result to the handle's DOM element.
309
+ *
310
+ * @param entry - The grip entry to reposition
311
+ */
312
+ AcEdGripManager.prototype.positionEntry = function (entry) {
313
+ var canvasPos = this._view.worldToScreen(entry.wcsPoint);
314
+ var containerPos = this._view.canvasToContainer(canvasPos);
315
+ entry.handle.setPosition(containerPos);
316
+ };
317
+ /**
318
+ * Repositions every active grip handle after a view transform or resize.
319
+ *
320
+ * Does not recreate entries; only updates DOM positions from stored WCS points.
321
+ */
322
+ AcEdGripManager.prototype.repositionAll = function () {
323
+ var e_3, _a;
324
+ try {
325
+ for (var _b = __values(this._entries), _c = _b.next(); !_c.done; _c = _b.next()) {
326
+ var entry = _c.value;
327
+ this.positionEntry(entry);
328
+ }
329
+ }
330
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
331
+ finally {
332
+ try {
333
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
334
+ }
335
+ finally { if (e_3) throw e_3.error; }
336
+ }
337
+ };
338
+ /**
339
+ * Destroys all grip handle DOM elements and clears the entry list.
340
+ *
341
+ * Also resets {@link _hotEntry}. Does not cancel an active edit session;
342
+ * use {@link clear} for full teardown including session cancellation.
343
+ */
344
+ AcEdGripManager.prototype.clearEntries = function () {
345
+ var e_4, _a;
346
+ try {
347
+ for (var _b = __values(this._entries), _c = _b.next(); !_c.done; _c = _b.next()) {
348
+ var entry = _c.value;
349
+ entry.handle.destroy();
350
+ }
351
+ }
352
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
353
+ finally {
354
+ try {
355
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
356
+ }
357
+ finally { if (e_4) throw e_4.error; }
358
+ }
359
+ this._entries.length = 0;
360
+ this._hotEntry = null;
361
+ };
362
+ /**
363
+ * Cancels any in-progress edit and removes all grip handles.
364
+ *
365
+ * Used by {@link dispose} and internally when a full reset is required.
366
+ */
367
+ AcEdGripManager.prototype.clear = function () {
368
+ var _a;
369
+ (_a = this._editSession) === null || _a === void 0 ? void 0 : _a.cancel();
370
+ this._editSession = null;
371
+ this.clearEntries();
372
+ };
373
+ return AcEdGripManager;
374
+ }());
375
+ export { AcEdGripManager };
376
+ //# sourceMappingURL=AcEdGripManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcEdGripManager.js","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripManager.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAEL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,mBAAmB,EAAsB,MAAM,uBAAuB,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAmBtD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IAkBE;;;;;;;;OAQG;IACH,yBAAY,IAAkB;QAA9B,iBAGC;QA3BD,uEAAuE;QACtD,aAAQ,GAAoB,EAAE,CAAA;QAC/C,iEAAiE;QACzD,iBAAY,GAA+B,IAAI,CAAA;QACvD,6EAA6E;QACrE,cAAS,GAAyB,IAAI,CAAA;QAE9C,+DAA+D;QAC9C,kBAAa,GAAG,cAAM,OAAA,KAAI,CAAC,OAAO,EAAE,EAAd,CAAc,CAAA;QACrD,wEAAwE;QACvD,qBAAgB,GAAG,cAAM,OAAA,KAAI,CAAC,aAAa,EAAE,EAApB,CAAoB,CAAA;QAC9D,0EAA0E;QACzD,wBAAmB,GAAG,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B;QACE,IAAI,CAAC,YAAY,EAAE,CAAA;IACrB,CAAC;IAED;;;;;;;OAOG;IACK,uCAAa,GAArB,UAAsB,KAAoB;QACxC,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC1D,IAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA;QAC5D,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;IACxC,CAAC;IAED;;;;OAIG;IACK,uCAAa,GAArB;;;YACE,KAAoB,IAAA,KAAA,SAAA,IAAI,CAAC,QAAQ,CAAA,gBAAA,4BAAE,CAAC;gBAA/B,IAAM,KAAK,WAAA;gBACd,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YAC3B,CAAC;;;;;;;;;IACH,CAAC;IAED;;;;;OAKG;IACK,sCAAY,GAApB;;;YACE,KAAoB,IAAA,KAAA,SAAA,IAAI,CAAC,QAAQ,CAAA,gBAAA,4BAAE,CAAC;gBAA/B,IAAM,KAAK,WAAA;gBACd,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;YACxB,CAAC;;;;;;;;;QACD,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;IACvB,CAAC;IAED;;;;OAIG;IACK,+BAAK,GAAb;;QACE,MAAA,IAAI,CAAC,YAAY,0CAAE,MAAM,EAAE,CAAA;QAC3B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAA;QACxB,IAAI,CAAC,YAAY,EAAE,CAAA;IACrB,CAAC;IACH,sBAAC;AAAD,CAAC,AA3UD,IA2UC"}
@@ -0,0 +1,6 @@
1
+ import { AcEdOpenMode } from '../view/AcEdOpenMode';
2
+ /**
3
+ * Returns whether grip handles should be shown for the given view state.
4
+ */
5
+ export declare function acedShouldShowGrips(openMode: AcEdOpenMode, editorActive: boolean, mtextEditorActive: boolean, selectionCount: number, gripObjLimit: number): boolean;
6
+ //# sourceMappingURL=AcEdGripPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcEdGripPolicy.d.ts","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAmBnD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,OAAO,EACrB,iBAAiB,EAAE,OAAO,EAC1B,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,GACnB,OAAO,CAWT"}
@@ -0,0 +1,30 @@
1
+ import { AcEdOpenMode } from '../view/AcEdOpenMode';
2
+ /**
3
+ * Returns whether grips should be suppressed for the given selection count,
4
+ * matching AutoCAD GRIPOBJLIMIT behavior.
5
+ *
6
+ * When `gripObjLimit` is `0`, grips are always shown. Otherwise grips are
7
+ * suppressed when `selectionCount` exceeds the limit.
8
+ */
9
+ function shouldSuppressGripsForSelectionCount(selectionCount, gripObjLimit) {
10
+ if (gripObjLimit <= 0) {
11
+ return false;
12
+ }
13
+ return selectionCount > gripObjLimit;
14
+ }
15
+ /**
16
+ * Returns whether grip handles should be shown for the given view state.
17
+ */
18
+ export function acedShouldShowGrips(openMode, editorActive, mtextEditorActive, selectionCount, gripObjLimit) {
19
+ if (openMode !== AcEdOpenMode.Write) {
20
+ return false;
21
+ }
22
+ if (editorActive) {
23
+ return false;
24
+ }
25
+ if (mtextEditorActive) {
26
+ return false;
27
+ }
28
+ return !shouldSuppressGripsForSelectionCount(selectionCount, gripObjLimit);
29
+ }
30
+ //# sourceMappingURL=AcEdGripPolicy.js.map