@mlightcad/cad-simple-viewer 1.5.10 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) hide show
  1. package/README.md +23 -8
  2. package/dist/cad-simple-viewer.js +35023 -70495
  3. package/dist/cad-simple-viewer.umd.cjs +143 -420
  4. package/lib/app/AcApDocManager.d.ts +50 -39
  5. package/lib/app/AcApDocManager.d.ts.map +1 -1
  6. package/lib/app/AcApDocManager.js +146 -72
  7. package/lib/app/AcApDocManager.js.map +1 -1
  8. package/lib/app/AcApSettingManager.d.ts +24 -10
  9. package/lib/app/AcApSettingManager.d.ts.map +1 -1
  10. package/lib/app/AcApSettingManager.js +49 -10
  11. package/lib/app/AcApSettingManager.js.map +1 -1
  12. package/lib/app/AcApWebworkerReadiness.d.ts +7 -2
  13. package/lib/app/AcApWebworkerReadiness.d.ts.map +1 -1
  14. package/lib/app/AcApWebworkerReadiness.js +13 -8
  15. package/lib/app/AcApWebworkerReadiness.js.map +1 -1
  16. package/lib/app/AcApWorkerAssets.d.ts +14 -1
  17. package/lib/app/AcApWorkerAssets.d.ts.map +1 -1
  18. package/lib/app/AcApWorkerAssets.js +14 -1
  19. package/lib/app/AcApWorkerAssets.js.map +1 -1
  20. package/lib/app/index.d.ts +0 -1
  21. package/lib/app/index.d.ts.map +1 -1
  22. package/lib/app/index.js +0 -1
  23. package/lib/app/index.js.map +1 -1
  24. package/lib/command/AcApRedoCmd.d.ts +1 -1
  25. package/lib/command/AcApRedoCmd.d.ts.map +1 -1
  26. package/lib/command/AcApRedoCmd.js +9 -4
  27. package/lib/command/AcApRedoCmd.js.map +1 -1
  28. package/lib/command/AcApUndoCmd.d.ts +1 -1
  29. package/lib/command/AcApUndoCmd.d.ts.map +1 -1
  30. package/lib/command/AcApUndoCmd.js +9 -4
  31. package/lib/command/AcApUndoCmd.js.map +1 -1
  32. package/lib/command/convert/AcApConvertToPngCmd.d.ts.map +1 -1
  33. package/lib/command/convert/AcApConvertToPngCmd.js +5 -1
  34. package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -1
  35. package/lib/command/convert/AcApPngConvertor.d.ts +4 -1
  36. package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -1
  37. package/lib/command/convert/AcApPngConvertor.js +131 -78
  38. package/lib/command/convert/AcApPngConvertor.js.map +1 -1
  39. package/lib/command/draw/AcApRevCloudCmd.d.ts +48 -0
  40. package/lib/command/draw/AcApRevCloudCmd.d.ts.map +1 -0
  41. package/lib/command/draw/AcApRevCloudCmd.js +747 -0
  42. package/lib/command/draw/AcApRevCloudCmd.js.map +1 -0
  43. package/lib/command/draw/AcApRevCloudGeom.d.ts +57 -0
  44. package/lib/command/draw/AcApRevCloudGeom.d.ts.map +1 -0
  45. package/lib/command/draw/AcApRevCloudGeom.js +373 -0
  46. package/lib/command/draw/AcApRevCloudGeom.js.map +1 -0
  47. package/lib/command/draw/AcApSketchCmd.d.ts +59 -0
  48. package/lib/command/draw/AcApSketchCmd.d.ts.map +1 -0
  49. package/lib/command/draw/AcApSketchCmd.js +537 -0
  50. package/lib/command/draw/AcApSketchCmd.js.map +1 -0
  51. package/lib/command/draw/index.d.ts +3 -0
  52. package/lib/command/draw/index.d.ts.map +1 -1
  53. package/lib/command/draw/index.js +3 -0
  54. package/lib/command/draw/index.js.map +1 -1
  55. package/lib/command/index.d.ts +2 -1
  56. package/lib/command/index.d.ts.map +1 -1
  57. package/lib/command/index.js +2 -1
  58. package/lib/command/index.js.map +1 -1
  59. package/lib/command/markup/AcApClearMarkupsCmd.d.ts +10 -0
  60. package/lib/command/markup/AcApClearMarkupsCmd.d.ts.map +1 -0
  61. package/lib/command/{review/AcApRevCircleCmd.js → markup/AcApClearMarkupsCmd.js} +19 -49
  62. package/lib/command/markup/AcApClearMarkupsCmd.js.map +1 -0
  63. package/lib/command/markup/AcApMarkupArrowCmd.d.ts +10 -0
  64. package/lib/command/markup/AcApMarkupArrowCmd.d.ts.map +1 -0
  65. package/lib/command/markup/AcApMarkupArrowCmd.js +164 -0
  66. package/lib/command/markup/AcApMarkupArrowCmd.js.map +1 -0
  67. package/lib/command/markup/AcApMarkupCalloutCmd.d.ts +17 -0
  68. package/lib/command/markup/AcApMarkupCalloutCmd.d.ts.map +1 -0
  69. package/lib/command/markup/AcApMarkupCalloutCmd.js +259 -0
  70. package/lib/command/markup/AcApMarkupCalloutCmd.js.map +1 -0
  71. package/lib/command/markup/AcApMarkupCalloutDrag.d.ts +78 -0
  72. package/lib/command/markup/AcApMarkupCalloutDrag.d.ts.map +1 -0
  73. package/lib/command/markup/AcApMarkupCalloutDrag.js +78 -0
  74. package/lib/command/markup/AcApMarkupCalloutDrag.js.map +1 -0
  75. package/lib/command/markup/AcApMarkupCircleCmd.d.ts +10 -0
  76. package/lib/command/markup/AcApMarkupCircleCmd.d.ts.map +1 -0
  77. package/lib/command/markup/AcApMarkupCircleCmd.js +174 -0
  78. package/lib/command/markup/AcApMarkupCircleCmd.js.map +1 -0
  79. package/lib/command/markup/AcApMarkupCloudCmd.d.ts +11 -0
  80. package/lib/command/markup/AcApMarkupCloudCmd.d.ts.map +1 -0
  81. package/lib/command/markup/AcApMarkupCloudCmd.js +178 -0
  82. package/lib/command/markup/AcApMarkupCloudCmd.js.map +1 -0
  83. package/lib/command/markup/AcApMarkupCmdUtil.d.ts +43 -0
  84. package/lib/command/markup/AcApMarkupCmdUtil.d.ts.map +1 -0
  85. package/lib/command/markup/AcApMarkupCmdUtil.js +133 -0
  86. package/lib/command/markup/AcApMarkupCmdUtil.js.map +1 -0
  87. package/lib/command/markup/AcApMarkupGeometry.d.ts +57 -0
  88. package/lib/command/markup/AcApMarkupGeometry.d.ts.map +1 -0
  89. package/lib/command/markup/AcApMarkupGeometry.js +231 -0
  90. package/lib/command/markup/AcApMarkupGeometry.js.map +1 -0
  91. package/lib/command/markup/AcApMarkupHighlightCmd.d.ts +10 -0
  92. package/lib/command/markup/AcApMarkupHighlightCmd.d.ts.map +1 -0
  93. package/lib/command/markup/AcApMarkupHighlightCmd.js +166 -0
  94. package/lib/command/markup/AcApMarkupHighlightCmd.js.map +1 -0
  95. package/lib/command/markup/AcApMarkupHistory.d.ts +139 -0
  96. package/lib/command/markup/AcApMarkupHistory.d.ts.map +1 -0
  97. package/lib/command/markup/AcApMarkupHistory.js +336 -0
  98. package/lib/command/markup/AcApMarkupHistory.js.map +1 -0
  99. package/lib/command/markup/AcApMarkupImportExportCmd.d.ts +17 -0
  100. package/lib/command/markup/AcApMarkupImportExportCmd.d.ts.map +1 -0
  101. package/lib/command/markup/AcApMarkupImportExportCmd.js +182 -0
  102. package/lib/command/markup/AcApMarkupImportExportCmd.js.map +1 -0
  103. package/lib/command/markup/AcApMarkupLineCmd.d.ts +10 -0
  104. package/lib/command/markup/AcApMarkupLineCmd.d.ts.map +1 -0
  105. package/lib/command/markup/AcApMarkupLineCmd.js +185 -0
  106. package/lib/command/markup/AcApMarkupLineCmd.js.map +1 -0
  107. package/lib/command/markup/AcApMarkupPresenter.d.ts +62 -0
  108. package/lib/command/markup/AcApMarkupPresenter.d.ts.map +1 -0
  109. package/lib/command/markup/AcApMarkupPresenter.js +288 -0
  110. package/lib/command/markup/AcApMarkupPresenter.js.map +1 -0
  111. package/lib/command/markup/AcApMarkupRectCmd.d.ts +10 -0
  112. package/lib/command/markup/AcApMarkupRectCmd.d.ts.map +1 -0
  113. package/lib/command/markup/AcApMarkupRectCmd.js +174 -0
  114. package/lib/command/markup/AcApMarkupRectCmd.js.map +1 -0
  115. package/lib/command/markup/AcApMarkupRepublish.d.ts +29 -0
  116. package/lib/command/markup/AcApMarkupRepublish.d.ts.map +1 -0
  117. package/lib/command/markup/AcApMarkupRepublish.js +28 -0
  118. package/lib/command/markup/AcApMarkupRepublish.js.map +1 -0
  119. package/lib/command/markup/AcApMarkupShapeBuilder.d.ts +88 -0
  120. package/lib/command/markup/AcApMarkupShapeBuilder.d.ts.map +1 -0
  121. package/lib/command/markup/AcApMarkupShapeBuilder.js +246 -0
  122. package/lib/command/markup/AcApMarkupShapeBuilder.js.map +1 -0
  123. package/lib/command/markup/AcApMarkupShapeCallout.d.ts +46 -0
  124. package/lib/command/markup/AcApMarkupShapeCallout.d.ts.map +1 -0
  125. package/lib/command/markup/AcApMarkupShapeCallout.js +356 -0
  126. package/lib/command/markup/AcApMarkupShapeCallout.js.map +1 -0
  127. package/lib/command/markup/AcApMarkupSidecar.d.ts +14 -0
  128. package/lib/command/markup/AcApMarkupSidecar.d.ts.map +1 -0
  129. package/lib/command/markup/AcApMarkupSidecar.js +196 -0
  130. package/lib/command/markup/AcApMarkupSidecar.js.map +1 -0
  131. package/lib/command/markup/AcApMarkupStampCmd.d.ts +10 -0
  132. package/lib/command/markup/AcApMarkupStampCmd.d.ts.map +1 -0
  133. package/lib/command/markup/AcApMarkupStampCmd.js +158 -0
  134. package/lib/command/markup/AcApMarkupStampCmd.js.map +1 -0
  135. package/lib/command/markup/AcApMarkupStore.d.ts +94 -0
  136. package/lib/command/markup/AcApMarkupStore.d.ts.map +1 -0
  137. package/lib/command/markup/AcApMarkupStore.js +327 -0
  138. package/lib/command/markup/AcApMarkupStore.js.map +1 -0
  139. package/lib/command/markup/AcApMarkupTextCmd.d.ts +10 -0
  140. package/lib/command/markup/AcApMarkupTextCmd.d.ts.map +1 -0
  141. package/lib/command/markup/AcApMarkupTextCmd.js +141 -0
  142. package/lib/command/markup/AcApMarkupTextCmd.js.map +1 -0
  143. package/lib/command/markup/AcApMarkupTextEdit.d.ts +88 -0
  144. package/lib/command/markup/AcApMarkupTextEdit.d.ts.map +1 -0
  145. package/lib/command/markup/AcApMarkupTextEdit.js +249 -0
  146. package/lib/command/markup/AcApMarkupTextEdit.js.map +1 -0
  147. package/lib/command/markup/AcApMarkupTypes.d.ts +118 -0
  148. package/lib/command/markup/AcApMarkupTypes.d.ts.map +1 -0
  149. package/lib/command/markup/AcApMarkupTypes.js +8 -0
  150. package/lib/command/markup/AcApMarkupTypes.js.map +1 -0
  151. package/lib/command/markup/AcApMarkupUtil.d.ts +41 -0
  152. package/lib/command/markup/AcApMarkupUtil.d.ts.map +1 -0
  153. package/lib/command/markup/AcApMarkupUtil.js +135 -0
  154. package/lib/command/markup/AcApMarkupUtil.js.map +1 -0
  155. package/lib/command/markup/AcApMarkupVisibilityCmd.d.ts +17 -0
  156. package/lib/command/markup/AcApMarkupVisibilityCmd.d.ts.map +1 -0
  157. package/lib/command/{review/AcApRevVisibilityCmd.js → markup/AcApMarkupVisibilityCmd.js} +30 -27
  158. package/lib/command/markup/AcApMarkupVisibilityCmd.js.map +1 -0
  159. package/lib/command/markup/entity/AcApMarkupCalloutEntity.d.ts +48 -0
  160. package/lib/command/markup/entity/AcApMarkupCalloutEntity.d.ts.map +1 -0
  161. package/lib/command/markup/entity/AcApMarkupCalloutEntity.js +291 -0
  162. package/lib/command/markup/entity/AcApMarkupCalloutEntity.js.map +1 -0
  163. package/lib/command/markup/entity/AcApMarkupEntity.d.ts +131 -0
  164. package/lib/command/markup/entity/AcApMarkupEntity.d.ts.map +1 -0
  165. package/lib/command/markup/entity/AcApMarkupEntity.js +191 -0
  166. package/lib/command/markup/entity/AcApMarkupEntity.js.map +1 -0
  167. package/lib/command/markup/entity/AcApMarkupEntityFactory.d.ts +20 -0
  168. package/lib/command/markup/entity/AcApMarkupEntityFactory.d.ts.map +1 -0
  169. package/lib/command/markup/entity/AcApMarkupEntityFactory.js +43 -0
  170. package/lib/command/markup/entity/AcApMarkupEntityFactory.js.map +1 -0
  171. package/lib/command/markup/entity/AcApMarkupEntityGrips.d.ts +94 -0
  172. package/lib/command/markup/entity/AcApMarkupEntityGrips.d.ts.map +1 -0
  173. package/lib/command/markup/entity/AcApMarkupEntityGrips.js +204 -0
  174. package/lib/command/markup/entity/AcApMarkupEntityGrips.js.map +1 -0
  175. package/lib/command/markup/entity/AcApMarkupHighlightEntity.d.ts +27 -0
  176. package/lib/command/markup/entity/AcApMarkupHighlightEntity.d.ts.map +1 -0
  177. package/lib/command/markup/entity/AcApMarkupHighlightEntity.js +124 -0
  178. package/lib/command/markup/entity/AcApMarkupHighlightEntity.js.map +1 -0
  179. package/lib/command/markup/entity/AcApMarkupSegmentEntity.d.ts +40 -0
  180. package/lib/command/markup/entity/AcApMarkupSegmentEntity.d.ts.map +1 -0
  181. package/lib/command/markup/entity/AcApMarkupSegmentEntity.js +294 -0
  182. package/lib/command/markup/entity/AcApMarkupSegmentEntity.js.map +1 -0
  183. package/lib/command/markup/entity/AcApMarkupShapeEntity.d.ts +32 -0
  184. package/lib/command/markup/entity/AcApMarkupShapeEntity.d.ts.map +1 -0
  185. package/lib/command/markup/entity/AcApMarkupShapeEntity.js +241 -0
  186. package/lib/command/markup/entity/AcApMarkupShapeEntity.js.map +1 -0
  187. package/lib/command/markup/entity/AcApMarkupStampEntity.d.ts +23 -0
  188. package/lib/command/markup/entity/AcApMarkupStampEntity.d.ts.map +1 -0
  189. package/lib/command/markup/entity/AcApMarkupStampEntity.js +125 -0
  190. package/lib/command/markup/entity/AcApMarkupStampEntity.js.map +1 -0
  191. package/lib/command/markup/entity/AcApMarkupTextEntity.d.ts +23 -0
  192. package/lib/command/markup/entity/AcApMarkupTextEntity.d.ts.map +1 -0
  193. package/lib/command/markup/entity/AcApMarkupTextEntity.js +129 -0
  194. package/lib/command/markup/entity/AcApMarkupTextEntity.js.map +1 -0
  195. package/lib/command/markup/entity/index.d.ts +13 -0
  196. package/lib/command/markup/entity/index.d.ts.map +1 -0
  197. package/lib/command/markup/entity/index.js +13 -0
  198. package/lib/command/markup/entity/index.js.map +1 -0
  199. package/lib/command/markup/index.d.ts +27 -0
  200. package/lib/command/markup/index.d.ts.map +1 -0
  201. package/lib/command/markup/index.js +27 -0
  202. package/lib/command/markup/index.js.map +1 -0
  203. package/lib/command/measure/AcApClearMeasurementsCmd.d.ts +5 -12
  204. package/lib/command/measure/AcApClearMeasurementsCmd.d.ts.map +1 -1
  205. package/lib/command/measure/AcApClearMeasurementsCmd.js +42 -20
  206. package/lib/command/measure/AcApClearMeasurementsCmd.js.map +1 -1
  207. package/lib/command/measure/AcApMeasureAngleCmd.d.ts +13 -3
  208. package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -1
  209. package/lib/command/measure/AcApMeasureAngleCmd.js +76 -210
  210. package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -1
  211. package/lib/command/measure/AcApMeasureArcCmd.d.ts +21 -1
  212. package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
  213. package/lib/command/measure/AcApMeasureArcCmd.js +103 -97
  214. package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
  215. package/lib/command/measure/AcApMeasureAreaCmd.d.ts +11 -1
  216. package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -1
  217. package/lib/command/measure/AcApMeasureAreaCmd.js +126 -144
  218. package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -1
  219. package/lib/command/measure/AcApMeasureDistanceCmd.d.ts +24 -15
  220. package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -1
  221. package/lib/command/measure/AcApMeasureDistanceCmd.js +52 -52
  222. package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -1
  223. package/lib/command/measure/AcApMeasurePointCmd.d.ts +24 -0
  224. package/lib/command/measure/AcApMeasurePointCmd.d.ts.map +1 -0
  225. package/lib/command/measure/AcApMeasurePointCmd.js +114 -0
  226. package/lib/command/measure/AcApMeasurePointCmd.js.map +1 -0
  227. package/lib/command/measure/AcApMeasurementGeometry.d.ts +22 -0
  228. package/lib/command/measure/AcApMeasurementGeometry.d.ts.map +1 -0
  229. package/lib/command/measure/AcApMeasurementGeometry.js +127 -0
  230. package/lib/command/measure/AcApMeasurementGeometry.js.map +1 -0
  231. package/lib/command/measure/AcApMeasurementHistory.d.ts +78 -0
  232. package/lib/command/measure/AcApMeasurementHistory.d.ts.map +1 -0
  233. package/lib/command/measure/AcApMeasurementHistory.js +387 -0
  234. package/lib/command/measure/AcApMeasurementHistory.js.map +1 -0
  235. package/lib/command/measure/AcApMeasurementImportExportCmd.d.ts +17 -0
  236. package/lib/command/measure/AcApMeasurementImportExportCmd.d.ts.map +1 -0
  237. package/lib/command/measure/AcApMeasurementImportExportCmd.js +207 -0
  238. package/lib/command/measure/AcApMeasurementImportExportCmd.js.map +1 -0
  239. package/lib/command/measure/AcApMeasurementPlace.d.ts +9 -0
  240. package/lib/command/measure/AcApMeasurementPlace.d.ts.map +1 -0
  241. package/lib/command/measure/AcApMeasurementPlace.js +33 -0
  242. package/lib/command/measure/AcApMeasurementPlace.js.map +1 -0
  243. package/lib/command/measure/AcApMeasurementSidecar.d.ts +19 -0
  244. package/lib/command/measure/AcApMeasurementSidecar.d.ts.map +1 -0
  245. package/lib/command/measure/AcApMeasurementSidecar.js +173 -0
  246. package/lib/command/measure/AcApMeasurementSidecar.js.map +1 -0
  247. package/lib/command/measure/AcApMeasurementStore.d.ts +90 -0
  248. package/lib/command/measure/AcApMeasurementStore.d.ts.map +1 -0
  249. package/lib/command/measure/AcApMeasurementStore.js +364 -0
  250. package/lib/command/measure/AcApMeasurementStore.js.map +1 -0
  251. package/lib/command/measure/AcApMeasurementTypes.d.ts +56 -0
  252. package/lib/command/measure/AcApMeasurementTypes.d.ts.map +1 -0
  253. package/lib/command/measure/AcApMeasurementTypes.js +2 -0
  254. package/lib/command/measure/AcApMeasurementTypes.js.map +1 -0
  255. package/lib/command/measure/AcApMeasurementVisibilityCmd.d.ts +10 -0
  256. package/lib/command/measure/AcApMeasurementVisibilityCmd.d.ts.map +1 -0
  257. package/lib/command/measure/AcApMeasurementVisibilityCmd.js +78 -0
  258. package/lib/command/measure/AcApMeasurementVisibilityCmd.js.map +1 -0
  259. package/lib/command/measure/entity/AcApMeasureAngleEntity.d.ts +68 -0
  260. package/lib/command/measure/entity/AcApMeasureAngleEntity.d.ts.map +1 -0
  261. package/lib/command/measure/entity/AcApMeasureAngleEntity.js +188 -0
  262. package/lib/command/measure/entity/AcApMeasureAngleEntity.js.map +1 -0
  263. package/lib/command/measure/entity/AcApMeasureArcEntity.d.ts +85 -0
  264. package/lib/command/measure/entity/AcApMeasureArcEntity.d.ts.map +1 -0
  265. package/lib/command/measure/entity/AcApMeasureArcEntity.js +159 -0
  266. package/lib/command/measure/entity/AcApMeasureArcEntity.js.map +1 -0
  267. package/lib/command/measure/entity/AcApMeasureAreaEntity.d.ts +60 -0
  268. package/lib/command/measure/entity/AcApMeasureAreaEntity.d.ts.map +1 -0
  269. package/lib/command/measure/entity/AcApMeasureAreaEntity.js +184 -0
  270. package/lib/command/measure/entity/AcApMeasureAreaEntity.js.map +1 -0
  271. package/lib/command/measure/entity/AcApMeasureDistanceEntity.d.ts +60 -0
  272. package/lib/command/measure/entity/AcApMeasureDistanceEntity.d.ts.map +1 -0
  273. package/lib/command/measure/entity/AcApMeasureDistanceEntity.js +166 -0
  274. package/lib/command/measure/entity/AcApMeasureDistanceEntity.js.map +1 -0
  275. package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts +129 -0
  276. package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts.map +1 -0
  277. package/lib/command/measure/entity/AcApMeasureDrawUtil.js +257 -0
  278. package/lib/command/measure/entity/AcApMeasureDrawUtil.js.map +1 -0
  279. package/lib/command/measure/entity/AcApMeasureEntity.d.ts +148 -0
  280. package/lib/command/measure/entity/AcApMeasureEntity.d.ts.map +1 -0
  281. package/lib/command/measure/entity/AcApMeasureEntity.js +141 -0
  282. package/lib/command/measure/entity/AcApMeasureEntity.js.map +1 -0
  283. package/lib/command/measure/entity/AcApMeasureEntityFactory.d.ts +15 -0
  284. package/lib/command/measure/entity/AcApMeasureEntityFactory.d.ts.map +1 -0
  285. package/lib/command/measure/entity/AcApMeasureEntityFactory.js +35 -0
  286. package/lib/command/measure/entity/AcApMeasureEntityFactory.js.map +1 -0
  287. package/lib/command/measure/entity/AcApMeasurePointEntity.d.ts +56 -0
  288. package/lib/command/measure/entity/AcApMeasurePointEntity.d.ts.map +1 -0
  289. package/lib/command/measure/entity/AcApMeasurePointEntity.js +125 -0
  290. package/lib/command/measure/entity/AcApMeasurePointEntity.js.map +1 -0
  291. package/lib/command/measure/entity/index.d.ts +12 -0
  292. package/lib/command/measure/entity/index.d.ts.map +1 -0
  293. package/lib/command/measure/entity/index.js +12 -0
  294. package/lib/command/measure/entity/index.js.map +1 -0
  295. package/lib/command/measure/index.d.ts +10 -0
  296. package/lib/command/measure/index.d.ts.map +1 -1
  297. package/lib/command/measure/index.js +10 -0
  298. package/lib/command/measure/index.js.map +1 -1
  299. package/lib/command/modify/AcApCopyCmd.d.ts +1 -1
  300. package/lib/command/modify/AcApCopyCmd.js +2 -2
  301. package/lib/command/modify/AcApCopyCmd.js.map +1 -1
  302. package/lib/command/modify/AcApMoveCmd.js +1 -1
  303. package/lib/command/modify/AcApMoveCmd.js.map +1 -1
  304. package/lib/command/modify/AcApOffsetCmd.d.ts +1 -1
  305. package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
  306. package/lib/command/modify/AcApOffsetCmd.js +5 -10
  307. package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
  308. package/lib/command/modify/AcApRotateCmd.d.ts +1 -1
  309. package/lib/command/modify/AcApRotateCmd.js +2 -2
  310. package/lib/command/modify/AcApRotateCmd.js.map +1 -1
  311. package/lib/command/overlay/AcApHtmlLivePreview.d.ts +121 -0
  312. package/lib/command/overlay/AcApHtmlLivePreview.d.ts.map +1 -0
  313. package/lib/command/overlay/AcApHtmlLivePreview.js +193 -0
  314. package/lib/command/overlay/AcApHtmlLivePreview.js.map +1 -0
  315. package/lib/command/overlay/AcApOverlayDrawUtil.d.ts +63 -0
  316. package/lib/command/overlay/AcApOverlayDrawUtil.d.ts.map +1 -0
  317. package/lib/command/overlay/AcApOverlayDrawUtil.js +115 -0
  318. package/lib/command/overlay/AcApOverlayDrawUtil.js.map +1 -0
  319. package/lib/command/overlay/AcApOverlayEntity.d.ts +93 -0
  320. package/lib/command/overlay/AcApOverlayEntity.d.ts.map +1 -0
  321. package/lib/command/overlay/AcApOverlayEntity.js +65 -0
  322. package/lib/command/overlay/AcApOverlayEntity.js.map +1 -0
  323. package/lib/command/overlay/AcApOverlayGripHost.d.ts +105 -0
  324. package/lib/command/overlay/AcApOverlayGripHost.d.ts.map +1 -0
  325. package/lib/command/overlay/AcApOverlayGripHost.js +207 -0
  326. package/lib/command/overlay/AcApOverlayGripHost.js.map +1 -0
  327. package/lib/command/overlay/AcApOverlaySerializable.d.ts +20 -0
  328. package/lib/command/overlay/AcApOverlaySerializable.d.ts.map +1 -0
  329. package/lib/command/overlay/AcApOverlaySerializable.js +2 -0
  330. package/lib/command/overlay/AcApOverlaySerializable.js.map +1 -0
  331. package/lib/command/overlay/index.d.ts +13 -0
  332. package/lib/command/overlay/index.d.ts.map +1 -0
  333. package/lib/command/overlay/index.js +13 -0
  334. package/lib/command/overlay/index.js.map +1 -0
  335. package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
  336. package/lib/editor/command/AcEdCommand.js +1 -0
  337. package/lib/editor/command/AcEdCommand.js.map +1 -1
  338. package/lib/editor/global/AcEdUiLayout.d.ts +3 -3
  339. package/lib/editor/global/AcEdUiLayout.d.ts.map +1 -1
  340. package/lib/editor/global/AcEdUiLayout.js +3 -3
  341. package/lib/editor/global/AcEdUiLayout.js.map +1 -1
  342. package/lib/editor/global/AcEdUiTheme.d.ts +1 -1
  343. package/lib/editor/global/AcEdUiTheme.d.ts.map +1 -1
  344. package/lib/editor/global/AcEdUiTheme.js +1 -1
  345. package/lib/editor/global/AcEdUiTheme.js.map +1 -1
  346. package/lib/editor/global/eventBus.d.ts +5 -0
  347. package/lib/editor/global/eventBus.d.ts.map +1 -1
  348. package/lib/editor/global/eventBus.js.map +1 -1
  349. package/lib/editor/input/AcEditor.d.ts +6 -0
  350. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  351. package/lib/editor/input/AcEditor.js +10 -0
  352. package/lib/editor/input/AcEditor.js.map +1 -1
  353. package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts +7 -0
  354. package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts.map +1 -1
  355. package/lib/editor/input/prompt/AcEdPromptBoxOptions.js +17 -0
  356. package/lib/editor/input/prompt/AcEdPromptBoxOptions.js.map +1 -1
  357. package/lib/editor/input/ui/AcEdInputManager.d.ts +9 -0
  358. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  359. package/lib/editor/input/ui/AcEdInputManager.js +17 -0
  360. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  361. package/lib/editor/input/ui/AcEdMTextEditor.js +3 -3
  362. package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
  363. package/lib/i18n/cs/command.d.ts +60 -0
  364. package/lib/i18n/cs/command.d.ts.map +1 -1
  365. package/lib/i18n/cs/command.js +63 -3
  366. package/lib/i18n/cs/command.js.map +1 -1
  367. package/lib/i18n/cs/jig.d.ts +1227 -1
  368. package/lib/i18n/cs/jig.d.ts.map +1 -1
  369. package/lib/i18n/cs/jig.js +1226 -6
  370. package/lib/i18n/cs/jig.js.map +1 -1
  371. package/lib/i18n/cs/main.d.ts +5 -0
  372. package/lib/i18n/cs/main.d.ts.map +1 -1
  373. package/lib/i18n/cs/main.js +5 -0
  374. package/lib/i18n/cs/main.js.map +1 -1
  375. package/lib/i18n/en/command.d.ts +57 -0
  376. package/lib/i18n/en/command.d.ts.map +1 -1
  377. package/lib/i18n/en/command.js +60 -3
  378. package/lib/i18n/en/command.js.map +1 -1
  379. package/lib/i18n/en/jig.d.ts +180 -0
  380. package/lib/i18n/en/jig.d.ts.map +1 -1
  381. package/lib/i18n/en/jig.js +181 -1
  382. package/lib/i18n/en/jig.js.map +1 -1
  383. package/lib/i18n/en/main.d.ts +5 -0
  384. package/lib/i18n/en/main.d.ts.map +1 -1
  385. package/lib/i18n/en/main.js +5 -0
  386. package/lib/i18n/en/main.js.map +1 -1
  387. package/lib/i18n/tr/command.d.ts +57 -0
  388. package/lib/i18n/tr/command.d.ts.map +1 -1
  389. package/lib/i18n/tr/command.js +60 -3
  390. package/lib/i18n/tr/command.js.map +1 -1
  391. package/lib/i18n/tr/jig.d.ts +180 -0
  392. package/lib/i18n/tr/jig.d.ts.map +1 -1
  393. package/lib/i18n/tr/jig.js +181 -1
  394. package/lib/i18n/tr/jig.js.map +1 -1
  395. package/lib/i18n/tr/main.d.ts +7 -0
  396. package/lib/i18n/tr/main.d.ts.map +1 -1
  397. package/lib/i18n/tr/main.js +7 -0
  398. package/lib/i18n/tr/main.js.map +1 -1
  399. package/lib/i18n/zh/command.d.ts +57 -0
  400. package/lib/i18n/zh/command.d.ts.map +1 -1
  401. package/lib/i18n/zh/command.js +60 -3
  402. package/lib/i18n/zh/command.js.map +1 -1
  403. package/lib/i18n/zh/jig.d.ts +180 -0
  404. package/lib/i18n/zh/jig.d.ts.map +1 -1
  405. package/lib/i18n/zh/jig.js +181 -1
  406. package/lib/i18n/zh/jig.js.map +1 -1
  407. package/lib/i18n/zh/main.d.ts +5 -0
  408. package/lib/i18n/zh/main.d.ts.map +1 -1
  409. package/lib/i18n/zh/main.js +5 -0
  410. package/lib/i18n/zh/main.js.map +1 -1
  411. package/lib/plugin/AcApPluginManager.d.ts.map +1 -1
  412. package/lib/plugin/AcApPluginManager.js +2 -1
  413. package/lib/plugin/AcApPluginManager.js.map +1 -1
  414. package/lib/service/AcApEntitySelection.d.ts +0 -3
  415. package/lib/service/AcApEntitySelection.d.ts.map +1 -1
  416. package/lib/service/AcApEntitySelection.js +42 -36
  417. package/lib/service/AcApEntitySelection.js.map +1 -1
  418. package/lib/ui/AcApDrawStyle.d.ts +63 -0
  419. package/lib/ui/AcApDrawStyle.d.ts.map +1 -0
  420. package/lib/ui/AcApDrawStyle.js +149 -0
  421. package/lib/ui/AcApDrawStyle.js.map +1 -0
  422. package/lib/ui/AcApDrawStyleToolbar.d.ts +124 -0
  423. package/lib/ui/AcApDrawStyleToolbar.d.ts.map +1 -0
  424. package/lib/ui/AcApDrawStyleToolbar.js +486 -0
  425. package/lib/ui/AcApDrawStyleToolbar.js.map +1 -0
  426. package/lib/ui/AcUiDialog.d.ts.map +1 -1
  427. package/lib/ui/AcUiDialog.js +2 -2
  428. package/lib/ui/AcUiDialog.js.map +1 -1
  429. package/lib/ui/index.d.ts +2 -0
  430. package/lib/ui/index.d.ts.map +1 -1
  431. package/lib/ui/index.js +2 -0
  432. package/lib/ui/index.js.map +1 -1
  433. package/lib/util/AcApDatabaseEdit.d.ts.map +1 -1
  434. package/lib/util/AcApDatabaseEdit.js +1 -0
  435. package/lib/util/AcApDatabaseEdit.js.map +1 -1
  436. package/lib/util/AcApMeasurementUnits.d.ts +52 -0
  437. package/lib/util/AcApMeasurementUnits.d.ts.map +1 -0
  438. package/lib/util/AcApMeasurementUnits.js +137 -0
  439. package/lib/util/AcApMeasurementUnits.js.map +1 -0
  440. package/lib/util/AcApMeasurementUtil.d.ts +42 -0
  441. package/lib/util/AcApMeasurementUtil.d.ts.map +1 -0
  442. package/lib/util/AcApMeasurementUtil.js +98 -0
  443. package/lib/util/AcApMeasurementUtil.js.map +1 -0
  444. package/lib/util/AcApScreenHitTest.d.ts +35 -0
  445. package/lib/util/AcApScreenHitTest.d.ts.map +1 -0
  446. package/lib/util/AcApScreenHitTest.js +98 -0
  447. package/lib/util/AcApScreenHitTest.js.map +1 -0
  448. package/lib/util/AcApScriptParser.d.ts +13 -0
  449. package/lib/util/AcApScriptParser.d.ts.map +1 -0
  450. package/lib/util/AcApScriptParser.js +55 -0
  451. package/lib/util/AcApScriptParser.js.map +1 -0
  452. package/lib/util/index.d.ts +4 -1
  453. package/lib/util/index.d.ts.map +1 -1
  454. package/lib/util/index.js +4 -1
  455. package/lib/util/index.js.map +1 -1
  456. package/lib/view/AcEdReviewOverlayPick.d.ts +25 -0
  457. package/lib/view/AcEdReviewOverlayPick.d.ts.map +1 -0
  458. package/lib/view/AcEdReviewOverlayPick.js +229 -0
  459. package/lib/view/AcEdReviewOverlayPick.js.map +1 -0
  460. package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -1
  461. package/lib/view/AcEdViewKeyHandler.js +53 -0
  462. package/lib/view/AcEdViewKeyHandler.js.map +1 -1
  463. package/lib/view/AcTrScene.d.ts +15 -1
  464. package/lib/view/AcTrScene.d.ts.map +1 -1
  465. package/lib/view/AcTrScene.js +25 -2
  466. package/lib/view/AcTrScene.js.map +1 -1
  467. package/lib/view/AcTrView2d.d.ts +46 -5
  468. package/lib/view/AcTrView2d.d.ts.map +1 -1
  469. package/lib/view/AcTrView2d.js +179 -74
  470. package/lib/view/AcTrView2d.js.map +1 -1
  471. package/lib/view/index.d.ts +1 -0
  472. package/lib/view/index.d.ts.map +1 -1
  473. package/lib/view/index.js +1 -0
  474. package/lib/view/index.js.map +1 -1
  475. package/package.json +7 -6
  476. package/dist/libredwg-parser-worker.js +0 -7525
  477. package/lib/app/AcApAnnotation.d.ts +0 -47
  478. package/lib/app/AcApAnnotation.d.ts.map +0 -1
  479. package/lib/app/AcApAnnotation.js +0 -135
  480. package/lib/app/AcApAnnotation.js.map +0 -1
  481. package/lib/command/review/AcApBaseRevCmd.d.ts +0 -36
  482. package/lib/command/review/AcApBaseRevCmd.d.ts.map +0 -1
  483. package/lib/command/review/AcApBaseRevCmd.js +0 -68
  484. package/lib/command/review/AcApBaseRevCmd.js.map +0 -1
  485. package/lib/command/review/AcApRevCircleCmd.d.ts +0 -18
  486. package/lib/command/review/AcApRevCircleCmd.d.ts.map +0 -1
  487. package/lib/command/review/AcApRevCircleCmd.js.map +0 -1
  488. package/lib/command/review/AcApRevCloudCmd.d.ts +0 -26
  489. package/lib/command/review/AcApRevCloudCmd.d.ts.map +0 -1
  490. package/lib/command/review/AcApRevCloudCmd.js +0 -240
  491. package/lib/command/review/AcApRevCloudCmd.js.map +0 -1
  492. package/lib/command/review/AcApRevRectCmd.d.ts +0 -18
  493. package/lib/command/review/AcApRevRectCmd.d.ts.map +0 -1
  494. package/lib/command/review/AcApRevRectCmd.js +0 -155
  495. package/lib/command/review/AcApRevRectCmd.js.map +0 -1
  496. package/lib/command/review/AcApRevVisibilityCmd.d.ts +0 -15
  497. package/lib/command/review/AcApRevVisibilityCmd.d.ts.map +0 -1
  498. package/lib/command/review/AcApRevVisibilityCmd.js.map +0 -1
  499. package/lib/command/review/AcApSketchCmd.d.ts +0 -32
  500. package/lib/command/review/AcApSketchCmd.d.ts.map +0 -1
  501. package/lib/command/review/AcApSketchCmd.js +0 -175
  502. package/lib/command/review/AcApSketchCmd.js.map +0 -1
  503. package/lib/command/review/index.d.ts +0 -7
  504. package/lib/command/review/index.d.ts.map +0 -1
  505. package/lib/command/review/index.js +0 -7
  506. package/lib/command/review/index.js.map +0 -1
  507. package/lib/util/AcApMeasurementElementGenerator.d.ts +0 -36
  508. package/lib/util/AcApMeasurementElementGenerator.d.ts.map +0 -1
  509. package/lib/util/AcApMeasurementElementGenerator.js +0 -92
  510. package/lib/util/AcApMeasurementElementGenerator.js.map +0 -1
