@mlightcad/cad-simple-viewer 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/README.md +66 -1
  2. package/dist/cad-simple-viewer.js +30394 -28405
  3. package/dist/cad-simple-viewer.umd.cjs +150 -158
  4. package/dist/dxf-parser-worker.js +796 -707
  5. package/lib/app/AcApContext.d.ts.map +1 -1
  6. package/lib/app/AcApContext.js +15 -5
  7. package/lib/app/AcApContext.js.map +1 -1
  8. package/lib/app/AcApDocManager.d.ts +56 -0
  9. package/lib/app/AcApDocManager.d.ts.map +1 -1
  10. package/lib/app/AcApDocManager.js +112 -14
  11. package/lib/app/AcApDocManager.js.map +1 -1
  12. package/lib/app/AcApDocument.d.ts +81 -0
  13. package/lib/app/AcApDocument.d.ts.map +1 -1
  14. package/lib/app/AcApDocument.js +154 -0
  15. package/lib/app/AcApDocument.js.map +1 -1
  16. package/lib/app/AcApLayerSessionState.d.ts +15 -0
  17. package/lib/app/AcApLayerSessionState.d.ts.map +1 -0
  18. package/lib/app/AcApLayerSessionState.js +2 -0
  19. package/lib/app/AcApLayerSessionState.js.map +1 -0
  20. package/lib/app/AcApOpenFileDialog.d.ts +35 -0
  21. package/lib/app/AcApOpenFileDialog.d.ts.map +1 -0
  22. package/lib/app/AcApOpenFileDialog.js +192 -0
  23. package/lib/app/AcApOpenFileDialog.js.map +1 -0
  24. package/lib/app/AcApWebworkerReadiness.d.ts +18 -0
  25. package/lib/app/AcApWebworkerReadiness.d.ts.map +1 -0
  26. package/lib/app/AcApWebworkerReadiness.js +126 -0
  27. package/lib/app/AcApWebworkerReadiness.js.map +1 -0
  28. package/lib/app/index.d.ts +3 -0
  29. package/lib/app/index.d.ts.map +1 -1
  30. package/lib/app/index.js +2 -0
  31. package/lib/app/index.js.map +1 -1
  32. package/lib/command/AcApOpenCmd.d.ts +3 -22
  33. package/lib/command/AcApOpenCmd.d.ts.map +1 -1
  34. package/lib/command/AcApOpenCmd.js +3 -22
  35. package/lib/command/AcApOpenCmd.js.map +1 -1
  36. package/lib/command/AcApRedoCmd.d.ts +10 -0
  37. package/lib/command/AcApRedoCmd.d.ts.map +1 -0
  38. package/lib/command/AcApRedoCmd.js +85 -0
  39. package/lib/command/AcApRedoCmd.js.map +1 -0
  40. package/lib/command/AcApUndoCmd.d.ts +10 -0
  41. package/lib/command/AcApUndoCmd.d.ts.map +1 -0
  42. package/lib/command/AcApUndoCmd.js +85 -0
  43. package/lib/command/AcApUndoCmd.js.map +1 -0
  44. package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -1
  45. package/lib/command/draw/AcApEllipseCmd.js +12 -4
  46. package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
  47. package/lib/command/draw/AcApLineCmd.d.ts.map +1 -1
  48. package/lib/command/draw/AcApLineCmd.js +8 -2
  49. package/lib/command/draw/AcApLineCmd.js.map +1 -1
  50. package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
  51. package/lib/command/draw/AcApMLineCmd.js +2 -0
  52. package/lib/command/draw/AcApMLineCmd.js.map +1 -1
  53. package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -1
  54. package/lib/command/draw/AcApPolylineCmd.js +3 -0
  55. package/lib/command/draw/AcApPolylineCmd.js.map +1 -1
  56. package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -1
  57. package/lib/command/draw/AcApSplineCmd.js +2 -0
  58. package/lib/command/draw/AcApSplineCmd.js.map +1 -1
  59. package/lib/command/index.d.ts +2 -0
  60. package/lib/command/index.d.ts.map +1 -1
  61. package/lib/command/index.js +2 -0
  62. package/lib/command/index.js.map +1 -1
  63. package/lib/command/layer/AcApLayerCmd.d.ts +3 -187
  64. package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -1
  65. package/lib/command/layer/AcApLayerCmd.js +52 -376
  66. package/lib/command/layer/AcApLayerCmd.js.map +1 -1
  67. package/lib/command/layer/AcApLayerCurCmd.d.ts +2 -27
  68. package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -1
  69. package/lib/command/layer/AcApLayerCurCmd.js +18 -67
  70. package/lib/command/layer/AcApLayerCurCmd.js.map +1 -1
  71. package/lib/command/layer/AcApLayerDelCmd.d.ts +2 -25
  72. package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -1
  73. package/lib/command/layer/AcApLayerDelCmd.js +22 -155
  74. package/lib/command/layer/AcApLayerDelCmd.js.map +1 -1
  75. package/lib/command/layer/AcApLayerFreezeCmd.d.ts +2 -9
  76. package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -1
  77. package/lib/command/layer/AcApLayerFreezeCmd.js +27 -39
  78. package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -1
  79. package/lib/command/layer/AcApLayerIsoCmd.d.ts +2 -24
  80. package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -1
  81. package/lib/command/layer/AcApLayerIsoCmd.js +14 -183
  82. package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -1
  83. package/lib/command/layer/AcApLayerLockCmd.d.ts +2 -33
  84. package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -1
  85. package/lib/command/layer/AcApLayerLockCmd.js +18 -55
  86. package/lib/command/layer/AcApLayerLockCmd.js.map +1 -1
  87. package/lib/command/layer/AcApLayerMutationCmd.d.ts +13 -0
  88. package/lib/command/layer/AcApLayerMutationCmd.d.ts.map +1 -0
  89. package/lib/command/layer/AcApLayerMutationCmd.js +42 -0
  90. package/lib/command/layer/AcApLayerMutationCmd.js.map +1 -0
  91. package/lib/command/layer/AcApLayerOffCmd.d.ts +2 -2
  92. package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -1
  93. package/lib/command/layer/AcApLayerOffCmd.js +27 -28
  94. package/lib/command/layer/AcApLayerOffCmd.js.map +1 -1
  95. package/lib/command/layer/AcApLayerOnCmd.d.ts +2 -15
  96. package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -1
  97. package/lib/command/layer/AcApLayerOnCmd.js +6 -49
  98. package/lib/command/layer/AcApLayerOnCmd.js.map +1 -1
  99. package/lib/command/layer/AcApLayerPCmd.d.ts +2 -68
  100. package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -1
  101. package/lib/command/layer/AcApLayerPCmd.js +4 -152
  102. package/lib/command/layer/AcApLayerPCmd.js.map +1 -1
  103. package/lib/command/layer/AcApLayerThawCmd.d.ts +2 -22
  104. package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -1
  105. package/lib/command/layer/AcApLayerThawCmd.js +6 -61
  106. package/lib/command/layer/AcApLayerThawCmd.js.map +1 -1
  107. package/lib/command/layer/AcApLayerUnisoCmd.d.ts +2 -37
  108. package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -1
  109. package/lib/command/layer/AcApLayerUnisoCmd.js +7 -108
  110. package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -1
  111. package/lib/command/layer/AcApLayerUnlockCmd.d.ts +2 -33
  112. package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -1
  113. package/lib/command/layer/AcApLayerUnlockCmd.js +18 -55
  114. package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -1
  115. package/lib/command/modify/AcApCopyCmd.d.ts +12 -0
  116. package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -1
  117. package/lib/command/modify/AcApCopyCmd.js +67 -177
  118. package/lib/command/modify/AcApCopyCmd.js.map +1 -1
  119. package/lib/command/modify/AcApCopyPreviewJig.d.ts +21 -0
  120. package/lib/command/modify/AcApCopyPreviewJig.d.ts.map +1 -0
  121. package/lib/command/modify/AcApCopyPreviewJig.js +61 -0
  122. package/lib/command/modify/AcApCopyPreviewJig.js.map +1 -0
  123. package/lib/command/modify/AcApEraseCmd.d.ts +0 -6
  124. package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -1
  125. package/lib/command/modify/AcApEraseCmd.js +11 -38
  126. package/lib/command/modify/AcApEraseCmd.js.map +1 -1
  127. package/lib/command/modify/AcApHideObjectsCmd.d.ts +0 -7
  128. package/lib/command/modify/AcApHideObjectsCmd.d.ts.map +1 -1
  129. package/lib/command/modify/AcApHideObjectsCmd.js +0 -7
  130. package/lib/command/modify/AcApHideObjectsCmd.js.map +1 -1
  131. package/lib/command/modify/AcApMoveCmd.d.ts +0 -6
  132. package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -1
  133. package/lib/command/modify/AcApMoveCmd.js +26 -105
  134. package/lib/command/modify/AcApMoveCmd.js.map +1 -1
  135. package/lib/command/modify/AcApMovePreviewJig.d.ts +18 -0
  136. package/lib/command/modify/AcApMovePreviewJig.d.ts.map +1 -0
  137. package/lib/command/modify/AcApMovePreviewJig.js +45 -0
  138. package/lib/command/modify/AcApMovePreviewJig.js.map +1 -0
  139. package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
  140. package/lib/command/modify/AcApOffsetCmd.js +5 -33
  141. package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
  142. package/lib/command/modify/AcApRotateCmd.d.ts +2 -2
  143. package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
  144. package/lib/command/modify/AcApRotateCmd.js +37 -200
  145. package/lib/command/modify/AcApRotateCmd.js.map +1 -1
  146. package/lib/command/modify/AcApRotatePreviewJig.d.ts +47 -0
  147. package/lib/command/modify/AcApRotatePreviewJig.d.ts.map +1 -0
  148. package/lib/command/modify/AcApRotatePreviewJig.js +97 -0
  149. package/lib/command/modify/AcApRotatePreviewJig.js.map +1 -0
  150. package/lib/editor/command/AcEdCommand.d.ts +8 -0
  151. package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
  152. package/lib/editor/command/AcEdCommand.js +48 -5
  153. package/lib/editor/command/AcEdCommand.js.map +1 -1
  154. package/lib/editor/global/eventBus.d.ts +10 -2
  155. package/lib/editor/global/eventBus.d.ts.map +1 -1
  156. package/lib/editor/global/eventBus.js.map +1 -1
  157. package/lib/editor/grip/AcEdGripAppearance.d.ts +18 -0
  158. package/lib/editor/grip/AcEdGripAppearance.d.ts.map +1 -0
  159. package/lib/editor/grip/AcEdGripAppearance.js +30 -0
  160. package/lib/editor/grip/AcEdGripAppearance.js.map +1 -0
  161. package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -1
  162. package/lib/editor/grip/AcEdGripEditSession.js +9 -2
  163. package/lib/editor/grip/AcEdGripEditSession.js.map +1 -1
  164. package/lib/editor/grip/AcEdGripHandle.d.ts +3 -2
  165. package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -1
  166. package/lib/editor/grip/AcEdGripHandle.js +9 -6
  167. package/lib/editor/grip/AcEdGripHandle.js.map +1 -1
  168. package/lib/editor/grip/AcEdGripManager.d.ts +13 -1
  169. package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -1
  170. package/lib/editor/grip/AcEdGripManager.js +54 -14
  171. package/lib/editor/grip/AcEdGripManager.js.map +1 -1
  172. package/lib/editor/input/AcEdBatchPreview.d.ts +96 -0
  173. package/lib/editor/input/AcEdBatchPreview.d.ts.map +1 -0
  174. package/lib/editor/input/AcEdBatchPreview.js +125 -0
  175. package/lib/editor/input/AcEdBatchPreview.js.map +1 -0
  176. package/lib/editor/input/AcEdPreviewJig.d.ts +1 -1
  177. package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -1
  178. package/lib/editor/input/AcEdPreviewJig.js +14 -0
  179. package/lib/editor/input/AcEdPreviewJig.js.map +1 -1
  180. package/lib/editor/input/AcEdSelectionPreviewJig.d.ts +109 -0
  181. package/lib/editor/input/AcEdSelectionPreviewJig.d.ts.map +1 -0
  182. package/lib/editor/input/AcEdSelectionPreviewJig.js +185 -0
  183. package/lib/editor/input/AcEdSelectionPreviewJig.js.map +1 -0
  184. package/lib/editor/input/index.d.ts +2 -0
  185. package/lib/editor/input/index.d.ts.map +1 -1
  186. package/lib/editor/input/index.js +2 -0
  187. package/lib/editor/input/index.js.map +1 -1
  188. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +7 -0
  189. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
  190. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +17 -0
  191. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
  192. package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -1
  193. package/lib/editor/input/ui/AcEdFloatingInputBox.js +10 -2
  194. package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -1
  195. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
  196. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +9 -4
  197. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
  198. package/lib/editor/view/AcEdBaseView.d.ts +37 -2
  199. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  200. package/lib/editor/view/AcEdBaseView.js +14 -12
  201. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  202. package/lib/editor/view/AcEdSpatialQueryResult.d.ts +28 -0
  203. package/lib/editor/view/AcEdSpatialQueryResult.d.ts.map +1 -1
  204. package/lib/editor/view/AcEdSpatialQueryResult.js +65 -1
  205. package/lib/editor/view/AcEdSpatialQueryResult.js.map +1 -1
  206. package/lib/i18n/AcApI18n.d.ts +42 -0
  207. package/lib/i18n/AcApI18n.d.ts.map +1 -1
  208. package/lib/i18n/AcApI18n.js +56 -4
  209. package/lib/i18n/AcApI18n.js.map +1 -1
  210. package/lib/i18n/en/command.d.ts +23 -0
  211. package/lib/i18n/en/command.d.ts.map +1 -1
  212. package/lib/i18n/en/command.js +23 -0
  213. package/lib/i18n/en/command.js.map +1 -1
  214. package/lib/i18n/zh/command.d.ts +23 -0
  215. package/lib/i18n/zh/command.d.ts.map +1 -1
  216. package/lib/i18n/zh/command.js +23 -0
  217. package/lib/i18n/zh/command.js.map +1 -1
  218. package/lib/index.d.ts +1 -0
  219. package/lib/index.d.ts.map +1 -1
  220. package/lib/index.js +1 -0
  221. package/lib/index.js.map +1 -1
  222. package/lib/service/AcApEntitySelection.d.ts +42 -0
  223. package/lib/service/AcApEntitySelection.d.ts.map +1 -0
  224. package/lib/service/AcApEntitySelection.js +156 -0
  225. package/lib/service/AcApEntitySelection.js.map +1 -0
  226. package/lib/service/AcApEntityService.d.ts +115 -0
  227. package/lib/service/AcApEntityService.d.ts.map +1 -0
  228. package/lib/service/AcApEntityService.js +194 -0
  229. package/lib/service/AcApEntityService.js.map +1 -0
  230. package/lib/{command/layer → service}/AcApLayerIsoState.d.ts +6 -24
  231. package/lib/service/AcApLayerIsoState.d.ts.map +1 -0
  232. package/lib/service/AcApLayerIsoState.js +28 -0
  233. package/lib/service/AcApLayerIsoState.js.map +1 -0
  234. package/lib/service/AcApLayerService.d.ts +400 -0
  235. package/lib/service/AcApLayerService.d.ts.map +1 -0
  236. package/lib/service/AcApLayerService.js +1240 -0
  237. package/lib/service/AcApLayerService.js.map +1 -0
  238. package/lib/service/AcApLayerStore.d.ts +198 -0
  239. package/lib/service/AcApLayerStore.d.ts.map +1 -0
  240. package/lib/service/AcApLayerStore.js +335 -0
  241. package/lib/service/AcApLayerStore.js.map +1 -0
  242. package/lib/service/AcApServiceEdit.d.ts +18 -0
  243. package/lib/service/AcApServiceEdit.d.ts.map +1 -0
  244. package/lib/service/AcApServiceEdit.js +34 -0
  245. package/lib/service/AcApServiceEdit.js.map +1 -0
  246. package/lib/service/index.d.ts +16 -0
  247. package/lib/service/index.d.ts.map +1 -0
  248. package/lib/service/index.js +16 -0
  249. package/lib/service/index.js.map +1 -0
  250. package/lib/service/types.d.ts +116 -0
  251. package/lib/service/types.d.ts.map +1 -0
  252. package/lib/service/types.js +5 -0
  253. package/lib/service/types.js.map +1 -0
  254. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +21 -6
  255. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
  256. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +56 -10
  257. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
  258. package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts +2 -2
  259. package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts.map +1 -1
  260. package/lib/spatialIndex/AcTrLinearSpatialIndex.js +9 -3
  261. package/lib/spatialIndex/AcTrLinearSpatialIndex.js.map +1 -1
  262. package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts +2 -2
  263. package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
  264. package/lib/spatialIndex/AcTrRBushSpatialIndex.js +19 -5
  265. package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
  266. package/lib/spatialIndex/AcTrSpatialIndex.d.ts +10 -1
  267. package/lib/spatialIndex/AcTrSpatialIndex.d.ts.map +1 -1
  268. package/lib/spatialIndex/AcTrSpatialIndex.js +7 -1
  269. package/lib/spatialIndex/AcTrSpatialIndex.js.map +1 -1
  270. package/lib/util/AcApDatabaseEdit.d.ts +11 -0
  271. package/lib/util/AcApDatabaseEdit.d.ts.map +1 -0
  272. package/lib/util/AcApDatabaseEdit.js +20 -0
  273. package/lib/util/AcApDatabaseEdit.js.map +1 -0
  274. package/lib/util/AcApGeTransform.d.ts +10 -0
  275. package/lib/util/AcApGeTransform.d.ts.map +1 -0
  276. package/lib/util/AcApGeTransform.js +15 -0
  277. package/lib/util/AcApGeTransform.js.map +1 -0
  278. package/lib/util/index.d.ts +2 -0
  279. package/lib/util/index.d.ts.map +1 -1
  280. package/lib/util/index.js +2 -0
  281. package/lib/util/index.js.map +1 -1
  282. package/lib/view/AcEdViewKeyHandler.d.ts +32 -0
  283. package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -0
  284. package/lib/view/AcEdViewKeyHandler.js +101 -0
  285. package/lib/view/AcEdViewKeyHandler.js.map +1 -0
  286. package/lib/view/AcTrGroupWcsBboxAssert.d.ts +16 -0
  287. package/lib/view/AcTrGroupWcsBboxAssert.d.ts.map +1 -1
  288. package/lib/view/AcTrGroupWcsBboxAssert.js +19 -0
  289. package/lib/view/AcTrGroupWcsBboxAssert.js.map +1 -1
  290. package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts +49 -0
  291. package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts.map +1 -0
  292. package/lib/view/AcTrInheritedLayerMaterialMapper.js +138 -0
  293. package/lib/view/AcTrInheritedLayerMaterialMapper.js.map +1 -0
  294. package/lib/view/AcTrLayer.d.ts +26 -2
  295. package/lib/view/AcTrLayer.d.ts.map +1 -1
  296. package/lib/view/AcTrLayer.js +64 -0
  297. package/lib/view/AcTrLayer.js.map +1 -1
  298. package/lib/view/AcTrLayerAppearanceController.d.ts +55 -0
  299. package/lib/view/AcTrLayerAppearanceController.d.ts.map +1 -0
  300. package/lib/view/AcTrLayerAppearanceController.js +86 -0
  301. package/lib/view/AcTrLayerAppearanceController.js.map +1 -0
  302. package/lib/view/AcTrLayout.d.ts +36 -1
  303. package/lib/view/AcTrLayout.d.ts.map +1 -1
  304. package/lib/view/AcTrLayout.js +160 -14
  305. package/lib/view/AcTrLayout.js.map +1 -1
  306. package/lib/view/AcTrScene.d.ts +47 -1
  307. package/lib/view/AcTrScene.d.ts.map +1 -1
  308. package/lib/view/AcTrScene.js +78 -3
  309. package/lib/view/AcTrScene.js.map +1 -1
  310. package/lib/view/AcTrView2d.d.ts +50 -53
  311. package/lib/view/AcTrView2d.d.ts.map +1 -1
  312. package/lib/view/AcTrView2d.js +195 -312
  313. package/lib/view/AcTrView2d.js.map +1 -1
  314. package/lib/view/index.d.ts +3 -0
  315. package/lib/view/index.d.ts.map +1 -1
  316. package/lib/view/index.js +3 -0
  317. package/lib/view/index.js.map +1 -1
  318. package/package.json +7 -7
  319. package/lib/command/layer/AcApLayerIsoState.d.ts.map +0 -1
  320. package/lib/command/layer/AcApLayerIsoState.js +0 -53
  321. package/lib/command/layer/AcApLayerIsoState.js.map +0 -1
