@mlightcad/cad-simple-viewer 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +3 -0
  3. package/dist/{index.js → cad-simple-viewer.js} +16583 -14248
  4. package/dist/cad-simple-viewer.umd.cjs +921 -0
  5. package/dist/dxf-parser-worker.js +2002 -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 +3 -0
  10. package/lib/app/AcApContext.js.map +1 -1
  11. package/lib/app/AcApDocManager.d.ts +7 -0
  12. package/lib/app/AcApDocManager.d.ts.map +1 -1
  13. package/lib/app/AcApDocManager.js +84 -10
  14. package/lib/app/AcApDocManager.js.map +1 -1
  15. package/lib/app/AcDbOpenDatabaseOptions.d.ts +29 -0
  16. package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -1
  17. package/lib/app/AcDbOpenDatabaseOptions.js +10 -1
  18. package/lib/app/AcDbOpenDatabaseOptions.js.map +1 -1
  19. package/lib/app/index.d.ts +1 -0
  20. package/lib/app/index.d.ts.map +1 -1
  21. package/lib/app/index.js +1 -0
  22. package/lib/app/index.js.map +1 -1
  23. package/lib/command/AcApCacheFontCmd.d.ts +25 -0
  24. package/lib/command/AcApCacheFontCmd.d.ts.map +1 -0
  25. package/lib/command/AcApCacheFontCmd.js +142 -0
  26. package/lib/command/AcApCacheFontCmd.js.map +1 -0
  27. package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
  28. package/lib/command/AcApSysVarCmd.js +5 -11
  29. package/lib/command/AcApSysVarCmd.js.map +1 -1
  30. package/lib/command/convert/AcApPngConvertor.d.ts +1 -1
  31. package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -1
  32. package/lib/command/convert/AcApPngConvertor.js +5 -2
  33. package/lib/command/convert/AcApPngConvertor.js.map +1 -1
  34. package/lib/command/draw/AcApArcCmd.d.ts.map +1 -1
  35. package/lib/command/draw/AcApArcCmd.js +2 -5
  36. package/lib/command/draw/AcApArcCmd.js.map +1 -1
  37. package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -1
  38. package/lib/command/draw/AcApEllipseCmd.js +2 -5
  39. package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
  40. package/lib/command/draw/AcApHatchCmd.d.ts +1 -1
  41. package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
  42. package/lib/command/draw/AcApMLineCmd.js +2 -2
  43. package/lib/command/draw/AcApMLineCmd.js.map +1 -1
  44. package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -1
  45. package/lib/command/draw/AcApPolygonCmd.js +2 -5
  46. package/lib/command/draw/AcApPolygonCmd.js.map +1 -1
  47. package/lib/command/draw/AcApRectCmd.d.ts +6 -0
  48. package/lib/command/draw/AcApRectCmd.d.ts.map +1 -1
  49. package/lib/command/draw/AcApRectCmd.js +12 -10
  50. package/lib/command/draw/AcApRectCmd.js.map +1 -1
  51. package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -1
  52. package/lib/command/draw/AcApXLineCmd.js +1 -1
  53. package/lib/command/draw/AcApXLineCmd.js.map +1 -1
  54. package/lib/command/index.d.ts +1 -0
  55. package/lib/command/index.d.ts.map +1 -1
  56. package/lib/command/index.js +1 -0
  57. package/lib/command/index.js.map +1 -1
  58. package/lib/command/layer/AcApLayerCmd.d.ts +0 -7
  59. package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -1
  60. package/lib/command/layer/AcApLayerCmd.js +13 -23
  61. package/lib/command/layer/AcApLayerCmd.js.map +1 -1
  62. package/lib/command/layer/AcApLayerCurCmd.d.ts +0 -7
  63. package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -1
  64. package/lib/command/layer/AcApLayerCurCmd.js +3 -13
  65. package/lib/command/layer/AcApLayerCurCmd.js.map +1 -1
  66. package/lib/command/layer/AcApLayerDelCmd.d.ts +0 -7
  67. package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -1
  68. package/lib/command/layer/AcApLayerDelCmd.js +8 -18
  69. package/lib/command/layer/AcApLayerDelCmd.js.map +1 -1
  70. package/lib/command/layer/AcApLayerFreezeCmd.d.ts +0 -7
  71. package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -1
  72. package/lib/command/layer/AcApLayerFreezeCmd.js +11 -21
  73. package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -1
  74. package/lib/command/layer/AcApLayerIsoCmd.d.ts +0 -7
  75. package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -1
  76. package/lib/command/layer/AcApLayerIsoCmd.js +7 -17
  77. package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -1
  78. package/lib/command/layer/AcApLayerLockCmd.d.ts +0 -7
  79. package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -1
  80. package/lib/command/layer/AcApLayerLockCmd.js +4 -14
  81. package/lib/command/layer/AcApLayerLockCmd.js.map +1 -1
  82. package/lib/command/layer/AcApLayerOffCmd.d.ts +0 -7
  83. package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -1
  84. package/lib/command/layer/AcApLayerOffCmd.js +11 -21
  85. package/lib/command/layer/AcApLayerOffCmd.js.map +1 -1
  86. package/lib/command/layer/AcApLayerOnCmd.d.ts +0 -7
  87. package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -1
  88. package/lib/command/layer/AcApLayerOnCmd.js +2 -13
  89. package/lib/command/layer/AcApLayerOnCmd.js.map +1 -1
  90. package/lib/command/layer/AcApLayerPCmd.d.ts +0 -7
  91. package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -1
  92. package/lib/command/layer/AcApLayerPCmd.js +2 -13
  93. package/lib/command/layer/AcApLayerPCmd.js.map +1 -1
  94. package/lib/command/layer/AcApLayerThawCmd.d.ts +0 -7
  95. package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -1
  96. package/lib/command/layer/AcApLayerThawCmd.js +2 -13
  97. package/lib/command/layer/AcApLayerThawCmd.js.map +1 -1
  98. package/lib/command/layer/AcApLayerUnisoCmd.d.ts +0 -7
  99. package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -1
  100. package/lib/command/layer/AcApLayerUnisoCmd.js +4 -15
  101. package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -1
  102. package/lib/command/layer/AcApLayerUnlockCmd.d.ts +0 -7
  103. package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -1
  104. package/lib/command/layer/AcApLayerUnlockCmd.js +4 -14
  105. package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -1
  106. package/lib/command/modify/AcApHideObjectsCmd.js +1 -1
  107. package/lib/command/modify/AcApHideObjectsCmd.js.map +1 -1
  108. package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
  109. package/lib/command/modify/AcApOffsetCmd.js +9 -4
  110. package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
  111. package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
  112. package/lib/command/modify/AcApRotateCmd.js +2 -5
  113. package/lib/command/modify/AcApRotateCmd.js.map +1 -1
  114. package/lib/command/modify/AcApUnisolateObjectsCmd.d.ts.map +1 -1
  115. package/lib/command/modify/AcApUnisolateObjectsCmd.js +3 -3
  116. package/lib/command/modify/AcApUnisolateObjectsCmd.js.map +1 -1
  117. package/lib/editor/command/AcEdCommand.d.ts +16 -0
  118. package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
  119. package/lib/editor/command/AcEdCommand.js +23 -0
  120. package/lib/editor/command/AcEdCommand.js.map +1 -1
  121. package/lib/editor/global/AcEdUiColor.d.ts +13 -13
  122. package/lib/editor/global/AcEdUiColor.d.ts.map +1 -1
  123. package/lib/editor/global/AcEdUiColor.js +21 -20
  124. package/lib/editor/global/AcEdUiColor.js.map +1 -1
  125. package/lib/editor/global/eventBus.d.ts +7 -1
  126. package/lib/editor/global/eventBus.d.ts.map +1 -1
  127. package/lib/editor/global/eventBus.js.map +1 -1
  128. package/lib/editor/grip/AcEdGripEditSession.d.ts +29 -0
  129. package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -0
  130. package/lib/editor/grip/AcEdGripEditSession.js +76 -0
  131. package/lib/editor/grip/AcEdGripEditSession.js.map +1 -0
  132. package/lib/editor/grip/AcEdGripHandle.d.ts +20 -0
  133. package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -0
  134. package/lib/editor/grip/AcEdGripHandle.js +59 -0
  135. package/lib/editor/grip/AcEdGripHandle.js.map +1 -0
  136. package/lib/editor/grip/AcEdGripManager.d.ts +159 -0
  137. package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -0
  138. package/lib/editor/grip/AcEdGripManager.js +336 -0
  139. package/lib/editor/grip/AcEdGripManager.js.map +1 -0
  140. package/lib/editor/grip/AcEdGripPolicy.d.ts +6 -0
  141. package/lib/editor/grip/AcEdGripPolicy.d.ts.map +1 -0
  142. package/lib/editor/grip/AcEdGripPolicy.js +30 -0
  143. package/lib/editor/grip/AcEdGripPolicy.js.map +1 -0
  144. package/lib/editor/grip/AcEdGripPreviewJig.d.ts +21 -0
  145. package/lib/editor/grip/AcEdGripPreviewJig.d.ts.map +1 -0
  146. package/lib/editor/grip/AcEdGripPreviewJig.js +73 -0
  147. package/lib/editor/grip/AcEdGripPreviewJig.js.map +1 -0
  148. package/lib/editor/grip/index.d.ts +5 -0
  149. package/lib/editor/grip/index.d.ts.map +1 -0
  150. package/lib/editor/grip/index.js +5 -0
  151. package/lib/editor/grip/index.js.map +1 -0
  152. package/lib/editor/index.d.ts +1 -0
  153. package/lib/editor/index.d.ts.map +1 -1
  154. package/lib/editor/index.js +1 -0
  155. package/lib/editor/index.js.map +1 -1
  156. package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
  157. package/lib/editor/input/AcEdCursorManager.js +2 -2
  158. package/lib/editor/input/AcEdCursorManager.js.map +1 -1
  159. package/lib/editor/input/AcEdOsnapResolver.d.ts +34 -0
  160. package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -0
  161. package/lib/editor/input/AcEdOsnapResolver.js +117 -0
  162. package/lib/editor/input/AcEdOsnapResolver.js.map +1 -0
  163. package/lib/editor/input/handler/AcEdAngleHandler.d.ts +2 -1
  164. package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -1
  165. package/lib/editor/input/handler/AcEdAngleHandler.js +6 -0
  166. package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -1
  167. package/lib/editor/input/handler/AcEdInputHandler.d.ts +20 -1
  168. package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -1
  169. package/lib/editor/input/handler/AcEdKeywordHandler.d.ts +2 -1
  170. package/lib/editor/input/handler/AcEdKeywordHandler.d.ts.map +1 -1
  171. package/lib/editor/input/handler/AcEdKeywordHandler.js +3 -0
  172. package/lib/editor/input/handler/AcEdKeywordHandler.js.map +1 -1
  173. package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +2 -1
  174. package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -1
  175. package/lib/editor/input/handler/AcEdNumericalHandler.js +6 -0
  176. package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -1
  177. package/lib/editor/input/handler/AcEdPointHandler.d.ts +17 -1
  178. package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -1
  179. package/lib/editor/input/handler/AcEdPointHandler.js +89 -0
  180. package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -1
  181. package/lib/editor/input/handler/AcEdStringHandler.d.ts +2 -1
  182. package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -1
  183. package/lib/editor/input/handler/AcEdStringHandler.js +3 -0
  184. package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -1
  185. package/lib/editor/input/index.d.ts +1 -0
  186. package/lib/editor/input/index.d.ts.map +1 -1
  187. package/lib/editor/input/index.js +1 -0
  188. package/lib/editor/input/index.js.map +1 -1
  189. package/lib/editor/input/session/AcEdInputSession.d.ts +11 -1
  190. package/lib/editor/input/session/AcEdInputSession.d.ts.map +1 -1
  191. package/lib/editor/input/session/AcEdInputSession.js.map +1 -1
  192. package/lib/editor/input/session/AcEdPromptInputSession.d.ts +51 -0
  193. package/lib/editor/input/session/AcEdPromptInputSession.d.ts.map +1 -0
  194. package/lib/editor/input/session/AcEdPromptInputSession.js +109 -0
  195. package/lib/editor/input/session/AcEdPromptInputSession.js.map +1 -0
  196. package/lib/editor/input/session/index.d.ts +1 -0
  197. package/lib/editor/input/session/index.d.ts.map +1 -1
  198. package/lib/editor/input/session/index.js +1 -0
  199. package/lib/editor/input/session/index.js.map +1 -1
  200. package/lib/editor/input/ui/AcEdCommandLine.d.ts +10 -0
  201. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  202. package/lib/editor/input/ui/AcEdCommandLine.js +67 -35
  203. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  204. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +0 -11
  205. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  206. package/lib/editor/input/ui/AcEdFloatingInput.js +9 -119
  207. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  208. package/lib/editor/input/ui/AcEdInputManager.d.ts +26 -23
  209. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  210. package/lib/editor/input/ui/AcEdInputManager.js +135 -83
  211. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  212. package/lib/editor/input/ui/AcEdMTextEditor.js +2 -2
  213. package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
  214. package/lib/editor/view/AcEdBaseView.d.ts +7 -0
  215. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  216. package/lib/editor/view/AcEdBaseView.js +12 -0
  217. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  218. package/lib/i18n/en/command.d.ts +3 -0
  219. package/lib/i18n/en/command.d.ts.map +1 -1
  220. package/lib/i18n/en/command.js +3 -0
  221. package/lib/i18n/en/command.js.map +1 -1
  222. package/lib/i18n/en/jig.d.ts +26 -0
  223. package/lib/i18n/en/jig.d.ts.map +1 -1
  224. package/lib/i18n/en/jig.js +134 -108
  225. package/lib/i18n/en/jig.js.map +1 -1
  226. package/lib/i18n/en/main.d.ts +3 -0
  227. package/lib/i18n/en/main.d.ts.map +1 -1
  228. package/lib/i18n/en/main.js +4 -1
  229. package/lib/i18n/en/main.js.map +1 -1
  230. package/lib/i18n/zh/command.d.ts +3 -0
  231. package/lib/i18n/zh/command.d.ts.map +1 -1
  232. package/lib/i18n/zh/command.js +3 -0
  233. package/lib/i18n/zh/command.js.map +1 -1
  234. package/lib/i18n/zh/jig.d.ts +26 -0
  235. package/lib/i18n/zh/jig.d.ts.map +1 -1
  236. package/lib/i18n/zh/jig.js +134 -108
  237. package/lib/i18n/zh/jig.js.map +1 -1
  238. package/lib/i18n/zh/main.d.ts +3 -0
  239. package/lib/i18n/zh/main.d.ts.map +1 -1
  240. package/lib/i18n/zh/main.js +4 -1
  241. package/lib/i18n/zh/main.js.map +1 -1
  242. package/lib/plugin/AcApLazyPluginRegistration.d.ts +3 -8
  243. package/lib/plugin/AcApLazyPluginRegistration.d.ts.map +1 -1
  244. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +1 -1
  245. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +2 -2
  246. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
  247. package/lib/util/AcApFontUtil.d.ts +14 -2
  248. package/lib/util/AcApFontUtil.d.ts.map +1 -1
  249. package/lib/util/AcApFontUtil.js +18 -0
  250. package/lib/util/AcApFontUtil.js.map +1 -1
  251. package/lib/view/AcTrEntityDisplayController.d.ts +46 -0
  252. package/lib/view/AcTrEntityDisplayController.d.ts.map +1 -0
  253. package/lib/view/AcTrEntityDisplayController.js +114 -0
  254. package/lib/view/AcTrEntityDisplayController.js.map +1 -0
  255. package/lib/view/AcTrGroupWcsBboxAssert.d.ts +27 -0
  256. package/lib/view/AcTrGroupWcsBboxAssert.d.ts.map +1 -0
  257. package/lib/view/AcTrGroupWcsBboxAssert.js +65 -0
  258. package/lib/view/AcTrGroupWcsBboxAssert.js.map +1 -0
  259. package/lib/view/AcTrLayer.d.ts +7 -0
  260. package/lib/view/AcTrLayer.d.ts.map +1 -1
  261. package/lib/view/AcTrLayer.js +11 -2
  262. package/lib/view/AcTrLayer.js.map +1 -1
  263. package/lib/view/AcTrLayout.d.ts +1 -1
  264. package/lib/view/AcTrLayout.js +2 -2
  265. package/lib/view/AcTrLayout.js.map +1 -1
  266. package/lib/view/AcTrProgressiveOpenFitController.d.ts +64 -0
  267. package/lib/view/AcTrProgressiveOpenFitController.d.ts.map +1 -0
  268. package/lib/view/AcTrProgressiveOpenFitController.js +209 -0
  269. package/lib/view/AcTrProgressiveOpenFitController.js.map +1 -0
  270. package/lib/view/AcTrView2d.d.ts +95 -1
  271. package/lib/view/AcTrView2d.d.ts.map +1 -1
  272. package/lib/view/AcTrView2d.js +539 -200
  273. package/lib/view/AcTrView2d.js.map +1 -1
  274. package/package.json +13 -11
  275. package/dist/index.umd.cjs +0 -897