@@ -0,0 +1,387 @@
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
+ var __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
28
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
29
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
30
+ if (ar || !(i in from)) {
31
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
32
+ ar[i] = from[i];
33
+ }
34
+ }
35
+ return to.concat(ar || Array.prototype.slice.call(from));
36
+ };
37
+ import { acapNotifyUndoStackChanged } from '../../util/AcApDatabaseEdit';
38
+ import { resetMeasurementUnitOverride } from '../../util/AcApMeasurementUnits';
39
+ import { acapCloneMeasurementStyle } from '../../util/AcApMeasurementUtil';
40
+ import { bindOverlayHistory, getSessionUndo } from '../markup/AcApMarkupHistory';
41
+ import { applyMeasurementStyle, getMeasurementStyle, MEASUREMENT_LAYER, resetMeasurementStyleState, resetMeasurementVisibility } from './AcApMeasurementStore';
42
+ /**
43
+ * Snapshot-based undo/redo for measurement HTML overlays.
44
+ *
45
+ * Measurements are not DWG objects. Groups are
46
+ * {@link AcTrHtmlTransientManager.detach}ed (kept alive) so undo can
47
+ * {@link AcTrHtmlTransientManager.reattach} them.
48
+ */
49
+ var AcApMeasurementHistory = /** @class */ (function () {
50
+ function AcApMeasurementHistory() {
51
+ /** Undo stack of measurement overlay mutations (oldest first). */
52
+ this.undoStack = [];
53
+ /** Redo stack of measurement overlay mutations (oldest first). */
54
+ this.redoStack = [];
55
+ /**
56
+ * Nesting depth of {@link run} / {@link apply}. Greater than zero means a
57
+ * mutation is in progress and nested {@link run} calls are not recorded.
58
+ */
59
+ this.depth = 0;
60
+ }
61
+ Object.defineProperty(AcApMeasurementHistory.prototype, "isBusy", {
62
+ /** True while applying undo/redo or nested inside {@link run}. */
63
+ get: function () {
64
+ return this.depth > 0;
65
+ },
66
+ enumerable: false,
67
+ configurable: true
68
+ });
69
+ /** Whether there is at least one measurement overlay undo step. */
70
+ AcApMeasurementHistory.prototype.canUndo = function () {
71
+ return this.undoStack.length > 0;
72
+ };
73
+ /** Whether there is at least one measurement overlay redo step. */
74
+ AcApMeasurementHistory.prototype.canRedo = function () {
75
+ return this.redoStack.length > 0;
76
+ };
77
+ /**
78
+ * Drop redo entries and dispose detached groups they still hold.
79
+ * Called after a new undoable edit so redo cannot jump over it.
80
+ */
81
+ AcApMeasurementHistory.prototype.clearRedo = function () {
82
+ var e_1, _a;
83
+ try {
84
+ for (var _b = __values(this.redoStack), _c = _b.next(); !_c.done; _c = _b.next()) {
85
+ var entry = _c.value;
86
+ disposeDetachedGroups(entry);
87
+ }
88
+ }
89
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
90
+ finally {
91
+ try {
92
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
93
+ }
94
+ finally { if (e_1) throw e_1.error; }
95
+ }
96
+ this.redoStack.length = 0;
97
+ };
98
+ /**
99
+ * Drop history. Detached groups still referenced by the stacks are disposed.
100
+ * Groups that remain on the view are left for {@link AcTrView2d.clear}.
101
+ */
102
+ AcApMeasurementHistory.prototype.clear = function () {
103
+ var e_2, _a;
104
+ try {
105
+ for (var _b = __values(__spreadArray(__spreadArray([], __read(this.undoStack), false), __read(this.redoStack), false)), _c = _b.next(); !_c.done; _c = _b.next()) {
106
+ var entry = _c.value;
107
+ disposeDetachedGroups(entry);
108
+ }
109
+ }
110
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
111
+ finally {
112
+ try {
113
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
114
+ }
115
+ finally { if (e_2) throw e_2.error; }
116
+ }
117
+ this.undoStack.length = 0;
118
+ this.redoStack.length = 0;
119
+ };
120
+ /**
121
+ * Run a measurement mutation and record one undo step when the committed
122
+ * measurement groups on the view change. Nested calls do not create extra
123
+ * entries.
124
+ * @param view - View whose measurement HTML overlays are snapshotted.
125
+ * @param label - Human-readable undo label.
126
+ * @param mutate - Mutation that adds or removes measurement groups.
127
+ */
128
+ AcApMeasurementHistory.prototype.run = function (view, label, mutate) {
129
+ if (this.depth > 0) {
130
+ mutate();
131
+ return;
132
+ }
133
+ var view2d = view;
134
+ var before = snapshotMeasurementGroups(view2d);
135
+ var stylesBefore = snapshotMeasurementStyles(before);
136
+ this.depth++;
137
+ try {
138
+ mutate();
139
+ }
140
+ finally {
141
+ this.depth--;
142
+ }
143
+ var after = snapshotMeasurementGroups(view2d);
144
+ var added = after.filter(function (group) { return before.indexOf(group) < 0; });
145
+ var removed = before.filter(function (group) { return after.indexOf(group) < 0; });
146
+ var stylesAfter = snapshotMeasurementStyles(after);
147
+ if (added.length === 0 &&
148
+ removed.length === 0 &&
149
+ !stylesChanged(stylesBefore, stylesAfter)) {
150
+ return;
151
+ }
152
+ this.undoStack.push({
153
+ label: label,
154
+ view: view2d,
155
+ added: added,
156
+ removed: removed,
157
+ stylesBefore: stylesBefore,
158
+ stylesAfter: stylesAfter
159
+ });
160
+ this.clearRedo();
161
+ getSessionUndo().recordOverlay();
162
+ acapNotifyUndoStackChanged();
163
+ };
164
+ /**
165
+ * Undo the last measurement overlay mutation.
166
+ * @returns true when an entry was applied.
167
+ */
168
+ AcApMeasurementHistory.prototype.undo = function () {
169
+ var entry = this.undoStack.pop();
170
+ if (!entry)
171
+ return false;
172
+ this.apply(entry, 'undo');
173
+ this.redoStack.push(entry);
174
+ return true;
175
+ };
176
+ /**
177
+ * Redo the last undone measurement overlay mutation.
178
+ * @returns true when an entry was applied.
179
+ */
180
+ AcApMeasurementHistory.prototype.redo = function () {
181
+ var entry = this.redoStack.pop();
182
+ if (!entry)
183
+ return false;
184
+ this.apply(entry, 'redo');
185
+ this.undoStack.push(entry);
186
+ return true;
187
+ };
188
+ /**
189
+ * Apply one history entry by detaching and reattaching HTML groups.
190
+ * @param entry - Snapshot of groups added and removed by the original edit.
191
+ * @param direction - `'undo'` restores the pre-edit set; `'redo'` restores
192
+ * the post-edit set.
193
+ */
194
+ AcApMeasurementHistory.prototype.apply = function (entry, direction) {
195
+ var e_3, _a, e_4, _b, e_5, _c;
196
+ this.depth++;
197
+ try {
198
+ var ht = entry.view.htmlTransientManager;
199
+ var detach = direction === 'undo' ? entry.added : entry.removed;
200
+ var attach = direction === 'undo' ? entry.removed : entry.added;
201
+ try {
202
+ for (var detach_1 = __values(detach), detach_1_1 = detach_1.next(); !detach_1_1.done; detach_1_1 = detach_1.next()) {
203
+ var group = detach_1_1.value;
204
+ ht.detach(group.id);
205
+ }
206
+ }
207
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
208
+ finally {
209
+ try {
210
+ if (detach_1_1 && !detach_1_1.done && (_a = detach_1.return)) _a.call(detach_1);
211
+ }
212
+ finally { if (e_3) throw e_3.error; }
213
+ }
214
+ try {
215
+ for (var attach_1 = __values(attach), attach_1_1 = attach_1.next(); !attach_1_1.done; attach_1_1 = attach_1.next()) {
216
+ var group = attach_1_1.value;
217
+ ht.reattach(group);
218
+ }
219
+ }
220
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
221
+ finally {
222
+ try {
223
+ if (attach_1_1 && !attach_1_1.done && (_b = attach_1.return)) _b.call(attach_1);
224
+ }
225
+ finally { if (e_4) throw e_4.error; }
226
+ }
227
+ var styles = direction === 'undo' ? entry.stylesBefore : entry.stylesAfter;
228
+ try {
229
+ for (var _d = __values(snapshotMeasurementGroups(entry.view)), _e = _d.next(); !_e.done; _e = _d.next()) {
230
+ var group = _e.value;
231
+ var style = styles[group.id];
232
+ if (style)
233
+ applyMeasurementStyle(entry.view, group, style);
234
+ }
235
+ }
236
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
237
+ finally {
238
+ try {
239
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
240
+ }
241
+ finally { if (e_5) throw e_5.error; }
242
+ }
243
+ entry.view.isHtmlDirty = true;
244
+ }
245
+ finally {
246
+ this.depth--;
247
+ }
248
+ };
249
+ return AcApMeasurementHistory;
250
+ }());
251
+ export { AcApMeasurementHistory };
252
+ /**
253
+ * Capture the committed measurement HTML groups currently on the view.
254
+ * @param view - View whose measurement layer is snapshotted.
255
+ * @returns Groups on {@link MEASUREMENT_LAYER}, in manager order.
256
+ */
257
+ function snapshotMeasurementGroups(view) {
258
+ return view.htmlTransientManager.groupsOnLayer(MEASUREMENT_LAYER);
259
+ }
260
+ function snapshotMeasurementStyles(groups) {
261
+ var e_6, _a;
262
+ var styles = {};
263
+ try {
264
+ for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
265
+ var group = groups_1_1.value;
266
+ var style = getMeasurementStyle(group.id);
267
+ if (style)
268
+ styles[group.id] = acapCloneMeasurementStyle(style);
269
+ }
270
+ }
271
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
272
+ finally {
273
+ try {
274
+ if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
275
+ }
276
+ finally { if (e_6) throw e_6.error; }
277
+ }
278
+ return styles;
279
+ }
280
+ function stylesChanged(before, after) {
281
+ var e_7, _a;
282
+ var beforeIds = Object.keys(before);
283
+ var afterIds = Object.keys(after);
284
+ if (beforeIds.length !== afterIds.length)
285
+ return true;
286
+ try {
287
+ for (var beforeIds_1 = __values(beforeIds), beforeIds_1_1 = beforeIds_1.next(); !beforeIds_1_1.done; beforeIds_1_1 = beforeIds_1.next()) {
288
+ var id = beforeIds_1_1.value;
289
+ var a = before[id];
290
+ var b = after[id];
291
+ if (!b)
292
+ return true;
293
+ if (a.lineWeight !== b.lineWeight ||
294
+ a.fontSize !== b.fontSize ||
295
+ a.color.red !== b.color.red ||
296
+ a.color.green !== b.color.green ||
297
+ a.color.blue !== b.color.blue) {
298
+ return true;
299
+ }
300
+ }
301
+ }
302
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
303
+ finally {
304
+ try {
305
+ if (beforeIds_1_1 && !beforeIds_1_1.done && (_a = beforeIds_1.return)) _a.call(beforeIds_1);
306
+ }
307
+ finally { if (e_7) throw e_7.error; }
308
+ }
309
+ return false;
310
+ }
311
+ /**
312
+ * Dispose groups in an entry that are no longer attached to the view.
313
+ * Attached groups are left for the view / manager to own.
314
+ * @param entry - History entry whose detached groups may be discarded.
315
+ */
316
+ function disposeDetachedGroups(entry) {
317
+ var e_8, _a, e_9, _b;
318
+ var ht = entry.view.htmlTransientManager;
319
+ try {
320
+ for (var _c = __values(__spreadArray(__spreadArray([], __read(entry.added), false), __read(entry.removed), false)), _d = _c.next(); !_d.done; _d = _c.next()) {
321
+ var group = _d.value;
322
+ if (ht.has(group.id))
323
+ continue;
324
+ try {
325
+ for (var _e = (e_9 = void 0, __values(group.children)), _f = _e.next(); !_f.done; _f = _e.next()) {
326
+ var child = _f.value;
327
+ child.dispose();
328
+ }
329
+ }
330
+ catch (e_9_1) { e_9 = { error: e_9_1 }; }
331
+ finally {
332
+ try {
333
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
334
+ }
335
+ finally { if (e_9) throw e_9.error; }
336
+ }
337
+ group.dispose();
338
+ }
339
+ }
340
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
341
+ finally {
342
+ try {
343
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
344
+ }
345
+ finally { if (e_8) throw e_8.error; }
346
+ }
347
+ }
348
+ /** Session-wide measurement overlay history singleton. */
349
+ var sharedHistory;
350
+ /** Shared measurement overlay history for the active session. */
351
+ export function getMeasurementHistory() {
352
+ if (!sharedHistory)
353
+ sharedHistory = new AcApMeasurementHistory();
354
+ return sharedHistory;
355
+ }
356
+ /**
357
+ * Record an undoable measurement overlay edit.
358
+ * @param view - View whose measurement HTML overlays are snapshotted.
359
+ * @param label - Human-readable undo label.
360
+ * @param mutate - Mutation that adds or removes measurement groups.
361
+ */
362
+ export function runMeasurementEdit(view, label, mutate) {
363
+ getMeasurementHistory().run(view, label, mutate);
364
+ }
365
+ /**
366
+ * Drop measurement overlay history (document open / close).
367
+ * Detached groups are disposed; attached groups stay for view.clear().
368
+ */
369
+ export function resetMeasurementSession() {
370
+ getMeasurementHistory().clear();
371
+ resetMeasurementStyleState();
372
+ resetMeasurementUnitOverride();
373
+ resetMeasurementVisibility();
374
+ }
375
+ /** Bind this history into session undo (also runs at module load). */
376
+ export function bindMeasurementOverlayHistory() {
377
+ bindOverlayHistory({
378
+ canUndo: function () { return getMeasurementHistory().canUndo(); },
379
+ canRedo: function () { return getMeasurementHistory().canRedo(); },
380
+ undo: function () { return getMeasurementHistory().undo(); },
381
+ redo: function () { return getMeasurementHistory().redo(); },
382
+ clearRedo: function () { return getMeasurementHistory().clearRedo(); },
383
+ clear: function () { return getMeasurementHistory().clear(); }
384
+ });
385
+ }
386
+ bindMeasurementOverlayHistory();
387
+ //# sourceMappingURL=AcApMeasurementHistory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApMeasurementHistory.js","sourceRoot":"","sources":["../../../src/command/measure/AcApMeasurementHistory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EACL,yBAAyB,EAE1B,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,wBAAwB,CAAA;AAyB/B;;;;;;GAMG;AACH;IAAA;QACE,kEAAkE;QACjD,cAAS,GAAkC,EAAE,CAAA;QAC9D,kEAAkE;QACjD,cAAS,GAAkC,EAAE,CAAA;QAC9D;;;WAGG;QACK,UAAK,GAAG,CAAC,CAAA;IAiJnB,CAAC;IA9IC,sBAAI,0CAAM;QADV,kEAAkE;aAClE;YACE,OAAO,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACvB,CAAC;;;OAAA;IAED,mEAAmE;IACnE,wCAAO,GAAP;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAA;IAClC,CAAC;IA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A;IAChE,OAAO,aAAa,CAAA;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAkB,EAClB,KAAa,EACb,MAAkB;IAElB,qBAAqB,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,qBAAqB,EAAE,CAAC,KAAK,EAAE,CAAA;IAC/B,0BAA0B,EAAE,CAAA;IAC5B,4BAA4B,EAAE,CAAA;IAC9B,0BAA0B,EAAE,CAAA;AAC9B,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,6BAA6B;IAC3C,kBAAkB,CAAC;QACjB,OAAO,EAAE,cAAM,OAAA,qBAAqB,EAAE,CAAC,OAAO,EAAE,EAAjC,CAAiC;QAChD,OAAO,EAAE,cAAM,OAAA,qBAAqB,EAAE,CAAC,OAAO,EAAE,EAAjC,CAAiC;QAChD,IAAI,EAAE,cAAM,OAAA,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAA9B,CAA8B;QAC1C,IAAI,EAAE,cAAM,OAAA,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAA9B,CAA8B;QAC1C,SAAS,EAAE,cAAM,OAAA,qBAAqB,EAAE,CAAC,SAAS,EAAE,EAAnC,CAAmC;QACpD,KAAK,EAAE,cAAM,OAAA,qBAAqB,EAAE,CAAC,KAAK,EAAE,EAA/B,CAA+B;KAC7C,CAAC,CAAA;AACJ,CAAC;AAED,6BAA6B,EAAE,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { AcApContext } from '../../app';
2
+ import { AcEdCommand } from '../../editor';
3
+ /**
4
+ * Export current measurements to a `{drawing}.measurement.json` download.
5
+ */
6
+ export declare class AcApMeasurementExportCmd extends AcEdCommand {
7
+ constructor();
8
+ execute(context: AcApContext): Promise<void>;
9
+ }
10
+ /**
11
+ * Import measurements from a sidecar JSON file and place them on the view.
12
+ */
13
+ export declare class AcApMeasurementImportCmd extends AcEdCommand {
14
+ constructor();
15
+ execute(context: AcApContext): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=AcApMeasurementImportExportCmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApMeasurementImportExportCmd.d.ts","sourceRoot":"","sources":["../../../src/command/measure/AcApMeasurementImportExportCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EACL,WAAW,EAGZ,MAAM,cAAc,CAAA;AAmDrB;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,WAAW;;IAOjD,OAAO,CAAC,OAAO,EAAE,WAAW;CAUnC;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,WAAW;;IAOjD,OAAO,CAAC,OAAO,EAAE,WAAW;CAsBnC"}
@@ -0,0 +1,207 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ var __generator = (this && this.__generator) || function (thisArg, body) {
26
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
27
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ function verb(n) { return function (v) { return step([n, v]); }; }
29
+ function step(op) {
30
+ if (f) throw new TypeError("Generator is already executing.");
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
+ if (y = 0, t) op = [op[0] & 2, t.value];
34
+ switch (op[0]) {
35
+ case 0: case 1: t = op; break;
36
+ case 4: _.label++; return { value: op[1], done: false };
37
+ case 5: _.label++; y = op[1]; op = [0]; continue;
38
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
+ default:
40
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
+ if (t[2]) _.ops.pop();
45
+ _.trys.pop(); continue;
46
+ }
47
+ op = body.call(thisArg, _);
48
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
+ }
51
+ };
52
+ var __values = (this && this.__values) || function(o) {
53
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
54
+ if (m) return m.call(o);
55
+ if (o && typeof o.length === "number") return {
56
+ next: function () {
57
+ if (o && i >= o.length) o = void 0;
58
+ return { value: o && o[i++], done: !o };
59
+ }
60
+ };
61
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
62
+ };
63
+ import { AcEdCommand, AcEdOpenMode, AcEdPromptStringOptions } from '../../editor';
64
+ import { AcApI18n } from '../../i18n';
65
+ import { runMeasurementEdit } from './AcApMeasurementHistory';
66
+ import { placeMeasurementRecord } from './AcApMeasurementPlace';
67
+ import { measurementSidecarFileName, parseMeasurementSidecar, stringifyMeasurementSidecar } from './AcApMeasurementSidecar';
68
+ import { collectMeasurementRecords } from './AcApMeasurementStore';
69
+ function downloadText(filename, text) {
70
+ if (typeof document === 'undefined')
71
+ return;
72
+ var blob = new Blob([text], { type: 'application/json;charset=utf-8' });
73
+ var url = URL.createObjectURL(blob);
74
+ var a = document.createElement('a');
75
+ a.href = url;
76
+ a.download = filename;
77
+ a.click();
78
+ URL.revokeObjectURL(url);
79
+ }
80
+ function pickJsonFile() {
81
+ var _this = this;
82
+ return new Promise(function (resolve) {
83
+ if (typeof document === 'undefined') {
84
+ resolve(undefined);
85
+ return;
86
+ }
87
+ var input = document.createElement('input');
88
+ input.type = 'file';
89
+ input.accept = '.json,application/json';
90
+ var settled = false;
91
+ var finish = function (text) {
92
+ if (settled)
93
+ return;
94
+ settled = true;
95
+ resolve(text);
96
+ };
97
+ input.addEventListener('cancel', function () { return finish(); });
98
+ input.onchange = function () { return __awaiter(_this, void 0, void 0, function () {
99
+ var file, _a;
100
+ var _b;
101
+ return __generator(this, function (_c) {
102
+ switch (_c.label) {
103
+ case 0:
104
+ file = (_b = input.files) === null || _b === void 0 ? void 0 : _b[0];
105
+ if (!file) {
106
+ finish();
107
+ return [2 /*return*/];
108
+ }
109
+ _a = finish;
110
+ return [4 /*yield*/, file.text()];
111
+ case 1:
112
+ _a.apply(void 0, [_c.sent()]);
113
+ return [2 /*return*/];
114
+ }
115
+ });
116
+ }); };
117
+ input.click();
118
+ });
119
+ }
120
+ /**
121
+ * Export current measurements to a `{drawing}.measurement.json` download.
122
+ */
123
+ var AcApMeasurementExportCmd = /** @class */ (function (_super) {
124
+ __extends(AcApMeasurementExportCmd, _super);
125
+ function AcApMeasurementExportCmd() {
126
+ var _this = _super.call(this) || this;
127
+ _this.mode = AcEdOpenMode.Read;
128
+ _this.recordsUndoStack = false;
129
+ return _this;
130
+ }
131
+ AcApMeasurementExportCmd.prototype.execute = function (context) {
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ var view, drawingName, text;
134
+ return __generator(this, function (_a) {
135
+ view = context.view;
136
+ drawingName = context.doc.fileName || context.doc.docTitle;
137
+ text = stringifyMeasurementSidecar({
138
+ version: 1,
139
+ drawingName: drawingName,
140
+ measurements: collectMeasurementRecords(view)
141
+ });
142
+ downloadText(measurementSidecarFileName(drawingName), text);
143
+ return [2 /*return*/];
144
+ });
145
+ });
146
+ };
147
+ return AcApMeasurementExportCmd;
148
+ }(AcEdCommand));
149
+ export { AcApMeasurementExportCmd };
150
+ /**
151
+ * Import measurements from a sidecar JSON file and place them on the view.
152
+ */
153
+ var AcApMeasurementImportCmd = /** @class */ (function (_super) {
154
+ __extends(AcApMeasurementImportCmd, _super);
155
+ function AcApMeasurementImportCmd() {
156
+ var _this = _super.call(this) || this;
157
+ _this.mode = AcEdOpenMode.Read;
158
+ _this.recordsUndoStack = false;
159
+ return _this;
160
+ }
161
+ AcApMeasurementImportCmd.prototype.execute = function (context) {
162
+ return __awaiter(this, void 0, void 0, function () {
163
+ var text, sidecar, view, db;
164
+ return __generator(this, function (_a) {
165
+ switch (_a.label) {
166
+ case 0:
167
+ // Keep a prompt in i18n for hosts that show status text before the picker.
168
+ void new AcEdPromptStringOptions(AcApI18n.t('jig.measurement.import.chooseFile'));
169
+ return [4 /*yield*/, pickJsonFile()];
170
+ case 1:
171
+ text = _a.sent();
172
+ if (text == null)
173
+ return [2 /*return*/];
174
+ try {
175
+ sidecar = parseMeasurementSidecar(text);
176
+ }
177
+ catch (err) {
178
+ console.error(err);
179
+ return [2 /*return*/];
180
+ }
181
+ view = context.view;
182
+ db = context.doc.database;
183
+ runMeasurementEdit(view, 'Import Measurements', function () {
184
+ var e_1, _a;
185
+ try {
186
+ for (var _b = __values(sidecar.measurements), _c = _b.next(); !_c.done; _c = _b.next()) {
187
+ var record = _c.value;
188
+ placeMeasurementRecord(view, db, record);
189
+ }
190
+ }
191
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
192
+ finally {
193
+ try {
194
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
195
+ }
196
+ finally { if (e_1) throw e_1.error; }
197
+ }
198
+ });
199
+ return [2 /*return*/];
200
+ }
201
+ });
202
+ });
203
+ };
204
+ return AcApMeasurementImportCmd;
205
+ }(AcEdCommand));
206
+ export { AcApMeasurementImportCmd };
207
+ //# sourceMappingURL=AcApMeasurementImportExportCmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApMeasurementImportExportCmd.js","sourceRoot":"","sources":["../../../src/command/measure/AcApMeasurementImportExportCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,uBAAuB,EACxB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAElE,SAAS,YAAY,CAAC,QAAgB,EAAE,IAAY;IAClD,IAAI,OAAO,QAA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AAoB;wBACjC,IAAI,IAAI,IAAI,IAAI;4BAAE,sBAAM;wBAExB,IAAI,CAAC;4BACH,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;wBACzC,CAAC;wBAAC,OAAO,GAAG,EAAE,CAAC;4BACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;4BAClB,sBAAM;wBACR,CAAC;wBACK,IAAI,GAAG,OAAO,CAAC,IAAkB,CAAA;wBACjC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;wBAC/B,kBAAkB,CAAC,IAAI,EAAE,qBAAqB,EAAE;;;gCAC9C,KAAqB,IAAA,KAAA,SAAA,OAAO,CAAC,YAAY,CAAA,gBAAA,4BAAE,CAAC;oCAAvC,IAAM,MAAM,WAAA;oCACf,sBAAsB,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;gCAC1C,CAAC;;;;;;;;;wBACH,CAAC,CAAC,CAAA;;;;;KACH;IACH,+BAAC;AAAD,CAAC,AA7BD,CAA8C,WAAW,GA6BxD"}
@@ -0,0 +1,9 @@
1
+ import type { AcDbDatabase } from '@mlightcad/data-model';
2
+ import type { AcTrView2d } from '../../view';
3
+ import type { AcApMeasurementRecord } from './AcApMeasurementTypes';
4
+ /**
5
+ * Recreate one measurement overlay from a sidecar record.
6
+ * @returns true when the record was placed.
7
+ */
8
+ export declare function placeMeasurementRecord(view: AcTrView2d, db: AcDbDatabase, record: AcApMeasurementRecord): boolean;
9
+ //# sourceMappingURL=AcApMeasurementPlace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApMeasurementPlace.d.ts","sourceRoot":"","sources":["../../../src/command/measure/AcApMeasurementPlace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAOnE;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,UAAU,EAChB,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAeT"}