@@ -1,5 +1,11 @@
1
1
  import { AcDbDatabase, AcDbObjectId } from '@mlightcad/data-model';
2
2
  import { AcEdOpenMode } from '../editor/view';
3
+ import { AcApEntityService } from '../service/AcApEntityService';
4
+ import type { AcApLayerIsoSnapshot } from '../service/AcApLayerIsoState';
5
+ import { AcApLayerService } from '../service/AcApLayerService';
6
+ import type { AcApLayerStore } from '../service/AcApLayerStore';
7
+ import type { AcApLayerIsolateResult, AcApLayerIsolationMode } from '../service/types';
8
+ import type { AcApLayerPreviousSnapshot } from './AcApLayerSessionState';
3
9
  import { AcApOpenDatabaseOptions } from './AcDbOpenDatabaseOptions';
4
10
  /**
5
11
  * Represents a CAD document that manages a drawing database and associated metadata.
@@ -23,6 +29,16 @@ export declare class AcApDocument {
23
29
  private _openMode;
24
30
  /** Object ids temporarily hidden by HIDEOBJECTS in the current session */
25
31
  private _hiddenObjects;
32
+ /** Layer table snapshot captured before the last layer-modifying operation (`LAYERP`). */
33
+ private _layerPreviousSnapshot?;
34
+ /** Isolation snapshot from the latest `LAYISO` run for `LAYUNISO`. */
35
+ private _layerIsoSnapshot?;
36
+ /** Lazily created layer service bound to this document's database. */
37
+ private _layerService?;
38
+ /** Lazily created entity service bound to this document's database. */
39
+ private _entityService?;
40
+ /** Lazily created layer store bound to this document. */
41
+ private _layerStore?;
26
42
  /**
27
43
  * Creates a new document instance with an empty database.
28
44
  *
@@ -115,6 +131,71 @@ export declare class AcApDocument {
115
131
  * Returns and clears all temporarily hidden object ids.
116
132
  */