@@ -0,0 +1,336 @@
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 { AcEdGripEditSession } from './AcEdGripEditSession';
16
+ import { AcEdGripHandle } from './AcEdGripHandle';
17
+ import { acedShouldShowGrips } from './AcEdGripPolicy';
18
+ /**
19
+ * Manages grip point display and drag editing for the active view.
20
+ *
21
+ * Grip handles are shown for entities in the view's selection set when the
22
+ * editor is idle, the document is writable, and selection count is within the
23
+ * `GRIPOBJLIMIT` system variable. The manager listens for selection, view,
24
+ * command, and system-variable changes to refresh or reposition handles.
25
+ *
26
+ * Clicking a grip starts an {@link AcEdGripEditSession} that previews and
27
+ * commits entity geometry changes; while dragging, all grip handles are hidden.
28
+ *
29
+ * ## Key Responsibilities
30
+ * - **Display**: Create and position grip handles from entity grip points
31
+ * - **Interaction**: Route hover, hot, and mousedown events to edit sessions
32
+ * - **Lifecycle**: Subscribe/unsubscribe view events and dispose DOM on teardown
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * const gripManager = new AcEdGripManager(view);
37
+ * // Handles appear automatically when entities are selected.
38
+ * // On view dispose:
39
+ * gripManager.dispose();
40
+ * ```
41
+ */
42
+ var AcEdGripManager = /** @class */ (function () {
43
+ /**
44
+ * Creates a grip manager bound to the given view.
45
+ *
46
+ * Registers event listeners on the view's selection set, editor, view
47
+ * events, and `GRIPOBJLIMIT` system variable so grips stay in sync with
48
+ * application state.
49
+ *
50
+ * @param view - The CAD view whose selection and container host grip handles
51
+ */
52
+ function AcEdGripManager(view) {
53
+ var _this = this;
54
+ /** Active grip entries, one per grip point on each selected entity. */
55
+ this._entries = [];
56
+ /** In-progress grip drag session, or `null` when not editing. */
57
+ this._editSession = null;
58
+ /** Entry currently under the pointer during mousedown (hot grip), if any. */
59
+ this._hotEntry = null;
60
+ /** Stable listener reference for selection/command refresh. */
61
+ this._boundRefresh = function () { return _this.refresh(); };
62
+ /** Stable listener reference for view pan/zoom/resize repositioning. */
63
+ this._boundReposition = function () { return _this.repositionAll(); };
64
+ this._view = view;
65
+ this.bindEvents();
66
+ }
67
+ Object.defineProperty(AcEdGripManager.prototype, "isDragging", {
68
+ /**
69
+ * Whether a grip drag edit is currently in progress.
70
+ *
71
+ * While `true`, hover styling on other handles is suppressed and grip
72
+ * handles are hidden until the session ends.
73
+ */
74
+ get: function () {
75
+ return this._editSession != null;
76
+ },
77
+ enumerable: false,
78
+ configurable: true
79
+ });
80
+ /**
81
+ * Tears down the manager and releases all resources.
82
+ *
83
+ * Unsubscribes from view events, cancels any active edit session, and
84
+ * destroys all grip handle DOM elements.
85
+ */
86
+ AcEdGripManager.prototype.dispose = function () {
87
+ this.unbindEvents();
88
+ this.clear();
89
+ };
90
+ /**
91
+ * Rebuilds the grip handle set from the current selection.
92
+ *
93
+ * Clears existing entries first. If grips are not allowed (read-only mode,
94
+ * active command, MText editor, or selection over limit), no new handles are
95
+ * created. Otherwise, iterates selected entities, queries grip points via
96
+ * `subGetGripPoints()`, creates handles, wires pointer events, and positions
97
+ * each entry in container coordinates.
98
+ */
99
+ AcEdGripManager.prototype.refresh = function () {
100
+ var e_1, _a;
101
+ this.clearEntries();
102
+ if (!this.canShowGrips()) {
103
+ return;
104
+ }
105
+ var doc = AcApDocManager.instance.curDocument;
106
+ var blockTable = doc.database.tables.blockTable;
107
+ try {
108
+ for (var _b = __values(this._view.selectionSet.ids), _c = _b.next(); !_c.done; _c = _b.next()) {
109
+ var entityId = _c.value;
110
+ var entity = blockTable.getEntityById(entityId);
111
+ if (!entity)
112
+ continue;
113
+ var gripPoints = entity.subGetGripPoints();
114
+ for (var gripIndex = 0; gripIndex < gripPoints.length; ++gripIndex) {
115
+ var wcsPoint = gripPoints[gripIndex];
116
+ var handle = new AcEdGripHandle(this._view.container);
117
+ var entry = {
118
+ entityId: entityId,
119
+ gripIndex: gripIndex,
120
+ wcsPoint: wcsPoint,
121
+ handle: handle
122
+ };
123
+ this.wireHandleEvents(entry);
124
+ this._entries.push(entry);
125
+ this.positionEntry(entry);
126
+ }
127
+ }
128
+ }
129
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
130
+ finally {
131
+ try {
132
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
133
+ }
134
+ finally { if (e_1) throw e_1.error; }
135
+ }
136
+ };
137
+ /**
138
+ * Determines whether grip handles may be shown for the current view state.
139
+ *
140
+ * Delegates to {@link acedShouldShowGrips} using document open mode, editor
141
+ * activity, MText input focus, selection count, and `GRIPOBJLIMIT`.
142
+ *
143
+ * @returns `true` if grips should be displayed; otherwise `false`
144
+ */
145
+ AcEdGripManager.prototype.canShowGrips = function () {
146
+ var doc = AcApDocManager.instance.curDocument;
147
+ var gripObjLimit = AcDbSysVarManager.instance().getVar(AcDbSystemVariables.GRIPOBJLIMIT, doc.database);
148
+ return acedShouldShowGrips(doc.openMode, this._view.editor.isActive, !!AcEdMTextEditor.getActiveInputBox(), this._view.selectionSet.count, gripObjLimit);
149
+ };
150
+ /**
151
+ * Subscribes to events that require a full grip refresh or reposition.
152
+ *
153
+ * Refresh triggers: selection added/removed, command start/end,
154
+ * `GRIPOBJLIMIT` sysvar change. Reposition triggers: view changed, view resize.
155
+ */
156
+ AcEdGripManager.prototype.bindEvents = function () {
157
+ var _this = this;
158
+ var _a = this._view, selectionSet = _a.selectionSet, editor = _a.editor, events = _a.events;
159
+ selectionSet.events.selectionAdded.addEventListener(this._boundRefresh);
160
+ selectionSet.events.selectionRemoved.addEventListener(this._boundRefresh);
161
+ events.viewChanged.addEventListener(this._boundReposition);
162
+ events.viewResize.addEventListener(this._boundReposition);
163
+ editor.events.commandWillStart.addEventListener(this._boundRefresh);
164
+ editor.events.commandEnded.addEventListener(this._boundRefresh);
165
+ AcDbSysVarManager.instance().events.sysVarChanged.addEventListener(function (args) {
166
+ if (args.name === AcDbSystemVariables.GRIPOBJLIMIT.toLowerCase()) {
167
+ _this.refresh();
168
+ }
169
+ });
170
+ };
171
+ /**
172
+ * Removes all event listeners registered by {@link bindEvents}.
173
+ */
174
+ AcEdGripManager.prototype.unbindEvents = function () {
175
+ var _a = this._view, selectionSet = _a.selectionSet, editor = _a.editor, events = _a.events;
176
+ selectionSet.events.selectionAdded.removeEventListener(this._boundRefresh);
177
+ selectionSet.events.selectionRemoved.removeEventListener(this._boundRefresh);
178
+ events.viewChanged.removeEventListener(this._boundReposition);
179
+ events.viewResize.removeEventListener(this._boundReposition);
180
+ editor.events.commandWillStart.removeEventListener(this._boundRefresh);
181
+ editor.events.commandEnded.removeEventListener(this._boundRefresh);
182
+ };
183
+ /**
184
+ * Attaches pointer event handlers to a grip handle element.
185
+ *
186
+ * - **mouseenter**: Sets hover state unless a drag is active
187
+ * - **mouseleave**: Reverts to normal unless this entry is the hot grip
188
+ * - **mousedown** (left button): Marks hot, prevents default propagation,
189
+ * and starts a grip edit session when grips are allowed
190
+ *
191
+ * @param entry - The grip entry whose handle receives the listeners
192
+ */
193
+ AcEdGripManager.prototype.wireHandleEvents = function (entry) {
194
+ var _this = this;
195
+ var element = entry.handle.element;
196
+ element.addEventListener('mouseenter', function () {
197
+ if (_this.isDragging)
198
+ return;
199
+ entry.handle.setState('hover');
200
+ });
201
+ element.addEventListener('mouseleave', function () {
202
+ if (_this._hotEntry === entry)
203
+ return;
204
+ entry.handle.setState('normal');
205
+ });
206
+ element.addEventListener('mousedown', function (e) {
207
+ if (e.button !== 0)
208
+ return;
209
+ if (!_this.canShowGrips())
210
+ return;
211
+ e.preventDefault();
212
+ e.stopPropagation();
213
+ _this._hotEntry = entry;
214
+ entry.handle.setState('hot');
215
+ _this.startEdit(entry);
216
+ });
217
+ };
218
+ /**
219
+ * Begins a grip drag edit for the given entry.
220
+ *
221
+ * Resolves the entity from the document, hides all grip handles for the
222
+ * duration of the drag, and constructs an {@link AcEdGripEditSession} that
223
+ * calls {@link endEdit} when the session completes.
224
+ *
225
+ * If the entity no longer exists, {@link endEdit} is invoked immediately.
226
+ *
227
+ * @param entry - The grip entry that was activated by the user
228
+ */
229
+ AcEdGripManager.prototype.startEdit = function (entry) {
230
+ var _this = this;
231
+ var entity = AcApDocManager.instance.curDocument.database.tables.blockTable.getEntityById(entry.entityId);
232
+ if (!entity) {
233
+ this.endEdit();
234
+ return;
235
+ }
236
+ this.hideEntriesForDrag();
237
+ var target = {
238
+ entityId: entry.entityId,
239
+ gripIndex: entry.gripIndex,
240
+ gripBaseWcs: entry.wcsPoint
241
+ };
242
+ this._editSession = new AcEdGripEditSession(this._view, entity, target, function () { return _this.endEdit(); });
243
+ };
244
+ /**
245
+ * Completes or aborts the current grip edit and restores grip display.
246
+ *
247
+ * Clears the edit session and hot entry, then rebuilds handles via
248
+ * {@link refresh} so geometry and selection state are reflected on screen.
249
+ */
250
+ AcEdGripManager.prototype.endEdit = function () {
251
+ this._editSession = null;
252
+ this._hotEntry = null;
253
+ this.refresh();
254
+ };
255
+ /**
256
+ * Removes all visible grip handles while a drag edit is in progress.
257
+ *
258
+ * Called when starting an edit so only the preview jig is shown, not the
259
+ * static grip squares.
260
+ */
261
+ AcEdGripManager.prototype.hideEntriesForDrag = function () {
262
+ this.clearEntries();
263
+ };
264
+ /**
265
+ * Updates a single grip handle's screen position from its WCS point.
266
+ *
267
+ * Converts world coordinates to canvas, then to container-local pixels,
268
+ * and applies the result to the handle's DOM element.
269
+ *
270
+ * @param entry - The grip entry to reposition
271
+ */
272
+ AcEdGripManager.prototype.positionEntry = function (entry) {
273
+ var canvasPos = this._view.worldToScreen(entry.wcsPoint);
274
+ var containerPos = this._view.canvasToContainer(canvasPos);
275
+ entry.handle.setPosition(containerPos);
276
+ };
277
+ /**
278
+ * Repositions every active grip handle after a view transform or resize.
279
+ *
280
+ * Does not recreate entries; only updates DOM positions from stored WCS points.
281
+ */
282
+ AcEdGripManager.prototype.repositionAll = function () {
283
+ var e_2, _a;
284
+ try {
285
+ for (var _b = __values(this._entries), _c = _b.next(); !_c.done; _c = _b.next()) {
286
+ var entry = _c.value;
287
+ this.positionEntry(entry);
288
+ }
289
+ }
290
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
291
+ finally {
292
+ try {
293
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
294
+ }
295
+ finally { if (e_2) throw e_2.error; }
296
+ }
297
+ };
298
+ /**
299
+ * Destroys all grip handle DOM elements and clears the entry list.
300
+ *
301
+ * Also resets {@link _hotEntry}. Does not cancel an active edit session;
302
+ * use {@link clear} for full teardown including session cancellation.
303
+ */
304
+ AcEdGripManager.prototype.clearEntries = function () {
305
+ var e_3, _a;
306
+ try {
307
+ for (var _b = __values(this._entries), _c = _b.next(); !_c.done; _c = _b.next()) {
308
+ var entry = _c.value;
309
+ entry.handle.destroy();
310
+ }
311
+ }
312
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
313
+ finally {
314
+ try {
315
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
316
+ }
317
+ finally { if (e_3) throw e_3.error; }
318
+ }
319
+ this._entries.length = 0;
320
+ this._hotEntry = null;
321
+ };
322
+ /**
323
+ * Cancels any in-progress edit and removes all grip handles.
324
+ *
325
+ * Used by {@link dispose} and internally when a full reset is required.
326
+ */
327
+ AcEdGripManager.prototype.clear = function () {
328
+ var _a;
329
+ (_a = this._editSession) === null || _a === void 0 ? void 0 : _a.cancel();
330
+ this._editSession = null;
331
+ this.clearEntries();
332
+ };
333
+ return AcEdGripManager;
334
+ }());
335
+ export { AcEdGripManager };
336
+ //# 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,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAmBtD;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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,AArSD,IAqSC"}
@@ -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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcEdGripPolicy.js","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;;;;GAMG;AACH,SAAS,oCAAoC,CAC3C,cAAsB,EACtB,YAAoB;IAEpB,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,cAAc,GAAG,YAAY,CAAA;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAsB,EACtB,YAAqB,EACrB,iBAA0B,EAC1B,cAAsB,EACtB,YAAoB;IAEpB,IAAI,QAAQ,KAAK,YAAY,CAAC,KAAK,EAAE,CAAC;QACpC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,CAAC,oCAAoC,CAAC,cAAc,EAAE,YAAY,CAAC,CAAA;AAC5E,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { AcDbEntity, AcGePoint3dLike, AcGeVector3d } from '@mlightcad/data-model';
2
+ import { AcEdPreviewJig } from '../input/AcEdPreviewJig';
3
+ import { AcEdBaseView } from '../view/AcEdBaseView';
4
+ /**
5
+ * Preview jig that applies {@link AcDbEntity.subMoveGripPointsAt} on a clone
6
+ * while the user drags a grip handle.
7
+ */
8
+ export declare class AcEdGripPreviewJig extends AcEdPreviewJig<AcGePoint3dLike> {
9
+ private readonly _view;
10
+ private readonly _sourceClone;
11
+ private readonly _gripIndex;
12
+ private readonly _gripBaseWcs;
13
+ private _previewEntity;
14
+ constructor(view: AcEdBaseView, entity: AcDbEntity, gripIndex: number, gripBaseWcs: AcGePoint3dLike);
15
+ get entity(): AcDbEntity | null;
16
+ update(point: AcGePoint3dLike): void;
17
+ computeOffset(point: AcGePoint3dLike): AcGeVector3d;
18
+ render(): void;
19
+ end(): void;
20
+ }
21
+ //# sourceMappingURL=AcEdGripPreviewJig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcEdGripPreviewJig.d.ts","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripPreviewJig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,YAAY,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,eAAe,CAAC;IACrE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAY;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAa;IAC1C,OAAO,CAAC,cAAc,CAA0B;gBAG9C,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,eAAe;IAa9B,IAAI,MAAM,IAAI,UAAU,GAAG,IAAI,CAE9B;IAED,MAAM,CAAC,KAAK,EAAE,eAAe;IAa7B,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY;IAQ1C,MAAM,IAAI,IAAI;IAMd,GAAG,IAAI,IAAI;CAMrB"}
@@ -0,0 +1,73 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { AcGePoint3d, AcGeVector3d } from '@mlightcad/data-model';
17
+ import { AcEdPreviewJig } from '../input/AcEdPreviewJig';
18
+ /**
19
+ * Preview jig that applies {@link AcDbEntity.subMoveGripPointsAt} on a clone
20
+ * while the user drags a grip handle.
21
+ */
22
+ var AcEdGripPreviewJig = /** @class */ (function (_super) {
23
+ __extends(AcEdGripPreviewJig, _super);
24
+ function AcEdGripPreviewJig(view, entity, gripIndex, gripBaseWcs) {
25
+ var _this = _super.call(this, view) || this;
26
+ _this._previewEntity = null;
27
+ _this._view = view;
28
+ var sourceClone = entity.clone();
29
+ if (!sourceClone) {
30
+ throw new Error('Failed to clone entity for grip preview.');
31
+ }
32
+ _this._sourceClone = sourceClone;
33
+ _this._gripIndex = gripIndex;
34
+ _this._gripBaseWcs = new AcGePoint3d(gripBaseWcs);
35
+ return _this;
36
+ }
37
+ Object.defineProperty(AcEdGripPreviewJig.prototype, "entity", {
38
+ get: function () {
39
+ return this._previewEntity;
40
+ },
41
+ enumerable: false,
42
+ configurable: true
43
+ });
44
+ AcEdGripPreviewJig.prototype.update = function (point) {
45
+ if (this._previewEntity) {
46
+ this._view.removeTransientEntity(this._previewEntity.objectId);
47
+ this._previewEntity = null;
48
+ }
49
+ var preview = this._sourceClone.clone();
50
+ if (!preview)
51
+ return;
52
+ preview.subMoveGripPointsAt([this._gripIndex], this.computeOffset(point));
53
+ this._previewEntity = preview;
54
+ };
55
+ AcEdGripPreviewJig.prototype.computeOffset = function (point) {
56
+ var _a, _b;
57
+ return new AcGeVector3d(point.x - this._gripBaseWcs.x, point.y - this._gripBaseWcs.y, ((_a = point.z) !== null && _a !== void 0 ? _a : 0) - ((_b = this._gripBaseWcs.z) !== null && _b !== void 0 ? _b : 0));
58
+ };
59
+ AcEdGripPreviewJig.prototype.render = function () {
60
+ if (this._previewEntity) {
61
+ this._view.addTransientEntity(this._previewEntity);
62
+ }
63
+ };
64
+ AcEdGripPreviewJig.prototype.end = function () {
65
+ if (this._previewEntity) {
66
+ this._view.removeTransientEntity(this._previewEntity.objectId);
67
+ this._previewEntity = null;
68
+ }
69
+ };
70
+ return AcEdGripPreviewJig;
71
+ }(AcEdPreviewJig));
72
+ export { AcEdGripPreviewJig };
73
+ //# sourceMappingURL=AcEdGripPreviewJig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcEdGripPreviewJig.js","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripPreviewJig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEL,WAAW,EAEX,YAAY,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,cAAc,E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YAAY,CAAC,CAAC,EAC7B,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,EAC7B,CAAC,MAAA,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,YAAY,CAAC,CAAC,mCAAI,CAAC,CAAC,CAC5C,CAAA;IACH,CAAC;IAEQ,mCAAM,GAAf;QACE,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QACpD,CAAC;IACH,CAAC;IAEQ,gCAAG,GAAZ;QACE,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;YAC9D,IAAI,CAAC,cAAc,GAAG,IAAI,CAAA;QAC5B,CAAC;IACH,CAAC;IACH,yBAAC;AAAD,CAAC,AA7DD,CAAwC,cAAc,GA6DrD"}
@@ -0,0 +1,5 @@
1
+ export * from './AcEdGripEditSession';
2
+ export * from './AcEdGripHandle';
3
+ export * from './AcEdGripManager';
4
+ export * from './AcEdGripPreviewJig';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/grip/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './AcEdGripEditSession';
2
+ export * from './AcEdGripHandle';
3
+ export * from './AcEdGripManager';
4
+ export * from './AcEdGripPreviewJig';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/editor/grip/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export * from './command';
2
2
  export * from './global';