117
133
  takeHiddenObjects(): AcDbObjectId[];
134
+ /**
135
+ * Returns the layer service for this document's database.
136
+ */
137
+ get layerService(): AcApLayerService;
138
+ /**
139
+ * Returns the entity service for this document's database.
140
+ */
141
+ get entityService(): AcApEntityService;
142
+ /**
143
+ * Returns the layer store for UI integrations observing this document.
144
+ */
145
+ get layerStore(): AcApLayerStore;
146
+ /**
147
+ * Tears down document-scoped services and session state.
148
+ *
149
+ * Call before replacing this document's drawing content or when discarding
150
+ * the document. Lazy services are recreated on the next access.
151
+ */
152
+ destroy(): void;
153
+ /**
154
+ * Captures the current layer table state for {@link AcApLayerPCmd}.
155
+ */
156
+ captureLayerPreviousState(): void;
157
+ /**
158
+ * Returns the stored `LAYERP` snapshot without clearing it.
159
+ */
160
+ getLayerPreviousSnapshot(): AcApLayerPreviousSnapshot | undefined;
161
+ /**
162
+ * Clears the stored `LAYERP` snapshot without restoring it.
163
+ */
164
+ clearLayerPreviousState(): void;
165
+ /**
166
+ * Stores the latest `LAYISO` snapshot for {@link AcApLayerUnisoCmd}.
167
+ *
168
+ * @param snapshot - Isolation snapshot produced by `LAYISO`.
169
+ */
170
+ setLayerIsoSnapshot(snapshot: AcApLayerIsoSnapshot): void;
171
+ /**
172
+ * Consumes the stored `LAYISO` snapshot for a one-shot `LAYUNISO` restore.
173
+ */
174
+ consumeLayerIsoSnapshot(): AcApLayerIsoSnapshot | undefined;
175
+ /**
176
+ * Clears the stored `LAYISO` snapshot without restoring it.
177
+ */
178
+ clearLayerIsoSnapshot(): void;
179
+ /**
180
+ * Restores the previously captured `LAYERP` layer table state.
181
+ *
182
+ * @returns `true` when a snapshot existed and was applied.
183
+ */
184
+ restoreLayerPreviousState(): boolean;
185
+ /**
186
+ * Isolates layers using `LAYISO` semantics and stores an undo snapshot.
187
+ *
188
+ * @param layerNames - Names of layers to keep visible.
189
+ * @param isolationMode - How non-isolated layers are hidden.
190
+ * @returns Public isolation result, or `undefined` when `layerNames` is empty.
191
+ */
192
+ isolateLayers(layerNames: string[], isolationMode: AcApLayerIsolationMode): AcApLayerIsolateResult | undefined;
193
+ /**
194
+ * Restores the latest `LAYISO` snapshot (`LAYUNISO`).
195
+ *
196
+ * @returns Number of restored layers, or `undefined` when no snapshot exists.
197
+ */
198
+ unisolateLayers(): number | undefined;
118
199
  /**
119
200
  * Extracts the file name from a URI.
120
201
  *
@@ -1 +1 @@
1
- {"version":3,"file":"AcApDocument.d.ts","sourceRoot":"","sources":["../../src/app/AcApDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAC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AAI,MAAM,GAAG,SAAS;IAMrC;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;CAa3B"}
@@ -73,6 +73,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
73
73
  import { AcDbDatabase, AcDbFileType, log } from '@mlightcad/data-model';
74
74
  import { eventBus } from '../editor';
75
75
  import { AcEdOpenMode } from '../editor/view';
76
+ import { AcApEntityService } from '../service/AcApEntityService';
77
+ import { AcApLayerService } from '../service/AcApLayerService';
78
+ import { AcApLayerStore as AcApLayerStoreImpl } from '../service/AcApLayerStore';
79
+ import { acapRunServiceEdit, LAYER_EDIT_LABEL } from '../service/AcApServiceEdit';
80
+ import { LAYER_LOCKED_FLAG } from '../service/types';
76
81
  /**
77
82
  * Represents a CAD document that manages a drawing database and associated metadata.
78
83
  *
@@ -285,6 +290,155 @@ var AcApDocument = /** @class */ (function () {
285
290
  this._hiddenObjects.clear();
286
291
  return hiddenIds;
287
292
  };
293
+ Object.defineProperty(AcApDocument.prototype, "layerService", {
294
+ /**
295
+ * Returns the layer service for this document's database.
296
+ */
297
+ get: function () {
298
+ if (!this._layerService) {
299
+ this._layerService = new AcApLayerService(this._database);
300
+ }
301
+ return this._layerService;
302
+ },
303
+ enumerable: false,
304
+ configurable: true
305
+ });
306
+ Object.defineProperty(AcApDocument.prototype, "entityService", {
307
+ /**
308
+ * Returns the entity service for this document's database.
309
+ */
310
+ get: function () {
311
+ if (!this._entityService) {
312
+ this._entityService = new AcApEntityService(this._database);
313
+ }
314
+ return this._entityService;
315
+ },
316
+ enumerable: false,
317
+ configurable: true
318
+ });
319
+ Object.defineProperty(AcApDocument.prototype, "layerStore", {
320
+ /**
321
+ * Returns the layer store for UI integrations observing this document.
322
+ */
323
+ get: function () {
324
+ if (!this._layerStore) {
325
+ this._layerStore = new AcApLayerStoreImpl(this);
326
+ }
327
+ return this._layerStore;
328
+ },
329
+ enumerable: false,
330
+ configurable: true
331
+ });
332
+ /**
333
+ * Tears down document-scoped services and session state.
334
+ *
335
+ * Call before replacing this document's drawing content or when discarding
336
+ * the document. Lazy services are recreated on the next access.
337
+ */
338
+ AcApDocument.prototype.destroy = function () {
339
+ var _a;
340
+ (_a = this._layerStore) === null || _a === void 0 ? void 0 : _a.destroy();
341
+ this._layerStore = undefined;
342
+ this._layerService = undefined;
343
+ this._entityService = undefined;
344
+ this.clearLayerPreviousState();
345
+ this.clearLayerIsoSnapshot();
346
+ this._hiddenObjects.clear();
347
+ };
348
+ /**
349
+ * Captures the current layer table state for {@link AcApLayerPCmd}.
350
+ */
351
+ AcApDocument.prototype.captureLayerPreviousState = function () {
352
+ var db = this._database;
353
+ this._layerPreviousSnapshot = {
354
+ clayer: db.clayer,
355
+ states: __spreadArray([], __read(db.tables.layerTable.newIterator()), false).map(function (layer) {
356
+ var _a;
357
+ return ({
358
+ name: layer.name,
359
+ isOn: !layer.isOff,
360
+ isFrozen: layer.isFrozen,
361
+ isLocked: (((_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0) & LAYER_LOCKED_FLAG) !== 0
362
+ });
363
+ })
364
+ };
365
+ };
366
+ /**
367
+ * Returns the stored `LAYERP` snapshot without clearing it.
368
+ */
369
+ AcApDocument.prototype.getLayerPreviousSnapshot = function () {
370
+ return this._layerPreviousSnapshot;
371
+ };
372
+ /**
373
+ * Clears the stored `LAYERP` snapshot without restoring it.
374
+ */
375
+ AcApDocument.prototype.clearLayerPreviousState = function () {
376
+ this._layerPreviousSnapshot = undefined;
377
+ };
378
+ /**
379
+ * Stores the latest `LAYISO` snapshot for {@link AcApLayerUnisoCmd}.
380
+ *
381
+ * @param snapshot - Isolation snapshot produced by `LAYISO`.
382
+ */
383
+ AcApDocument.prototype.setLayerIsoSnapshot = function (snapshot) {
384
+ this._layerIsoSnapshot = snapshot;
385
+ };
386
+ /**
387
+ * Consumes the stored `LAYISO` snapshot for a one-shot `LAYUNISO` restore.
388
+ */
389
+ AcApDocument.prototype.consumeLayerIsoSnapshot = function () {
390
+ var snapshot = this._layerIsoSnapshot;
391
+ this._layerIsoSnapshot = undefined;
392
+ return snapshot;
393
+ };
394
+ /**
395
+ * Clears the stored `LAYISO` snapshot without restoring it.
396
+ */
397
+ AcApDocument.prototype.clearLayerIsoSnapshot = function () {
398
+ this._layerIsoSnapshot = undefined;
399
+ };
400
+ /**
401
+ * Restores the previously captured `LAYERP` layer table state.
402
+ *
403
+ * @returns `true` when a snapshot existed and was applied.
404
+ */
405
+ AcApDocument.prototype.restoreLayerPreviousState = function () {
406
+ var _this = this;
407
+ var snapshot = this._layerPreviousSnapshot;
408
+ if (!snapshot)
409
+ return false;
410
+ return acapRunServiceEdit(this._database, LAYER_EDIT_LABEL, function () {
411
+ return AcApLayerService.applyLayerPreviousSnapshot(_this._database, snapshot);
412
+ });
413
+ };
414
+ /**
415
+ * Isolates layers using `LAYISO` semantics and stores an undo snapshot.
416
+ *
417
+ * @param layerNames - Names of layers to keep visible.
418
+ * @param isolationMode - How non-isolated layers are hidden.
419
+ * @returns Public isolation result, or `undefined` when `layerNames` is empty.
420
+ */
421
+ AcApDocument.prototype.isolateLayers = function (layerNames, isolationMode) {
422
+ var result = this.layerService.isolateLayers(layerNames, isolationMode);
423
+ if (!result)
424
+ return undefined;
425
+ this._layerIsoSnapshot = result.isoSnapshot;
426
+ return {
427
+ layerNames: result.layerNames,
428
+ affectedLayerCount: result.affectedLayerCount
429
+ };
430
+ };
431
+ /**
432
+ * Restores the latest `LAYISO` snapshot (`LAYUNISO`).
433
+ *
434
+ * @returns Number of restored layers, or `undefined` when no snapshot exists.
435
+ */
436
+ AcApDocument.prototype.unisolateLayers = function () {
437
+ var snapshot = this.consumeLayerIsoSnapshot();
438
+ if (!snapshot)
439
+ return undefined;
440
+ return this.layerService.unisolateFromSnapshot(snapshot);
441
+ };
288
442
  /**
289
443
  * Extracts the file name from a URI.
290
444
  *
@@ -1 +1 @@
1
- {"version":3,"file":"AcApDocument.js","sourceRoot":"","sources":["../../src/app/AcApDocument.ts"],"names":[],"mappings":";;;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E,KAAK,CAAC,CAAA;YAChC,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AA3WD,IA2WC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Snapshot of the layer table at a point in time for the `LAYERP` command.
3
+ */
4
+ export interface AcApLayerPreviousSnapshot {
5
+ /** Current layer name (`CLAYER`) at capture time. */
6
+ clayer: string;
7
+ /** Per-layer on, frozen, and locked state. */
8
+ states: Array<{
9
+ name: string;
10
+ isOn: boolean;
11
+ isFrozen: boolean;
12
+ isLocked: boolean;
13
+ }>;
14
+ }
15
+ //# sourceMappingURL=AcApLayerSessionState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApLayerSessionState.d.ts","sourceRoot":"","sources":["../../src/app/AcApLayerSessionState.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,OAAO,CAAA;QACb,QAAQ,EAAE,OAAO,CAAA;QACjB,QAAQ,EAAE,OAAO,CAAA;KAClB,CAAC,CAAA;CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AcApLayerSessionState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApLayerSessionState.js","sourceRoot":"","sources":["../../src/app/AcApLayerSessionState.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ import type { AcApOpenDatabaseOptions } from './AcDbOpenDatabaseOptions';
2
+ /**
3
+ * Resolver for default options used by the built-in OPEN file dialog.
4
+ *
5
+ * May be a static options object or a factory that returns options synchronously
6
+ * or asynchronously.
7
+ */
8
+ export type AcApOpenDocumentDefaultsResolver = AcApOpenDatabaseOptions | (() => AcApOpenDatabaseOptions | Promise<AcApOpenDatabaseOptions>);
9
+ /**
10
+ * Configuration for the built-in OPEN file dialog installed by {@link acapInstallOpenFileDialog}.
11
+ */
12
+ export interface AcApOpenFileDialogOptions {
13
+ /** When false, the built-in OPEN dialog is not installed. Defaults to true. */
14
+ enabled?: boolean;
15
+ /** Supplies open options for files chosen through the built-in dialog. */
16
+ getOpenDocumentDefaults?: () => AcApOpenDatabaseOptions | Promise<AcApOpenDatabaseOptions>;
17
+ }
18
+ /**
19
+ * Installs the built-in file picker used by the OPEN command.
20
+ *
21
+ * Listens for `open-file` events, prompts for a local `.dxf` / `.dwg` file,
22
+ * and opens it through {@link AcApDocManager.openDocument}.
23
+ *
24
+ * @param options - Dialog configuration. When `enabled` is `false`, installation is skipped.
25
+ */
26
+ export declare function acapInstallOpenFileDialog(options?: AcApOpenFileDialogOptions): void;
27
+ /**
28
+ * Updates options for an already installed built-in OPEN file dialog.
29
+ *
30
+ * @param options - Replacement dialog configuration merged into the active install.
31
+ */
32
+ export declare function acapUpdateOpenFileDialogOptions(options: AcApOpenFileDialogOptions): void;
33
+ /** Removes the built-in OPEN file dialog and its hidden input element. */
34
+ export declare function acapUninstallOpenFileDialog(): void;
35
+ //# sourceMappingURL=AcApOpenFileDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApOpenFileDialog.d.ts","sourceRoot":"","sources":["../../src/app/AcApOpenFileDialog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAKxE;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GACxC,uBAAuB,GACvB,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAA;AAEtE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0EAA0E;IAC1E,uBAAuB,CAAC,EAAE,MACtB,uBAAuB,GACvB,OAAO,CAAC,uBAAuB,CAAC,CAAA;CACrC;AAuGD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,yBAA8B,QASxC;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,yBAAyB,QAGnC;AAED,0EAA0E;AAC1E,wBAAgB,2BAA2B,SAS1C"}
@@ -0,0 +1,192 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ 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);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ 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;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { log } from '@mlightcad/data-model';
38
+ import { eventBus } from '../editor/global/eventBus';
39
+ import { AcEdOpenMode } from '../editor/view/AcEdOpenMode';
40
+ /** File extensions accepted by the built-in OPEN file dialog. */
41
+ var SUPPORTED_EXTENSIONS = ['.dxf', '.dwg'];
42
+ /** Hidden `<input type="file">` element reused across OPEN requests. */
43
+ var fileInput;
44
+ /** Whether {@link acapInstallOpenFileDialog} has registered the `open-file` listener. */
45
+ var installed = false;
46
+ /** Active dialog options merged from install and update calls. */
47
+ var currentOptions = {};
48
+ /**
49
+ * Returns whether the given file name has a supported CAD extension.
50
+ *
51
+ * @param fileName - Local file name including extension.
52
+ * @returns `true` when the name ends with `.dxf` or `.dwg` (case-insensitive).
53
+ */
54
+ var isSupportedCadFile = function (fileName) {
55
+ var lowerName = fileName.toLowerCase();
56
+ return SUPPORTED_EXTENSIONS.some(function (ext) { return lowerName.endsWith(ext); });
57
+ };
58
+ /**
59
+ * Reads a browser {@link File} into memory as raw bytes.
60
+ *
61
+ * @param file - File selected from the hidden file input.
62
+ * @returns Resolves with the file contents as an {@link ArrayBuffer}.
63
+ */
64
+ var readFileAsArrayBuffer = function (file) {
65
+ return new Promise(function (resolve, reject) {
66
+ var reader = new FileReader();
67
+ reader.onload = function () { return resolve(reader.result); };
68
+ reader.onerror = function () { var _a; return reject((_a = reader.error) !== null && _a !== void 0 ? _a : new Error('Failed to read file')); };
69
+ reader.readAsArrayBuffer(file);
70
+ });
71
+ };
72
+ /**
73
+ * Resolves database open options for a user-selected file.
74
+ *
75
+ * Falls back to `{ minimumChunkSize: 1000 }` when no custom resolver is configured.
76
+ *
77
+ * @param getDefaults - Optional callback from {@link AcApOpenFileDialogOptions.getOpenDocumentDefaults}.
78
+ * @returns Resolved open options passed to {@link AcApDocManager.openDocument}.
79
+ */
80
+ var resolveOpenDocumentDefaults = function (getDefaults) { return __awaiter(void 0, void 0, void 0, function () {
81
+ return __generator(this, function (_a) {
82
+ if (!getDefaults) {
83
+ return [2 /*return*/, { minimumChunkSize: 1000 }];
84
+ }
85
+ return [2 /*return*/, getDefaults()];
86
+ });
87
+ }); };
88
+ /**
89
+ * Opens the hidden file picker in response to an `open-file` event.
90
+ *
91
+ * Creates and appends the input element on first use, then triggers `click()`.
92
+ */
93
+ var onOpenFile = function () {
94
+ if (!fileInput) {
95
+ fileInput = document.createElement('input');
96
+ fileInput.type = 'file';
97
+ fileInput.accept = SUPPORTED_EXTENSIONS.join(',');
98
+ fileInput.style.display = 'none';
99
+ fileInput.addEventListener('change', onFileChange);
100
+ document.body.appendChild(fileInput);
101
+ }
102
+ fileInput.click();
103
+ };
104
+ /**
105
+ * Handles file selection from the hidden input.
106
+ *
107
+ * Validates the extension, reads the file, and delegates opening to
108
+ * {@link AcApDocManager.openDocument}. Clears the input value so the same file
109
+ * can be chosen again.
110
+ *
111
+ * @param event - `change` event from the hidden file input.
112
+ */
113
+ var onFileChange = function (event) { return __awaiter(void 0, void 0, void 0, function () {
114
+ var target, file, content, AcApDocManager, options, error_1;
115
+ var _a, _b;
116
+ return __generator(this, function (_c) {
117
+ switch (_c.label) {
118
+ case 0:
119
+ target = event.target;
120
+ file = (_a = target.files) === null || _a === void 0 ? void 0 : _a[0];
121
+ target.value = '';
122
+ if (!file)
123
+ return [2 /*return*/];
124
+ if (!isSupportedCadFile(file.name)) {
125
+ log.warn("Unsupported file type: ".concat(file.name));
126
+ return [2 /*return*/];
127
+ }
128
+ _c.label = 1;
129
+ case 1:
130
+ _c.trys.push([1, 6, , 7]);
131
+ return [4 /*yield*/, readFileAsArrayBuffer(file)];
132
+ case 2:
133
+ content = _c.sent();
134
+ return [4 /*yield*/, import('./AcApDocManager')];
135
+ case 3:
136
+ AcApDocManager = (_c.sent()).AcApDocManager;
137
+ return [4 /*yield*/, resolveOpenDocumentDefaults(currentOptions.getOpenDocumentDefaults)];
138
+ case 4:
139
+ options = _c.sent();
140
+ eventBus.emit('open-local-file-started', {
141
+ mode: (_b = options.mode) !== null && _b !== void 0 ? _b : AcEdOpenMode.Read
142
+ });
143
+ return [4 /*yield*/, AcApDocManager.instance.openDocument(file.name, content, options)];
144
+ case 5:
145
+ _c.sent();
146
+ return [3 /*break*/, 7];
147
+ case 6:
148
+ error_1 = _c.sent();
149
+ log.error('Failed to open selected file:', error_1);
150
+ return [3 /*break*/, 7];
151
+ case 7: return [2 /*return*/];
152
+ }
153
+ });
154
+ }); };
155
+ /**
156
+ * Installs the built-in file picker used by the OPEN command.
157
+ *
158
+ * Listens for `open-file` events, prompts for a local `.dxf` / `.dwg` file,
159
+ * and opens it through {@link AcApDocManager.openDocument}.
160
+ *
161
+ * @param options - Dialog configuration. When `enabled` is `false`, installation is skipped.
162
+ */
163
+ export function acapInstallOpenFileDialog(options) {
164
+ if (options === void 0) { options = {}; }
165
+ if (options.enabled === false)
166
+ return;
167
+ currentOptions = options;
168
+ if (installed)
169
+ return;
170
+ eventBus.on('open-file', onOpenFile);
171
+ installed = true;
172
+ }
173
+ /**
174
+ * Updates options for an already installed built-in OPEN file dialog.
175
+ *
176
+ * @param options - Replacement dialog configuration merged into the active install.
177
+ */
178
+ export function acapUpdateOpenFileDialogOptions(options) {
179
+ currentOptions = options;
180
+ }
181
+ /** Removes the built-in OPEN file dialog and its hidden input element. */
182
+ export function acapUninstallOpenFileDialog() {
183
+ if (!installed)
184
+ return;
185
+ eventBus.off('open-file', onOpenFile);
186
+ fileInput === null || fileInput === void 0 ? void 0 : fileInput.removeEventListener('change', onFileChange);
187
+ fileInput === null || fileInput === void 0 ? void 0 : fileInput.remove();
188
+ fileInput = undefined;
189
+ installed = false;
190
+ currentOptions = {};
191
+ }
192
+ //# sourceMappingURL=AcApOpenFileDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApOpenFileDialog.js","sourceRoot":"","sources":["../../src/app/AcApOpenFileDialog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAG1D,iEAAiE;AACjE,IAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAA;AAwBtD,wEAAwE;AACxE,IAAI,SAAuC,CAAA;AAC3C,yFAAyF;AACzF,IAAI,SAAS,GAAG,KAAK,CAAA;AACrB,kEAAkE;AAClE,IAAI,cAAc,GAA8B,EAAE,CAAA;AAElD;;;;;GAKG;AACH,IAAM,kBAAkB,GAAG,UAAC,QAAgB;IAC1C,IAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAA;IACxC,OAAO,oBAAoB,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAvB,CAAuB,CAAC,CAAA;AAClE,CAAC,CAAA;AAED;;;;;GAKG;AACH,IAAM,qBAAqB,GAAG,UAAC,IAAU;IACvC,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAC1B,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAA;QAC/B,MAAM,CAAC,MAAM,GAAG,cAAM,OAAA,OAAO,CAAC,MAAM,CAAC,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SAAS;QAAE,OAAM;IAEtB,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;IACrC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;IACtD,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,EAAE,CAAA;IACnB,SAAS,GAAG,SAAS,CAAA;IACrB,SAAS,GAAG,KAAK,CAAA;IACjB,cAAc,GAAG,EAAE,CAAA;AACrB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { AcApWebworkerFiles } from './AcApDocManager';
2
+ /** Default worker script URLs used when `webworkerFileUrls` is omitted. */
3
+ export declare const DEFAULT_WEBWORKER_FILE_URLS: Required<AcApWebworkerFiles>;
4
+ /**
5
+ * Resolves configured worker URLs to strings, falling back to {@link DEFAULT_WEBWORKER_FILE_URLS}.
6
+ */
7
+ export declare function resolveWebworkerFileUrls(webworkerFileUrls?: AcApWebworkerFiles): string[];
8
+ /** Clears the module-level success cache (e.g. when the doc manager is destroyed). */
9
+ export declare function resetWebworkerReadinessCache(): void;
10
+ /**
11
+ * Returns true when all configured worker scripts respond successfully.
12
+ *
13
+ * Uses HEAD requests to avoid downloading large worker bundles. Successful
14
+ * results are cached for the current page lifecycle; failures are not cached
15
+ * so transient network errors can be retried.
16
+ */
17
+ export declare function checkWebworkerReadiness(webworkerFileUrls?: AcApWebworkerFiles): Promise<boolean>;
18
+ //# sourceMappingURL=AcApWebworkerReadiness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApWebworkerReadiness.d.ts","sourceRoot":"","sources":["../../src/app/AcApWebworkerReadiness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,kBAAkB,CAIpE,CAAA;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,iBAAiB,CAAC,EAAE,kBAAkB,GACrC,MAAM,EAAE,CAMV;AAKD,sFAAsF;AACtF,wBAAgB,4BAA4B,IAAI,IAAI,CAGnD;AAmBD;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,iBAAiB,CAAC,EAAE,kBAAkB,GACrC,OAAO,CAAC,OAAO,CAAC,CAkBlB"}