3
+ export * from './grip';
3
4
  export * from './input';
4
5
  export * from './view';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export * from './command';
2
2
  export * from './global';
3
+ export * from './grip';
3
4
  export * from './input';
4
5
  export * from './view';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AcEdCursorManager.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MA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OAAO,CAAC,mBAAmB;CAsB5B"}
1
+ {"version":3,"file":"AcEdCursorManager.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,oBAAY,cAAc;IACxB,+CAA+C;IAC/C,eAAe,KAAK;IACpB,mDAAmD;IACnD,SAAS,IAAI;IACb,0CAA0C;IAC1C,UAAU,IAAA;IACV,6CAA6C;IAC7C,UAAU,IAAA;IACV,yBAAyB;IACzB,UAAU,IAAA;IACV,4CAA4C;IAC5C,SAAS,IAAA;IACT,+BAA+B;IAC/B,gBAAgB,IAAA;IAChB,8CAA8C;IAC9C,iBAAiB,IAAA;IACjB,yCAAyC;IACzC,SAAS,IAAA;IACT,8BAA8B;IAC9B,YAAY,IAAA;IACZ,iDAAiD;IACjD,aAAa,IAAA;IACb,+CAA+C;IAC/C,mBAAmB,KAAA;IACnB,gDAAgD;IAChD,cAAc,KAAA;IACd,8BAA8B;IAC9B,eAAe,KAAA;IACf,mCAAmC;IACnC,IAAI,KAAA;CACL;AAED;;;;;;;;;GASG;AACH,qBAAa,iBAAiB;IAC5B,kDAAkD;IAClD,OAAO,CAAC,KAAK,CAAc;IAE3B,oDAAoD;IACpD,OAAO,CAAC,cAAc,CAAiB;IAEvC,wDAAwD;IACxD,OAAO,CAAC,UAAU,CAA6B;IAC/C,mCAAmC;IACnC,OAAO,CAAC,gBAAgB,CAAsC;IAC9D,2CAA2C;IAC3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAa;IAE1C;;;;OAIG;gBACS,IAAI,EAAE,YAAY;IAsB9B;;OAEG;IACH,IAAI,aAAa,mBAEhB;IAED;;;;OAIG;IACH,SAAS,CAAC,UAAU,EAAE,cAAc;IAepC;;OAEG;IACH,mBAAmB,CAAC,eAAe,EAAE,MAAM;IAK3C;;;;OAIG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM;IAa5B;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAIrE;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;CAsB5B"}
@@ -1,5 +1,5 @@
1
1
  import { AcDbSystemVariables, AcDbSysVarManager } from '@mlightcad/data-model';
2
- import { cursorColorForBackground, MODEL_SPACE_BACKGROUND } from '../global/AcEdUiColor';
2
+ import { ACGI_MODEL_SPACE_BACKGROUND, cursorColorForBackground } from '../global/AcEdUiColor';
3
3
  /**
4
4
  * Enumeration of cursor types available in the CAD editor.
5
5
  *
@@ -71,7 +71,7 @@ var AcEdCursorManager = /** @class */ (function () {
71
71
  function AcEdCursorManager(view) {
72
72
  var _this = this;
73
73
  /** The current background color */
74
- this._backgroundColor = MODEL_SPACE_BACKGROUND;
74
+ this._backgroundColor = ACGI_MODEL_SPACE_BACKGROUND;
75
75
  /** Total length of the cursor crosshair */
76
76
  this._totalLength = 20;
77
77
  this._view = view;
@@ -1 +1 @@
1
- {"version":3,"file":"AcEdCursorManager.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9E,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAG9B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,cA+BX;AA/BD,WAAY,cAAc;IACxB,+CAA+C;IAC/C,0EAAoB,CAAA;IACpB,mDAAmD;IACnD,6DAAa,CAAA;IACb,0CAA0C;IAC1C,+DAAU,CAAA;IACV,6CAA6C;IAC7C,+DAAU,CAAA;IACV,yBAAyB;IACzB,+DAAU,CAAA;IACV,4CAA4C;IAC5C,6DAAS,CAAA;IACT,+BAA+B;IAC/B,2EAAgB,CAAA;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iB,CAC3B,GAAG,EACH,QAAQ,GAAG,UAAU,EACrB,QAAQ,GAAG,UAAU,CACtB,CAAA;IACH,CAAC;IACH,wBAAC;AAAD,CAAC,AAjJD,IAiJC"}
1
+ {"version":3,"file":"AcEdCursorManager.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9E,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,uBAAuB,CAAA;AAG9B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,cA+BX;AA/BD,WAAY,cAAc;IACxB,+CAA+C;IAC/C,0EAAoB,CAAA;IACpB,mDAAmD;IACnD,6DAAa,CAAA;IACb,0CAA0C;IAC1C,+DAAU,CAAA;IACV,6CAA6C;IAC7C,+DAAU,CAAA;IACV,yBAAyB;IACzB,+DAAU,CAAA;IACV,4CAA4C;IAC5C,6DAAS,CAAA;IACT,+BAA+B;IAC/B,2EAAgB,CAAA;IAChB,8CAA8C;IAC9C,6EAAiB,CAAA;IACjB,yCAAyC;IACzC,6DAAS,CAAA;IACT,8BAA8B;IAC9B,mEAAY,CAAA;IACZ,iDAAiD;IACjD,qEAAa,CAAA;IACb,+CAA+C;IAC/C,kFAAmB,CAAA;IACnB,gDAAgD;IAChD,wEAAc,CAAA;IACd,8BAA8B;IAC9B,0EAAe,CAAA;IACf,mCAAmC;IACnC,oDAAI,CAAA;AACN,CAAC,EA/BW,cAAc,KAAd,cAAc,QA+BzB;AAED;;;;;;;;;GASG;AACH;IAcE;;;;OAIG;IACH,2BAAY,IAAkB;QAA9B,iBAoBC;QA9BD,mCAAmC;QAC3B,qBAAgB,GAAW,2BAA2B,CAAA;QAC9D,2CAA2C;QAC1B,iBAAY,GAAW,EAAE,CAAA;QAQxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,UA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AAA;QAC7B,IAAM,OAAO,GAAG,QAAQ,GAAG,CAAC,GAAG,UAAU,CAAA;QACzC,IAAM,GAAG,GAAG,oEACuC,OAAO,yBAAa,OAAO,8BAAkB,OAAO,cAAI,OAAO,oCACnG,UAAU,oBAAQ,UAAU,wBAAY,QAAQ,yBAAa,QAAQ,uCAAyB,SAAS,uCACtG,QAAQ,GAAG,UAAU,8BAAgB,QAAQ,GAAG,UAAU,qBAAS,UAAU,yBAAa,SAAS,uCACnG,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,CAAC,GAAG,UAAU,qBAAS,QAAQ,GAAG,UAAU,yBAAa,SAAS,uCACzI,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,CAAC,GAAG,UAAU,yBAAa,SAAS,gDAClI,QAAQ,GAAG,UAAU,qBAAS,UAAU,qBAAS,QAAQ,GAAG,UAAU,yBAAa,SAAS,8BAElH,CAAA;QACD,OAAO,IAAI,CAAC,iBAAiB,CAC3B,GAAG,EACH,QAAQ,GAAG,UAAU,EACrB,QAAQ,GAAG,UAAU,CACtB,CAAA;IACH,CAAC;IACH,wBAAC;AAAD,CAAC,AAjJD,IAiJC"}
@@ -0,0 +1,34 @@
1
+ import { AcDbOsnapMode, AcGePoint2dLike, AcGePoint3dLike } from '@mlightcad/data-model';
2
+ import { AcEdBaseView } from '../view/AcEdBaseView';
3
+ import { AcEdMarkerType } from './marker/AcEdMarker';
4
+ export type AcEdOsnapPoint = AcGePoint3dLike & {
5
+ type: AcDbOsnapMode;
6
+ };
7
+ export interface AcEdOsnapResolveOptions {
8
+ /** WCS point used as the osnap pick and proximity reference. */
9
+ cursorWcs: AcGePoint2dLike;
10
+ /** Previous point passed to entity osnap queries. */
11
+ lastPoint?: AcGePoint3dLike;
12
+ /** Screen-space pick aperture radius in pixels. */
13
+ hitRadiusPx?: number;
14
+ }
15
+ /**
16
+ * Resolves object snap points for a view during interactive input.
17
+ */
18
+ export declare class AcEdOsnapResolver {
19
+ private readonly _view;
20
+ constructor(view: AcEdBaseView);
21
+ /**
22
+ * Resolves the best osnap point near the cursor, matching command-input behavior.
23
+ */
24
+ resolve(options: AcEdOsnapResolveOptions): AcEdOsnapPoint | undefined;
25
+ /**
26
+ * Maps an osnap mode to the marker shape shown at the snap location.
27
+ */
28
+ static osnapModeToMarkerType(osnapMode: AcDbOsnapMode): AcEdMarkerType;
29
+ private static osnapModePriority;
30
+ private collectOsnapPointsByMode;
31
+ private collectOsnapPointsInAvailableModes;
32
+ private collectOsnapPoints;
33
+ }
34
+ //# sourceMappingURL=AcEdOsnapResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcEdOsnapResolver.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdOsnapResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EAEb,eAAe,EACf,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG;IAC7C,IAAI,EAAE,aAAa,CAAA;CACpB,CAAA;AAED,MAAM,WAAW,uBAAuB;IACtC,gEAAgE;IAChE,SAAS,EAAE,eAAe,CAAA;IAC1B,qDAAqD;IACrD,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAID;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;gBAExB,IAAI,EAAE,YAAY;IAI9B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,GAAG,SAAS;IAuCrE;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,aAAa,GAAG,cAAc;IAiBtE,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAehC,OAAO,CAAC,wBAAwB;IAsBhC,OAAO,CAAC,kCAAkC;IAoB1C,OAAO,CAAC,kBAAkB;CAsC3B"}