@mlightcad/cad-simple-viewer 1.6.2 → 1.7.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.
- package/dist/cad-simple-viewer.js +28736 -18706
- package/dist/cad-simple-viewer.umd.cjs +1639 -308
- package/dist/mtext-renderer-worker.js +14590 -14441
- package/icons.ts +7 -0
- package/lib/app/AcApBrand.d.ts +2 -2
- package/lib/app/AcApBrand.d.ts.map +1 -1
- package/lib/app/AcApBrand.js +2 -2
- package/lib/app/AcApBrand.js.map +1 -1
- package/lib/app/AcApBusyIndicator.d.ts +6 -0
- package/lib/app/AcApBusyIndicator.d.ts.map +1 -1
- package/lib/app/AcApBusyIndicator.js +8 -0
- package/lib/app/AcApBusyIndicator.js.map +1 -1
- package/lib/app/AcApContext.d.ts +24 -0
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +103 -18
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +293 -31
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +972 -184
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocSession.d.ts +41 -0
- package/lib/app/AcApDocSession.d.ts.map +1 -0
- package/lib/app/AcApDocSession.js +29 -0
- package/lib/app/AcApDocSession.js.map +1 -0
- package/lib/app/AcApDocsUrl.d.ts +57 -0
- package/lib/app/AcApDocsUrl.d.ts.map +1 -0
- package/lib/app/AcApDocsUrl.js +76 -0
- package/lib/app/AcApDocsUrl.js.map +1 -0
- package/lib/app/AcApDocument.d.ts +6 -1
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +21 -0
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApFontLoader.d.ts +6 -0
- package/lib/app/AcApFontLoader.d.ts.map +1 -1
- package/lib/app/AcApFontLoader.js +11 -0
- package/lib/app/AcApFontLoader.js.map +1 -1
- package/lib/app/{AcDbOpenDatabaseOptions.d.ts → AcApOpenDatabaseOptions.d.ts} +35 -8
- package/lib/app/AcApOpenDatabaseOptions.d.ts.map +1 -0
- package/lib/app/{AcDbOpenDatabaseOptions.js → AcApOpenDatabaseOptions.js} +1 -1
- package/lib/app/AcApOpenDatabaseOptions.js.map +1 -0
- package/lib/app/AcApOpenFileDialog.d.ts +1 -1
- package/lib/app/AcApOpenFileProgressController.d.ts +14 -0
- package/lib/app/AcApOpenFileProgressController.d.ts.map +1 -1
- package/lib/app/AcApOpenFileProgressController.js +18 -0
- package/lib/app/AcApOpenFileProgressController.js.map +1 -1
- package/lib/app/AcApProgress.d.ts +6 -0
- package/lib/app/AcApProgress.d.ts.map +1 -1
- package/lib/app/AcApProgress.js +17 -0
- package/lib/app/AcApProgress.js.map +1 -1
- package/lib/app/AcApSettingManager.d.ts +156 -43
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +216 -66
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/app/index.d.ts +4 -2
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +3 -1
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApCloseCmd.d.ts +15 -0
- package/lib/command/AcApCloseCmd.d.ts.map +1 -0
- package/lib/command/AcApCloseCmd.js +83 -0
- package/lib/command/AcApCloseCmd.js.map +1 -0
- package/lib/command/AcApDrawOverlayInput.d.ts +6 -0
- package/lib/command/AcApDrawOverlayInput.d.ts.map +1 -0
- package/lib/command/AcApDrawOverlayInput.js +64 -0
- package/lib/command/AcApDrawOverlayInput.js.map +1 -0
- package/lib/command/AcApDrawStyleDrawCmd.d.ts +9 -0
- package/lib/command/AcApDrawStyleDrawCmd.d.ts.map +1 -0
- package/lib/command/AcApDrawStyleDrawCmd.js +32 -0
- package/lib/command/AcApDrawStyleDrawCmd.js.map +1 -0
- package/lib/command/AcApDrawStyleSession.d.ts +20 -0
- package/lib/command/AcApDrawStyleSession.d.ts.map +1 -0
- package/lib/command/AcApDrawStyleSession.js +2 -0
- package/lib/command/AcApDrawStyleSession.js.map +1 -0
- package/lib/command/AcApInstallDrawStyleSessionAccessory.d.ts +28 -0
- package/lib/command/AcApInstallDrawStyleSessionAccessory.d.ts.map +1 -0
- package/lib/command/AcApInstallDrawStyleSessionAccessory.js +174 -0
- package/lib/command/AcApInstallDrawStyleSessionAccessory.js.map +1 -0
- package/lib/command/AcApReadingModeCmd.d.ts +17 -0
- package/lib/command/AcApReadingModeCmd.d.ts.map +1 -0
- package/lib/command/AcApReadingModeCmd.js +82 -0
- package/lib/command/AcApReadingModeCmd.js.map +1 -0
- package/lib/command/AcApShortCutSelectionAccessory.d.ts +14 -0
- package/lib/command/AcApShortCutSelectionAccessory.d.ts.map +1 -0
- package/lib/command/AcApShortCutSelectionAccessory.js +266 -0
- package/lib/command/AcApShortCutSelectionAccessory.js.map +1 -0
- package/lib/command/AcApShortCutToolbarDocBind.d.ts +20 -0
- package/lib/command/AcApShortCutToolbarDocBind.d.ts.map +1 -0
- package/lib/command/AcApShortCutToolbarDocBind.js +155 -0
- package/lib/command/AcApShortCutToolbarDocBind.js.map +1 -0
- package/lib/command/AcApZoomCmd.d.ts +39 -1
- package/lib/command/AcApZoomCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomCmd.js +70 -6
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/draw/AcApHatchCmd.js +1 -1
- package/lib/command/draw/AcApHatchCmd.js.map +1 -1
- package/lib/command/draw/AcApMTextCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApMTextCmd.js +11 -7
- package/lib/command/draw/AcApMTextCmd.js.map +1 -1
- package/lib/command/index.d.ts +4 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +4 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/markup/AcApMarkupArrowCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupArrowCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupArrowCmd.js +8 -9
- package/lib/command/markup/AcApMarkupArrowCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupCalloutCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupCalloutCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupCalloutCmd.js +47 -22
- package/lib/command/markup/AcApMarkupCalloutCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupCircleCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupCircleCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupCircleCmd.js +8 -9
- package/lib/command/markup/AcApMarkupCircleCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupCloudCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupCloudCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupCloudCmd.js +8 -9
- package/lib/command/markup/AcApMarkupCloudCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupCmdUtil.d.ts +7 -1
- package/lib/command/markup/AcApMarkupCmdUtil.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupCmdUtil.js +10 -0
- package/lib/command/markup/AcApMarkupCmdUtil.js.map +1 -1
- package/lib/command/markup/AcApMarkupDrawCmd.d.ts +19 -0
- package/lib/command/markup/AcApMarkupDrawCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupDrawCmd.js +47 -0
- package/lib/command/markup/AcApMarkupDrawCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupGeometry.d.ts +39 -3
- package/lib/command/markup/AcApMarkupGeometry.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupGeometry.js +127 -26
- package/lib/command/markup/AcApMarkupGeometry.js.map +1 -1
- package/lib/command/markup/AcApMarkupHighlightCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupHighlightCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupHighlightCmd.js +9 -10
- package/lib/command/markup/AcApMarkupHighlightCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupHistory.d.ts +1 -1
- package/lib/command/markup/AcApMarkupHistory.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupHistory.js +4 -11
- package/lib/command/markup/AcApMarkupHistory.js.map +1 -1
- package/lib/command/markup/AcApMarkupLineCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupLineCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupLineCmd.js +18 -11
- package/lib/command/markup/AcApMarkupLineCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupPresenter.d.ts +24 -4
- package/lib/command/markup/AcApMarkupPresenter.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupPresenter.js +100 -18
- package/lib/command/markup/AcApMarkupPresenter.js.map +1 -1
- package/lib/command/markup/AcApMarkupRectCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupRectCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupRectCmd.js +8 -9
- package/lib/command/markup/AcApMarkupRectCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupSession.d.ts +54 -0
- package/lib/command/markup/AcApMarkupSession.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupSession.js +85 -0
- package/lib/command/markup/AcApMarkupSession.js.map +1 -0
- package/lib/command/markup/AcApMarkupSessionBootstrap.d.ts +2 -0
- package/lib/command/markup/AcApMarkupSessionBootstrap.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupSessionBootstrap.js +12 -0
- package/lib/command/markup/AcApMarkupSessionBootstrap.js.map +1 -0
- package/lib/command/markup/AcApMarkupShapeBuilder.d.ts +7 -4
- package/lib/command/markup/AcApMarkupShapeBuilder.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupShapeBuilder.js +24 -11
- package/lib/command/markup/AcApMarkupShapeBuilder.js.map +1 -1
- package/lib/command/markup/AcApMarkupShapeCallout.d.ts +21 -1
- package/lib/command/markup/AcApMarkupShapeCallout.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupShapeCallout.js +41 -25
- package/lib/command/markup/AcApMarkupShapeCallout.js.map +1 -1
- package/lib/command/markup/AcApMarkupSidecar.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupSidecar.js +39 -5
- package/lib/command/markup/AcApMarkupSidecar.js.map +1 -1
- package/lib/command/markup/AcApMarkupStampCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupStampCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupStampCmd.js +6 -7
- package/lib/command/markup/AcApMarkupStampCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupStore.d.ts +1 -1
- package/lib/command/markup/AcApMarkupStore.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupStore.js +3 -6
- package/lib/command/markup/AcApMarkupStore.js.map +1 -1
- package/lib/command/markup/AcApMarkupTextCmd.d.ts +2 -3
- package/lib/command/markup/AcApMarkupTextCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupTextCmd.js +13 -9
- package/lib/command/markup/AcApMarkupTextCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupTypes.d.ts +18 -2
- package/lib/command/markup/AcApMarkupTypes.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupUtil.d.ts +36 -7
- package/lib/command/markup/AcApMarkupUtil.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupUtil.js +149 -34
- package/lib/command/markup/AcApMarkupUtil.js.map +1 -1
- package/lib/command/markup/AcApRegisterMarkupCommands.d.ts +8 -0
- package/lib/command/markup/AcApRegisterMarkupCommands.d.ts.map +1 -0
- package/lib/command/markup/AcApRegisterMarkupCommands.js +35 -0
- package/lib/command/markup/AcApRegisterMarkupCommands.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupCalloutEntity.d.ts.map +1 -1
- package/lib/command/markup/entity/AcApMarkupCalloutEntity.js +16 -15
- package/lib/command/markup/entity/AcApMarkupCalloutEntity.js.map +1 -1
- package/lib/command/markup/entity/AcApMarkupEntity.d.ts +5 -1
- package/lib/command/markup/entity/AcApMarkupEntity.d.ts.map +1 -1
- package/lib/command/markup/entity/AcApMarkupEntity.js +19 -5
- package/lib/command/markup/entity/AcApMarkupEntity.js.map +1 -1
- package/lib/command/markup/entity/AcApMarkupEntityGrips.d.ts +8 -3
- package/lib/command/markup/entity/AcApMarkupEntityGrips.d.ts.map +1 -1
- package/lib/command/markup/entity/AcApMarkupEntityGrips.js +15 -7
- package/lib/command/markup/entity/AcApMarkupEntityGrips.js.map +1 -1
- package/lib/command/markup/entity/AcApMarkupHighlightEntity.d.ts.map +1 -1
- package/lib/command/markup/entity/AcApMarkupHighlightEntity.js +14 -12
- package/lib/command/markup/entity/AcApMarkupHighlightEntity.js.map +1 -1
- package/lib/command/markup/entity/AcApMarkupSegmentEntity.d.ts.map +1 -1
- package/lib/command/markup/entity/AcApMarkupSegmentEntity.js +8 -6
- package/lib/command/markup/entity/AcApMarkupSegmentEntity.js.map +1 -1
- package/lib/command/markup/entity/AcApMarkupShapeEntity.d.ts.map +1 -1
- package/lib/command/markup/entity/AcApMarkupShapeEntity.js +23 -21
- package/lib/command/markup/entity/AcApMarkupShapeEntity.js.map +1 -1
- package/lib/command/markup/entity/AcApMarkupStampEntity.d.ts.map +1 -1
- package/lib/command/markup/entity/AcApMarkupStampEntity.js +1 -0
- package/lib/command/markup/entity/AcApMarkupStampEntity.js.map +1 -1
- package/lib/command/markup/entity/AcApMarkupTextEntity.d.ts.map +1 -1
- package/lib/command/markup/entity/AcApMarkupTextEntity.js +1 -0
- package/lib/command/markup/entity/AcApMarkupTextEntity.js.map +1 -1
- package/lib/command/markup/index.d.ts +4 -0
- package/lib/command/markup/index.d.ts.map +1 -1
- package/lib/command/markup/index.js +5 -0
- package/lib/command/markup/index.js.map +1 -1
- package/lib/command/measure/AcApMeasureAngleArc.d.ts +27 -0
- package/lib/command/measure/AcApMeasureAngleArc.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasureAngleArc.js +22 -0
- package/lib/command/measure/AcApMeasureAngleArc.js.map +1 -0
- package/lib/command/measure/AcApMeasureAngleCmd.d.ts +2 -3
- package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureAngleCmd.js +46 -45
- package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.d.ts +2 -3
- package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.js +71 -67
- package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureAreaCmd.d.ts +2 -3
- package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureAreaCmd.js +102 -99
- package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureContinuousCmd.d.ts +44 -0
- package/lib/command/measure/AcApMeasureContinuousCmd.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasureContinuousCmd.js +317 -0
- package/lib/command/measure/AcApMeasureContinuousCmd.js.map +1 -0
- package/lib/command/measure/AcApMeasureDistanceCmd.d.ts +3 -3
- package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureDistanceCmd.js +41 -37
- package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureDrawCmd.d.ts +32 -0
- package/lib/command/measure/AcApMeasureDrawCmd.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasureDrawCmd.js +56 -0
- package/lib/command/measure/AcApMeasureDrawCmd.js.map +1 -0
- package/lib/command/measure/AcApMeasurePointCmd.d.ts +2 -3
- package/lib/command/measure/AcApMeasurePointCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasurePointCmd.js +20 -23
- package/lib/command/measure/AcApMeasurePointCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasurementGeometry.d.ts +19 -0
- package/lib/command/measure/AcApMeasurementGeometry.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasurementGeometry.js +53 -3
- package/lib/command/measure/AcApMeasurementGeometry.js.map +1 -1
- package/lib/command/measure/AcApMeasurementHistory.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasurementHistory.js +3 -1
- package/lib/command/measure/AcApMeasurementHistory.js.map +1 -1
- package/lib/command/measure/AcApMeasurementPlace.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasurementPlace.js +22 -5
- package/lib/command/measure/AcApMeasurementPlace.js.map +1 -1
- package/lib/command/measure/AcApMeasurementRepublish.d.ts +35 -0
- package/lib/command/measure/AcApMeasurementRepublish.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementRepublish.js +31 -0
- package/lib/command/measure/AcApMeasurementRepublish.js.map +1 -0
- package/lib/command/measure/AcApMeasurementSidecar.d.ts +2 -1
- package/lib/command/measure/AcApMeasurementSidecar.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasurementSidecar.js +55 -10
- package/lib/command/measure/AcApMeasurementSidecar.js.map +1 -1
- package/lib/command/measure/AcApMeasurementStore.d.ts +45 -2
- package/lib/command/measure/AcApMeasurementStore.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasurementStore.js +277 -33
- package/lib/command/measure/AcApMeasurementStore.js.map +1 -1
- package/lib/command/measure/AcApMeasurementTypes.d.ts +17 -1
- package/lib/command/measure/AcApMeasurementTypes.d.ts.map +1 -1
- package/lib/command/measure/AcApRegisterMeasureCommands.d.ts +8 -0
- package/lib/command/measure/AcApRegisterMeasureCommands.d.ts.map +1 -0
- package/lib/command/measure/AcApRegisterMeasureCommands.js +29 -0
- package/lib/command/measure/AcApRegisterMeasureCommands.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasureAngleEntity.d.ts +3 -5
- package/lib/command/measure/entity/AcApMeasureAngleEntity.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureAngleEntity.js +165 -56
- package/lib/command/measure/entity/AcApMeasureAngleEntity.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureArcEntity.d.ts +5 -8
- package/lib/command/measure/entity/AcApMeasureArcEntity.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureArcEntity.js +251 -53
- package/lib/command/measure/entity/AcApMeasureArcEntity.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureAreaEntity.d.ts +4 -3
- package/lib/command/measure/entity/AcApMeasureAreaEntity.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureAreaEntity.js +154 -28
- package/lib/command/measure/entity/AcApMeasureAreaEntity.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDistanceEntity.d.ts +5 -3
- package/lib/command/measure/entity/AcApMeasureDistanceEntity.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDistanceEntity.js +180 -28
- package/lib/command/measure/entity/AcApMeasureDistanceEntity.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts +20 -8
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js +45 -19
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureEntity.d.ts +41 -6
- package/lib/command/measure/entity/AcApMeasureEntity.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureEntity.js +48 -2
- package/lib/command/measure/entity/AcApMeasureEntity.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureEntityFactory.d.ts +2 -2
- package/lib/command/measure/entity/AcApMeasureEntityFactory.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureEntityFactory.js +10 -3
- package/lib/command/measure/entity/AcApMeasureEntityFactory.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureEntityGrips.d.ts +33 -0
- package/lib/command/measure/entity/AcApMeasureEntityGrips.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasureEntityGrips.js +49 -0
- package/lib/command/measure/entity/AcApMeasureEntityGrips.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasurePointEntity.d.ts +3 -2
- package/lib/command/measure/entity/AcApMeasurePointEntity.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasurePointEntity.js +130 -16
- package/lib/command/measure/entity/AcApMeasurePointEntity.js.map +1 -1
- package/lib/command/measure/entity/index.d.ts +1 -0
- package/lib/command/measure/entity/index.d.ts.map +1 -1
- package/lib/command/measure/entity/index.js +1 -0
- package/lib/command/measure/entity/index.js.map +1 -1
- package/lib/command/measure/index.d.ts +4 -0
- package/lib/command/measure/index.d.ts.map +1 -1
- package/lib/command/measure/index.js +4 -0
- package/lib/command/measure/index.js.map +1 -1
- package/lib/command/overlay/AcApHtmlLivePreview.d.ts +16 -4
- package/lib/command/overlay/AcApHtmlLivePreview.d.ts.map +1 -1
- package/lib/command/overlay/AcApHtmlLivePreview.js +42 -12
- package/lib/command/overlay/AcApHtmlLivePreview.js.map +1 -1
- package/lib/command/overlay/AcApOverlayDrawUtil.d.ts +113 -3
- package/lib/command/overlay/AcApOverlayDrawUtil.d.ts.map +1 -1
- package/lib/command/overlay/AcApOverlayDrawUtil.js +341 -7
- package/lib/command/overlay/AcApOverlayDrawUtil.js.map +1 -1
- package/lib/command/overlay/AcApOverlayGripHost.d.ts +19 -0
- package/lib/command/overlay/AcApOverlayGripHost.d.ts.map +1 -1
- package/lib/command/overlay/AcApOverlayGripHost.js +124 -6
- package/lib/command/overlay/AcApOverlayGripHost.js.map +1 -1
- package/lib/editor/command/AcEdCommand.d.ts +17 -0
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +81 -1
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +14 -3
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +39 -3
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/command/AcEdSessionAccessory.d.ts +82 -0
- package/lib/editor/command/AcEdSessionAccessory.d.ts.map +1 -0
- package/lib/editor/command/AcEdSessionAccessory.js +15 -0
- package/lib/editor/command/AcEdSessionAccessory.js.map +1 -0
- package/lib/editor/command/AcEdSessionProviderRegistry.d.ts +42 -0
- package/lib/editor/command/AcEdSessionProviderRegistry.d.ts.map +1 -0
- package/lib/editor/command/AcEdSessionProviderRegistry.js +54 -0
- package/lib/editor/command/AcEdSessionProviderRegistry.js.map +1 -0
- package/lib/editor/command/index.d.ts +4 -0
- package/lib/editor/command/index.d.ts.map +1 -1
- package/lib/editor/command/index.js +3 -0
- package/lib/editor/command/index.js.map +1 -1
- package/lib/editor/global/AcEdUiColor.d.ts +10 -0
- package/lib/editor/global/AcEdUiColor.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiColor.js +14 -0
- package/lib/editor/global/AcEdUiColor.js.map +1 -1
- package/lib/editor/global/AcEdUiLayout.d.ts +102 -0
- package/lib/editor/global/AcEdUiLayout.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiLayout.js +137 -0
- package/lib/editor/global/AcEdUiLayout.js.map +1 -1
- package/lib/editor/global/AcEdUiTheme.d.ts +15 -3
- package/lib/editor/global/AcEdUiTheme.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiTheme.js +113 -6
- package/lib/editor/global/AcEdUiTheme.js.map +1 -1
- package/lib/editor/grip/AcEdGripAppearance.d.ts +18 -0
- package/lib/editor/grip/AcEdGripAppearance.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripAppearance.js +23 -1
- package/lib/editor/grip/AcEdGripAppearance.js.map +1 -1
- package/lib/editor/grip/AcEdGripEditSession.js +2 -2
- package/lib/editor/grip/AcEdGripEditSession.js.map +1 -1
- package/lib/editor/grip/AcEdGripHandle.d.ts +1 -2
- package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripHandle.js +4 -13
- package/lib/editor/grip/AcEdGripHandle.js.map +1 -1
- package/lib/editor/grip/AcEdGripManager.d.ts +3 -1
- package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripManager.js +30 -14
- package/lib/editor/grip/AcEdGripManager.js.map +1 -1
- package/lib/editor/grip/index.d.ts +1 -0
- package/lib/editor/grip/index.d.ts.map +1 -1
- package/lib/editor/grip/index.js +1 -0
- package/lib/editor/grip/index.js.map +1 -1
- package/lib/editor/input/AcEdDynamicInput.d.ts +15 -0
- package/lib/editor/input/AcEdDynamicInput.d.ts.map +1 -0
- package/lib/editor/input/AcEdDynamicInput.js +22 -0
- package/lib/editor/input/AcEdDynamicInput.js.map +1 -0
- package/lib/editor/input/AcEdOsnapCenterMarks.d.ts +19 -1
- package/lib/editor/input/AcEdOsnapCenterMarks.d.ts.map +1 -1
- package/lib/editor/input/AcEdOsnapCenterMarks.js +53 -9
- package/lib/editor/input/AcEdOsnapCenterMarks.js.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.js +216 -35
- package/lib/editor/input/AcEdOsnapResolver.js.map +1 -1
- package/lib/editor/input/AcEditor.d.ts +14 -1
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +18 -2
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/index.d.ts +1 -0
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +1 -0
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts +12 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +53 -18
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +15 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +24 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdDesktopSessionAccessoryChrome.d.ts +33 -0
- package/lib/editor/input/ui/AcEdDesktopSessionAccessoryChrome.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdDesktopSessionAccessoryChrome.js +85 -0
- package/lib/editor/input/ui/AcEdDesktopSessionAccessoryChrome.js.map +1 -0
- package/lib/editor/input/ui/AcEdEntityPickCancelChrome.d.ts +57 -0
- package/lib/editor/input/ui/AcEdEntityPickCancelChrome.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdEntityPickCancelChrome.js +104 -0
- package/lib/editor/input/ui/AcEdEntityPickCancelChrome.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +144 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +412 -13
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +2 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.js +2 -2
- package/lib/editor/input/ui/AcEdFloatingMessage.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +100 -7
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +805 -164
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdInteractionStrategy.d.ts +94 -0
- package/lib/editor/input/ui/AcEdInteractionStrategy.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdInteractionStrategy.js +60 -0
- package/lib/editor/input/ui/AcEdInteractionStrategy.js.map +1 -0
- package/lib/editor/input/ui/AcEdMobileBoxGesture.d.ts +52 -0
- package/lib/editor/input/ui/AcEdMobileBoxGesture.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdMobileBoxGesture.js +201 -0
- package/lib/editor/input/ui/AcEdMobileBoxGesture.js.map +1 -0
- package/lib/editor/input/ui/AcEdMobileCommandChrome.d.ts +89 -0
- package/lib/editor/input/ui/AcEdMobileCommandChrome.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdMobileCommandChrome.js +143 -0
- package/lib/editor/input/ui/AcEdMobileCommandChrome.js.map +1 -0
- package/lib/editor/input/ui/AcEdMobileSessionMetrics.d.ts +29 -0
- package/lib/editor/input/ui/AcEdMobileSessionMetrics.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdMobileSessionMetrics.js +37 -0
- package/lib/editor/input/ui/AcEdMobileSessionMetrics.js.map +1 -0
- package/lib/editor/input/ui/AcEdMobileSnapLoupe.d.ts +45 -0
- package/lib/editor/input/ui/AcEdMobileSnapLoupe.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdMobileSnapLoupe.js +63 -0
- package/lib/editor/input/ui/AcEdMobileSnapLoupe.js.map +1 -0
- package/lib/editor/input/ui/AcEdSessionAccessoryController.d.ts +113 -0
- package/lib/editor/input/ui/AcEdSessionAccessoryController.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdSessionAccessoryController.js +295 -0
- package/lib/editor/input/ui/AcEdSessionAccessoryController.js.map +1 -0
- package/lib/editor/input/ui/AcEdSimulatedMouseCursor.d.ts +28 -0
- package/lib/editor/input/ui/AcEdSimulatedMouseCursor.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdSimulatedMouseCursor.js +86 -0
- package/lib/editor/input/ui/AcEdSimulatedMouseCursor.js.map +1 -0
- package/lib/editor/input/ui/AcEdSnapLoupe.d.ts +60 -0
- package/lib/editor/input/ui/AcEdSnapLoupe.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdSnapLoupe.js +109 -0
- package/lib/editor/input/ui/AcEdSnapLoupe.js.map +1 -0
- package/lib/editor/input/ui/AcEdSnapLoupeMath.d.ts +47 -0
- package/lib/editor/input/ui/AcEdSnapLoupeMath.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdSnapLoupeMath.js +50 -0
- package/lib/editor/input/ui/AcEdSnapLoupeMath.js.map +1 -0
- package/lib/editor/input/ui/AcEdTouchPickStrategy.d.ts +97 -0
- package/lib/editor/input/ui/AcEdTouchPickStrategy.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdTouchPickStrategy.js +74 -0
- package/lib/editor/input/ui/AcEdTouchPickStrategy.js.map +1 -0
- package/lib/editor/input/ui/AcEdTouchPointSession.d.ts +198 -0
- package/lib/editor/input/ui/AcEdTouchPointSession.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdTouchPointSession.js +329 -0
- package/lib/editor/input/ui/AcEdTouchPointSession.js.map +1 -0
- package/lib/editor/input/ui/AcEdTouchPointTiming.d.ts +18 -0
- package/lib/editor/input/ui/AcEdTouchPointTiming.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdTouchPointTiming.js +18 -0
- package/lib/editor/input/ui/AcEdTouchPointTiming.js.map +1 -0
- package/lib/editor/input/ui/index.d.ts +13 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -1
- package/lib/editor/input/ui/index.js +13 -0
- package/lib/editor/input/ui/index.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +144 -39
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +210 -41
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdViewMode.d.ts +34 -0
- package/lib/editor/view/AcEdViewMode.d.ts.map +1 -0
- package/lib/editor/view/AcEdViewMode.js +35 -0
- package/lib/editor/view/AcEdViewMode.js.map +1 -0
- package/lib/editor/view/index.d.ts +1 -0
- package/lib/editor/view/index.d.ts.map +1 -1
- package/lib/editor/view/index.js +1 -0
- package/lib/editor/view/index.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +1 -1
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +3 -2
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/ar/command.d.ts +465 -0
- package/lib/i18n/ar/command.d.ts.map +1 -0
- package/lib/i18n/ar/command.js +14 -0
- package/lib/i18n/ar/command.js.map +1 -0
- package/lib/i18n/ar/jig.d.ts +1251 -0
- package/lib/i18n/ar/jig.d.ts.map +1 -0
- package/lib/i18n/ar/jig.js +606 -0
- package/lib/i18n/ar/jig.js.map +1 -0
- package/lib/i18n/ar/main.d.ts +133 -0
- package/lib/i18n/ar/main.d.ts.map +1 -0
- package/lib/i18n/ar/main.js +132 -0
- package/lib/i18n/ar/main.js.map +1 -0
- package/lib/i18n/cs/command.d.ts +9 -0
- package/lib/i18n/cs/command.d.ts.map +1 -1
- package/lib/i18n/cs/command.js +9 -0
- package/lib/i18n/cs/command.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +20 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +21 -1
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/cs/main.d.ts +70 -1
- package/lib/i18n/cs/main.d.ts.map +1 -1
- package/lib/i18n/cs/main.js +71 -2
- package/lib/i18n/cs/main.js.map +1 -1
- package/lib/i18n/en/command.d.ts +12 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +12 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +20 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +21 -1
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/en/main.d.ts +70 -1
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +71 -2
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js +8 -0
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/tr/command.d.ts +9 -0
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +9 -0
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +20 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +21 -1
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/tr/main.d.ts +70 -1
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +71 -2
- package/lib/i18n/tr/main.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +12 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +12 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +20 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +21 -1
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +70 -1
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +72 -3
- package/lib/i18n/zh/main.js.map +1 -1
- package/lib/plugin/AcApPluginManager.d.ts +10 -0
- package/lib/plugin/AcApPluginManager.d.ts.map +1 -1
- package/lib/plugin/AcApPluginManager.js +18 -0
- package/lib/plugin/AcApPluginManager.js.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js +11 -4
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
- package/lib/ui/AcUiAciColorDialog.d.ts +57 -0
- package/lib/ui/AcUiAciColorDialog.d.ts.map +1 -0
- package/lib/ui/AcUiAciColorDialog.js +91 -0
- package/lib/ui/AcUiAciColorDialog.js.map +1 -0
- package/lib/ui/AcUiAciPaletteUi.d.ts +118 -0
- package/lib/ui/AcUiAciPaletteUi.d.ts.map +1 -0
- package/lib/ui/AcUiAciPaletteUi.js +521 -0
- package/lib/ui/AcUiAciPaletteUi.js.map +1 -0
- package/lib/ui/AcUiDialog.d.ts +38 -2
- package/lib/ui/AcUiDialog.d.ts.map +1 -1
- package/lib/ui/AcUiDialog.js +45 -16
- package/lib/ui/AcUiDialog.js.map +1 -1
- package/lib/ui/AcUiDrawStyle.d.ts +59 -0
- package/lib/ui/AcUiDrawStyle.d.ts.map +1 -0
- package/lib/ui/AcUiDrawStyle.js +94 -0
- package/lib/ui/AcUiDrawStyle.js.map +1 -0
- package/lib/ui/AcUiDrawStyleSessionAccessory.d.ts +108 -0
- package/lib/ui/AcUiDrawStyleSessionAccessory.d.ts.map +1 -0
- package/lib/ui/AcUiDrawStyleSessionAccessory.js +455 -0
- package/lib/ui/AcUiDrawStyleSessionAccessory.js.map +1 -0
- package/lib/ui/AcUiFullscreenPanel.d.ts +89 -0
- package/lib/ui/AcUiFullscreenPanel.d.ts.map +1 -0
- package/lib/ui/AcUiFullscreenPanel.js +224 -0
- package/lib/ui/AcUiFullscreenPanel.js.map +1 -0
- package/lib/ui/AcUiHelpPanel.d.ts +49 -0
- package/lib/ui/AcUiHelpPanel.d.ts.map +1 -0
- package/lib/ui/AcUiHelpPanel.js +124 -0
- package/lib/ui/AcUiHelpPanel.js.map +1 -0
- package/lib/ui/AcUiMobileSessionPanel.d.ts +174 -0
- package/lib/ui/AcUiMobileSessionPanel.d.ts.map +1 -0
- package/lib/ui/AcUiMobileSessionPanel.js +557 -0
- package/lib/ui/AcUiMobileSessionPanel.js.map +1 -0
- package/lib/ui/AcUiShortCutToolbar.d.ts +136 -0
- package/lib/ui/AcUiShortCutToolbar.d.ts.map +1 -0
- package/lib/ui/AcUiShortCutToolbar.js +250 -0
- package/lib/ui/AcUiShortCutToolbar.js.map +1 -0
- package/lib/ui/AcUiSimpleToolbar.d.ts +110 -0
- package/lib/ui/AcUiSimpleToolbar.d.ts.map +1 -0
- package/lib/ui/AcUiSimpleToolbar.js +431 -0
- package/lib/ui/AcUiSimpleToolbar.js.map +1 -0
- package/lib/ui/AcUiTextHeightDialog.d.ts +85 -0
- package/lib/ui/AcUiTextHeightDialog.d.ts.map +1 -0
- package/lib/ui/AcUiTextHeightDialog.js +205 -0
- package/lib/ui/AcUiTextHeightDialog.js.map +1 -0
- package/lib/ui/AcUiTextHeightDialogHelpers.d.ts +54 -0
- package/lib/ui/AcUiTextHeightDialogHelpers.d.ts.map +1 -0
- package/lib/ui/AcUiTextHeightDialogHelpers.js +128 -0
- package/lib/ui/AcUiTextHeightDialogHelpers.js.map +1 -0
- package/lib/ui/AcUiTouchPointTutorialDialog.d.ts +18 -0
- package/lib/ui/AcUiTouchPointTutorialDialog.d.ts.map +1 -0
- package/lib/ui/AcUiTouchPointTutorialDialog.js +58 -0
- package/lib/ui/AcUiTouchPointTutorialDialog.js.map +1 -0
- package/lib/ui/icons.d.ts +175 -0
- package/lib/ui/icons.d.ts.map +1 -0
- package/lib/ui/icons.js +227 -0
- package/lib/ui/icons.js.map +1 -0
- package/lib/ui/index.d.ts +14 -2
- package/lib/ui/index.d.ts.map +1 -1
- package/lib/ui/index.js +14 -2
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/touch-point-tutorial.d.ts +64 -0
- package/lib/ui/touch-point-tutorial.d.ts.map +1 -0
- package/lib/ui/touch-point-tutorial.js +271 -0
- package/lib/ui/touch-point-tutorial.js.map +1 -0
- package/lib/ui-html-entry.d.ts +31 -0
- package/lib/ui-html-entry.d.ts.map +1 -0
- package/lib/ui-html-entry.js +23 -0
- package/lib/ui-html-entry.js.map +1 -0
- package/lib/util/AcApAciPalette.d.ts +7 -0
- package/lib/util/AcApAciPalette.d.ts.map +1 -0
- package/lib/util/AcApAciPalette.js +51 -0
- package/lib/util/AcApAciPalette.js.map +1 -0
- package/lib/util/AcApCommandUtil.d.ts +15 -0
- package/lib/util/AcApCommandUtil.d.ts.map +1 -0
- package/lib/util/AcApCommandUtil.js +38 -0
- package/lib/util/AcApCommandUtil.js.map +1 -0
- package/lib/util/AcApCssColor.d.ts +10 -0
- package/lib/util/AcApCssColor.d.ts.map +1 -1
- package/lib/util/AcApCssColor.js +52 -0
- package/lib/util/AcApCssColor.js.map +1 -1
- package/lib/util/AcApMeasurementUnits.d.ts +13 -1
- package/lib/util/AcApMeasurementUnits.d.ts.map +1 -1
- package/lib/util/AcApMeasurementUnits.js +144 -10
- package/lib/util/AcApMeasurementUnits.js.map +1 -1
- package/lib/util/AcApMeasurementUtil.d.ts +30 -9
- package/lib/util/AcApMeasurementUtil.d.ts.map +1 -1
- package/lib/util/AcApMeasurementUtil.js +70 -40
- package/lib/util/AcApMeasurementUtil.js.map +1 -1
- package/lib/util/AcApOpenFileErrorMessage.d.ts +25 -0
- package/lib/util/AcApOpenFileErrorMessage.d.ts.map +1 -0
- package/lib/util/AcApOpenFileErrorMessage.js +121 -0
- package/lib/util/AcApOpenFileErrorMessage.js.map +1 -0
- package/lib/util/index.d.ts +3 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +3 -0
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcApCompareDisplay.d.ts +37 -0
- package/lib/view/AcApCompareDisplay.d.ts.map +1 -0
- package/lib/view/AcApCompareDisplay.js +8 -0
- package/lib/view/AcApCompareDisplay.js.map +1 -0
- package/lib/view/AcApReadingMode.d.ts +52 -0
- package/lib/view/AcApReadingMode.d.ts.map +1 -0
- package/lib/view/AcApReadingMode.js +81 -0
- package/lib/view/AcApReadingMode.js.map +1 -0
- package/lib/view/AcEdReviewOverlayPick.d.ts +9 -0
- package/lib/view/AcEdReviewOverlayPick.d.ts.map +1 -1
- package/lib/view/AcEdReviewOverlayPick.js +30 -1
- package/lib/view/AcEdReviewOverlayPick.js.map +1 -1
- package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -1
- package/lib/view/AcEdViewKeyHandler.js +6 -1
- package/lib/view/AcEdViewKeyHandler.js.map +1 -1
- package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts +6 -1
- package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts.map +1 -1
- package/lib/view/AcTrInheritedLayerMaterialMapper.js +9 -1
- package/lib/view/AcTrInheritedLayerMaterialMapper.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +6 -0
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +8 -0
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +12 -0
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +35 -12
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrLayoutView.d.ts +25 -1
- package/lib/view/AcTrLayoutView.d.ts.map +1 -1
- package/lib/view/AcTrLayoutView.js +62 -1
- package/lib/view/AcTrLayoutView.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +7 -0
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +13 -0
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +79 -2
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +407 -57
- package/lib/view/AcTrView2d.js.map +1 -1
- package/lib/view/AcTrViewSessionState.d.ts +32 -0
- package/lib/view/AcTrViewSessionState.d.ts.map +1 -0
- package/lib/view/AcTrViewSessionState.js +2 -0
- package/lib/view/AcTrViewSessionState.js.map +1 -0
- package/lib/view/index.d.ts +3 -0
- package/lib/view/index.d.ts.map +1 -1
- package/lib/view/index.js +3 -0
- package/lib/view/index.js.map +1 -1
- package/package.json +15 -8
- package/src/ui/icons.ts +387 -0
- package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +0 -1
- package/lib/app/AcDbOpenDatabaseOptions.js.map +0 -1
- package/lib/ui/AcApDrawStyle.d.ts +0 -81
- package/lib/ui/AcApDrawStyle.d.ts.map +0 -1
- package/lib/ui/AcApDrawStyle.js +0 -170
- package/lib/ui/AcApDrawStyle.js.map +0 -1
- package/lib/ui/AcApDrawStyleToolbar.d.ts +0 -129
- package/lib/ui/AcApDrawStyleToolbar.d.ts.map +0 -1
- package/lib/ui/AcApDrawStyleToolbar.js +0 -607
- package/lib/ui/AcApDrawStyleToolbar.js.map +0 -1
|
@@ -45,6 +45,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
|
+
var t = {};
|
|
50
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
51
|
+
t[p] = s[p];
|
|
52
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
53
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
55
|
+
t[p[i]] = s[p[i]];
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
};
|
|
48
59
|
var __read = (this && this.__read) || function (o, n) {
|
|
49
60
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
50
61
|
if (!m) return o;
|
|
@@ -84,24 +95,28 @@ var __values = (this && this.__values) || function(o) {
|
|
|
84
95
|
import { AcCmEventManager, AcDbDatabase, AcDbFileType, acdbHostApplicationServices, AcDbSysVarManager, AcGeBox2d, log } from '@mlightcad/data-model';
|
|
85
96
|
import { FontManager } from '@mlightcad/mtext-renderer';
|
|
86
97
|
import { AcTrMTextRenderer } from '@mlightcad/three-renderer';
|
|
87
|
-
import { AcApAboutCmd, AcApArcCmd, AcApCacheFontCmd, AcApCircleCmd,
|
|
88
|
-
import {
|
|
98
|
+
import { AcApAboutCmd, AcApArcCmd, acapBindMarkupSession, AcApCacheFontCmd, AcApCircleCmd, AcApCloseCmd, AcApConvertToDxfCmd, AcApConvertToPngCmd, AcApCopyCmd, AcApDimLinearCmd, acapDisposeMarkupSession, AcApEllipseCmd, AcApEntityPreviewCmd, AcApEraseCmd, AcApHatchCmd, AcApHideObjectsCmd, AcApImageAttachCmd, AcApInsertCmd, AcApLayerCloseCmd, AcApLayerCmd, AcApLayerCurCmd, AcApLayerDelCmd, AcApLayerFreezeCmd, AcApLayerIsoCmd, AcApLayerLockCmd, AcApLayerOnCmd, AcApLayerPCmd, AcApLayerThawCmd, AcApLayerUnisoCmd, AcApLayerUnlockCmd, AcApLayoffCmd, AcApLineCmd, AcApLogCmd, AcApMLineCmd, AcApMoveCmd, AcApMTextCmd, AcApOffsetCmd, AcApOpenCmd, AcApPanCmd, AcApPointCmd, AcApPolygonCmd, AcApPolylineCmd, AcApQNewCmd, AcApRayCmd, AcApReadingModeCmd, AcApRectCmd, AcApRedoCmd, AcApRegenCmd, AcApRevCloudCmd, AcApRotateCmd, AcApSelectCmd, AcApSketchCmd, AcApSplineCmd, AcApSwitchBgCmd, AcApSysVarCmd, AcApUndoCmd, AcApUnisolateObjectsCmd, AcApXAttachCmd, AcApXLineCmd, AcApZoomCmd, resetMarkupSession, resetMeasurementSession } from '../command';
|
|
99
|
+
import { acapGetDrawStyleSessionAccessory } from '../command/AcApDrawStyleSession';
|
|
100
|
+
import { registerMarkupCommands } from '../command/markup/AcApRegisterMarkupCommands';
|
|
101
|
+
import { registerMeasureCommands } from '../command/measure/AcApRegisterMeasureCommands';
|
|
102
|
+
import { AcEdCommandStack, AcEdOpenMode, eventBus } from '../editor';
|
|
89
103
|
import { AcApPluginManager } from '../plugin/AcApPluginManager';
|
|
90
|
-
import { AcApDrawStyleToolbar } from '../ui/AcApDrawStyleToolbar';
|
|
91
104
|
import { isScriptQuitCommand, parseScriptLines } from '../util/AcApScriptParser';
|
|
92
105
|
import { acapWithSecondaryDatabase } from '../util/AcApSecondaryDatabase';
|
|
93
106
|
import { AcTrView2d } from '../view';
|
|
94
107
|
import { AcApBusyIndicator } from './AcApBusyIndicator';
|
|
95
108
|
import { acapBindCommandServices } from './AcApCommandServices';
|
|
96
109
|
import { AcApContext } from './AcApContext';
|
|
110
|
+
import { AcApDocSession } from './AcApDocSession';
|
|
111
|
+
import { ACAP_DEFAULT_DOCS_BASE_URL, acapSetDocsBaseUrl } from './AcApDocsUrl';
|
|
97
112
|
import { AcApDocument } from './AcApDocument';
|
|
98
113
|
import { AcApFontLoader } from './AcApFontLoader';
|
|
114
|
+
import { AcApOpenViewMode } from './AcApOpenDatabaseOptions';
|
|
99
115
|
import { acapInstallOpenFileDialog, acapUninstallOpenFileDialog, acapUpdateOpenFileDialogOptions } from './AcApOpenFileDialog';
|
|
100
116
|
import { AcApOpenFileProfiler } from './AcApOpenFileProfiler';
|
|
101
117
|
import { AcApOpenFileProgressController } from './AcApOpenFileProgressController';
|
|
102
118
|
import { checkWebworkerReadiness, DEFAULT_WEBWORKER_FILE_URLS, resetWebworkerReadinessCache } from './AcApWebworkerReadiness';
|
|
103
119
|
import { AcApXrefManager } from './AcApXrefManager';
|
|
104
|
-
import { AcApOpenViewMode } from './AcDbOpenDatabaseOptions';
|
|
105
120
|
var DEFAULT_BASE_URL = 'https://cdn.jsdelivr.net/gh/mlightcad/cad-data';
|
|
106
121
|
/** Default ISO drawing template loaded by {@link AcApDocManager.newDocument}. */
|
|
107
122
|
var DEFAULT_NEW_DRAWING_TEMPLATE = 'templates/acadiso.dxf';
|
|
@@ -153,7 +168,8 @@ var DEFAULT_COMMAND_ALIASES = {
|
|
|
153
168
|
XLINE: ['XL'],
|
|
154
169
|
ZOOM: ['Z'],
|
|
155
170
|
UNDO: ['U'],
|
|
156
|
-
REDO: ['REDO']
|
|
171
|
+
REDO: ['REDO'],
|
|
172
|
+
READINGMODE: ['RM']
|
|
157
173
|
};
|
|
158
174
|
/** AutoCAD-era default font fallback chain used when glyphs are missing. */
|
|
159
175
|
var DEFAULT_FONTS_PRESET = 'modern';
|
|
@@ -182,13 +198,15 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
182
198
|
function AcApDocManager(options) {
|
|
183
199
|
if (options === void 0) { options = {}; }
|
|
184
200
|
var _this = this;
|
|
185
|
-
var _a, _b, _c, _d;
|
|
201
|
+
var _a, _b, _c, _d, _e;
|
|
202
|
+
/** Open document sessions (MDI). The shared view shows {@link _activeSession}. */
|
|
203
|
+
this._sessions = [];
|
|
204
|
+
/** Monotonic id suffix for {@link AcApDocSession.id}. */
|
|
205
|
+
this._nextSessionId = 1;
|
|
186
206
|
/** Optional OPENPROF session profiler (console stage timings) */
|
|
187
207
|
this._openFileProfiler = new AcApOpenFileProfiler();
|
|
188
208
|
/** Cached worker readiness; null until checked, then true or false */
|
|
189
209
|
this._workersReady = null;
|
|
190
|
-
/** Loaded overlay (reference/base drawing) state, keyed by overlay id */
|
|
191
|
-
this._overlays = new Map();
|
|
192
210
|
/** Monotonically increasing counter used to generate overlay ids */
|
|
193
211
|
this._nextOverlayId = 1;
|
|
194
212
|
/** Events fired during document lifecycle */
|
|
@@ -199,12 +217,20 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
199
217
|
documentCreated: new AcCmEventManager(),
|
|
200
218
|
/** Fired when a document becomes active */
|
|
201
219
|
documentActivated: new AcCmEventManager(),
|
|
220
|
+
/** Fired before a document is activated */
|
|
221
|
+
documentToBeActivated: new AcCmEventManager(),
|
|
222
|
+
/** Fired before a document is closed and destroyed */
|
|
223
|
+
documentToBeDestroyed: new AcCmEventManager(),
|
|
224
|
+
/** Fired after a document has been closed */
|
|
225
|
+
documentDestroyed: new AcCmEventManager(),
|
|
202
226
|
/** Fired when a worker readiness check completes */
|
|
203
227
|
workersReady: new AcCmEventManager()
|
|
204
228
|
};
|
|
205
229
|
this._baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : DEFAULT_BASE_URL;
|
|
230
|
+
acapSetDocsBaseUrl((_b = options.docsBaseUrl) !== null && _b !== void 0 ? _b : ACAP_DEFAULT_DOCS_BASE_URL);
|
|
206
231
|
this._commandAliasOverrides = this.normalizeCommandAliasConfig(options.commandAliases);
|
|
207
232
|
this._openDocumentDefaults = options.openDocumentDefaults;
|
|
233
|
+
this._disableExport = options.disableExport === true;
|
|
208
234
|
if (options.useMainThreadDraw) {
|
|
209
235
|
AcTrMTextRenderer.getInstance().setRenderMode('main');
|
|
210
236
|
}
|
|
@@ -218,7 +244,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
218
244
|
void AcTrMTextRenderer.getInstance().setAwaitFontsBeforeDraw(true);
|
|
219
245
|
// Create one empty drawing
|
|
220
246
|
var doc = new AcApDocument();
|
|
221
|
-
var initialSize = (
|
|
247
|
+
var initialSize = (_d = (_c = options.container) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()) !== null && _d !== void 0 ? _d : {
|
|
222
248
|
width: 300,
|
|
223
249
|
height: 150
|
|
224
250
|
};
|
|
@@ -249,20 +275,26 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
249
275
|
container: options.container,
|
|
250
276
|
calculateSizeCallback: callback
|
|
251
277
|
});
|
|
252
|
-
this.
|
|
253
|
-
|
|
278
|
+
this._mainView = view;
|
|
279
|
+
var context = new AcApContext(view, doc);
|
|
280
|
+
this._activeSession = new AcApDocSession("doc-".concat(this._nextSessionId++), context);
|
|
281
|
+
this._sessions = [this._activeSession];
|
|
282
|
+
acapBindMarkupSession(this._activeSession.id);
|
|
254
283
|
this._fontLoader = new AcApFontLoader();
|
|
284
|
+
// Share one DefaultFontLoader cache between UI catalog and on-demand draws.
|
|
285
|
+
FontManager.instance.setFontLoader(this._fontLoader.fontLoader);
|
|
255
286
|
var fontsUrl = this.resolveFontsBaseUrl();
|
|
256
287
|
this._fontLoader.baseUrl = fontsUrl;
|
|
257
|
-
// On-demand loads go through FontManager's loader, not AcApFontLoader.
|
|
258
288
|
FontManager.instance.baseUrl = fontsUrl;
|
|
259
289
|
acdbHostApplicationServices().workingDatabase = doc.database;
|
|
260
290
|
this._commandManager = new AcEdCommandStack();
|
|
261
291
|
this.registerCommands();
|
|
262
|
-
this._pluginManager = new AcApPluginManager(this.
|
|
263
|
-
var busyHost = (
|
|
292
|
+
this._pluginManager = new AcApPluginManager(this.context, this._commandManager);
|
|
293
|
+
var busyHost = (_e = options.busyIndicatorHost) !== null && _e !== void 0 ? _e : view.container;
|
|
294
|
+
this._busyIndicatorHost = busyHost;
|
|
264
295
|
this._openFileProgress = new AcApOpenFileProgressController(busyHost);
|
|
265
|
-
this._openFileProgress.setSceneBusyGate(function () { return _this.
|
|
296
|
+
this._openFileProgress.setSceneBusyGate(function () { return _this.openProgressView.isProcessingEntities; });
|
|
297
|
+
this._openFileProgress.setOnHidden(function () { return _this.onOpenProgressHidden(); });
|
|
266
298
|
this._busyIndicator = new AcApBusyIndicator(busyHost);
|
|
267
299
|
acapBindCommandServices({
|
|
268
300
|
showMessage: function (message, type, msgKey) {
|
|
@@ -277,22 +309,10 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
277
309
|
this.events.documentToBeOpened.addEventListener(function () {
|
|
278
310
|
_this._openFileProgress.reset();
|
|
279
311
|
});
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
stage: args.stage,
|
|
285
|
-
subStage: args.subStage,
|
|
286
|
-
subStageStatus: args.subStageStatus,
|
|
287
|
-
data: args.data
|
|
288
|
-
});
|
|
289
|
-
// After doc header is loaded, need to set global ltscale and celtscale
|
|
290
|
-
// It's too late when subStage is 'END'
|
|
291
|
-
if (args.subStage === 'HEADER') {
|
|
292
|
-
_this.curView.ltscale = doc.database.ltscale;
|
|
293
|
-
_this.curView.celtscale = doc.database.celtscale;
|
|
294
|
-
_this.curView.renderer.showLineWeight = doc.database.lwdisplay;
|
|
295
|
-
}
|
|
312
|
+
this.bindOpenProgress(doc);
|
|
313
|
+
this.events.documentCreated.dispatch({
|
|
314
|
+
doc: doc,
|
|
315
|
+
mode: doc.openMode
|
|
296
316
|
});
|
|
297
317
|
if (options.preloadDefaultFonts) {
|
|
298
318
|
void this.loadDefaultFonts();
|
|
@@ -350,17 +370,46 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
350
370
|
enumerable: false,
|
|
351
371
|
configurable: true
|
|
352
372
|
});
|
|
373
|
+
/**
|
|
374
|
+
* Returns the singleton when {@link createInstance} has finished, otherwise
|
|
375
|
+
* `undefined`. Safe to call while the constructor is still running.
|
|
376
|
+
*/
|
|
377
|
+
AcApDocManager.tryGetInstance = function () {
|
|
378
|
+
return AcApDocManager._instance;
|
|
379
|
+
};
|
|
353
380
|
/**
|
|
354
381
|
* Destroy the view and unload all plugins
|
|
355
382
|
*/
|
|
356
383
|
AcApDocManager.prototype.destroy = function () {
|
|
357
384
|
return __awaiter(this, void 0, void 0, function () {
|
|
358
|
-
|
|
359
|
-
|
|
385
|
+
var _a, _b, session;
|
|
386
|
+
var e_1, _c;
|
|
387
|
+
var _d;
|
|
388
|
+
return __generator(this, function (_e) {
|
|
389
|
+
switch (_e.label) {
|
|
360
390
|
case 0: return [4 /*yield*/, this._pluginManager.unloadAllPlugins()];
|
|
361
391
|
case 1:
|
|
362
|
-
|
|
363
|
-
this.
|
|
392
|
+
_e.sent();
|
|
393
|
+
(_d = this._splitView) === null || _d === void 0 ? void 0 : _d.stopAnimationLoop();
|
|
394
|
+
this._splitView = undefined;
|
|
395
|
+
try {
|
|
396
|
+
for (_a = __values(__spreadArray([], __read(this._sessions), false)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
397
|
+
session = _b.value;
|
|
398
|
+
session.context.dispose();
|
|
399
|
+
session.doc.destroy();
|
|
400
|
+
if (session.viewState) {
|
|
401
|
+
this.curView.disposeSessionState(session.viewState);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
406
|
+
finally {
|
|
407
|
+
try {
|
|
408
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
409
|
+
}
|
|
410
|
+
finally { if (e_1) throw e_1.error; }
|
|
411
|
+
}
|
|
412
|
+
this._sessions = [];
|
|
364
413
|
acapUninstallOpenFileDialog();
|
|
365
414
|
AcTrMTextRenderer.resetInstance();
|
|
366
415
|
resetWebworkerReadinessCache();
|
|
@@ -419,19 +468,68 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
419
468
|
* @returns The current application context
|
|
420
469
|
*/
|
|
421
470
|
get: function () {
|
|
422
|
-
return this.
|
|
471
|
+
return this._activeSession.context;
|
|
423
472
|
},
|
|
424
473
|
enumerable: false,
|
|
425
474
|
configurable: true
|
|
426
475
|
});
|
|
476
|
+
Object.defineProperty(AcApDocManager.prototype, "documents", {
|
|
477
|
+
/**
|
|
478
|
+
* Open document sessions in tab order.
|
|
479
|
+
*/
|
|
480
|
+
get: function () {
|
|
481
|
+
return this._sessions.map(function (session) { return session.doc; });
|
|
482
|
+
},
|
|
483
|
+
enumerable: false,
|
|
484
|
+
configurable: true
|
|
485
|
+
});
|
|
486
|
+
Object.defineProperty(AcApDocManager.prototype, "documentCount", {
|
|
487
|
+
/**
|
|
488
|
+
* Number of open documents.
|
|
489
|
+
*/
|
|
490
|
+
get: function () {
|
|
491
|
+
return this._sessions.length;
|
|
492
|
+
},
|
|
493
|
+
enumerable: false,
|
|
494
|
+
configurable: true
|
|
495
|
+
});
|
|
496
|
+
Object.defineProperty(AcApDocManager.prototype, "activeSessionId", {
|
|
497
|
+
/**
|
|
498
|
+
* Session id of the active document, for host UI tabs.
|
|
499
|
+
*/
|
|
500
|
+
get: function () {
|
|
501
|
+
return this._activeSession.id;
|
|
502
|
+
},
|
|
503
|
+
enumerable: false,
|
|
504
|
+
configurable: true
|
|
505
|
+
});
|
|
506
|
+
/**
|
|
507
|
+
* Returns the document at `index`, or undefined when out of range.
|
|
508
|
+
*
|
|
509
|
+
* @param index - Zero-based tab order.
|
|
510
|
+
*/
|
|
511
|
+
AcApDocManager.prototype.document = function (index) {
|
|
512
|
+
var _a;
|
|
513
|
+
return (_a = this._sessions[index]) === null || _a === void 0 ? void 0 : _a.doc;
|
|
514
|
+
};
|
|
515
|
+
/**
|
|
516
|
+
* Finds the session that owns `doc`.
|
|
517
|
+
*
|
|
518
|
+
* @param doc - Document to look up.
|
|
519
|
+
*/
|
|
520
|
+
AcApDocManager.prototype.sessionFor = function (doc) {
|
|
521
|
+
return this._sessions.find(function (session) { return session.doc === doc; });
|
|
522
|
+
};
|
|
427
523
|
Object.defineProperty(AcApDocManager.prototype, "curDocument", {
|
|
428
524
|
/**
|
|
429
525
|
* Gets the currently open CAD document.
|
|
430
526
|
*
|
|
527
|
+
* Same as {@link mdiActiveDocument} — the document bound to the shared view.
|
|
528
|
+
*
|
|
431
529
|
* @returns The current document instance
|
|
432
530
|
*/
|
|
433
531
|
get: function () {
|
|
434
|
-
return this.
|
|
532
|
+
return this.context.doc;
|
|
435
533
|
},
|
|
436
534
|
enumerable: false,
|
|
437
535
|
configurable: true
|
|
@@ -440,17 +538,232 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
440
538
|
/**
|
|
441
539
|
* Gets the currently active document.
|
|
442
540
|
*
|
|
443
|
-
* For now, this is the same as `curDocument` since only one document
|
|
444
|
-
* can be active at a time.
|
|
445
|
-
*
|
|
446
541
|
* @returns The current active document
|
|
447
542
|
*/
|
|
448
543
|
get: function () {
|
|
449
|
-
return this.
|
|
544
|
+
return this._activeSession.doc;
|
|
545
|
+
},
|
|
546
|
+
enumerable: false,
|
|
547
|
+
configurable: true
|
|
548
|
+
});
|
|
549
|
+
/**
|
|
550
|
+
* Makes `doc` the command target.
|
|
551
|
+
*
|
|
552
|
+
* When both documents already have their own canvas (split view), scenes
|
|
553
|
+
* stay in place. When they share one canvas (tab MDI), the current scene is
|
|
554
|
+
* parked and the target is restored.
|
|
555
|
+
*
|
|
556
|
+
* @param doc - Document to activate.
|
|
557
|
+
* @returns `false` when `doc` is not an open session.
|
|
558
|
+
*/
|
|
559
|
+
AcApDocManager.prototype.activateDocument = function (doc) {
|
|
560
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
561
|
+
var session, targetView, currentView;
|
|
562
|
+
return __generator(this, function (_a) {
|
|
563
|
+
switch (_a.label) {
|
|
564
|
+
case 0:
|
|
565
|
+
session = this.sessionFor(doc);
|
|
566
|
+
if (!session) {
|
|
567
|
+
return [2 /*return*/, false];
|
|
568
|
+
}
|
|
569
|
+
if (session === this._activeSession) {
|
|
570
|
+
return [2 /*return*/, true];
|
|
571
|
+
}
|
|
572
|
+
targetView = session.context.view;
|
|
573
|
+
currentView = this._activeSession.context.view;
|
|
574
|
+
if (this._openingSession && targetView === currentView) {
|
|
575
|
+
return [2 /*return*/, false];
|
|
576
|
+
}
|
|
577
|
+
return [4 /*yield*/, this._commandManager.cancelActive()];
|
|
578
|
+
case 1:
|
|
579
|
+
_a.sent();
|
|
580
|
+
this.events.documentToBeActivated.dispatch({
|
|
581
|
+
doc: doc,
|
|
582
|
+
mode: doc.openMode
|
|
583
|
+
});
|
|
584
|
+
if (targetView === currentView) {
|
|
585
|
+
this.parkActiveSession();
|
|
586
|
+
this._activeSession = session;
|
|
587
|
+
session.context.resume();
|
|
588
|
+
if (session.viewState) {
|
|
589
|
+
this.curView.restoreSessionState(session.viewState);
|
|
590
|
+
session.viewState = undefined;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
if (this._activeSession !== this._openingSession) {
|
|
595
|
+
this._activeSession.context.suspend();
|
|
596
|
+
}
|
|
597
|
+
this._activeSession = session;
|
|
598
|
+
session.context.resume();
|
|
599
|
+
}
|
|
600
|
+
acapBindMarkupSession(session.id);
|
|
601
|
+
acdbHostApplicationServices().workingDatabase = doc.database;
|
|
602
|
+
this._pluginManager.setContext(session.context);
|
|
603
|
+
this.curView.bindDrawDatabase(doc.database);
|
|
604
|
+
this.events.documentActivated.dispatch({
|
|
605
|
+
doc: doc,
|
|
606
|
+
mode: doc.openMode
|
|
607
|
+
});
|
|
608
|
+
this.setActiveLayout();
|
|
609
|
+
this.curView.syncDisplaySysVars(doc.database);
|
|
610
|
+
if (!this._openingSession) {
|
|
611
|
+
this.syncProgressOverlayHost();
|
|
612
|
+
}
|
|
613
|
+
return [2 /*return*/, true];
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
});
|
|
617
|
+
};
|
|
618
|
+
Object.defineProperty(AcApDocManager.prototype, "mainView", {
|
|
619
|
+
/**
|
|
620
|
+
* Canvas created with {@link createInstance} (left pane in a split layout).
|
|
621
|
+
*/
|
|
622
|
+
get: function () {
|
|
623
|
+
return this._mainView;
|
|
624
|
+
},
|
|
625
|
+
enumerable: false,
|
|
626
|
+
configurable: true
|
|
627
|
+
});
|
|
628
|
+
Object.defineProperty(AcApDocManager.prototype, "splitView", {
|
|
629
|
+
/**
|
|
630
|
+
* Second canvas created by {@link ensureSplitView}, if any.
|
|
631
|
+
*/
|
|
632
|
+
get: function () {
|
|
633
|
+
return this._splitView;
|
|
634
|
+
},
|
|
635
|
+
enumerable: false,
|
|
636
|
+
configurable: true
|
|
637
|
+
});
|
|
638
|
+
/**
|
|
639
|
+
* Creates a second WebGL view in `container` for side-by-side comparison.
|
|
640
|
+
*
|
|
641
|
+
* Each document is converted into one view and stays there. Use
|
|
642
|
+
* {@link openDocument}'s `view` argument to open a file into this canvas,
|
|
643
|
+
* and {@link activateDocument} to choose which side receives commands.
|
|
644
|
+
*
|
|
645
|
+
* @param container - Host element for the second canvas.
|
|
646
|
+
*/
|
|
647
|
+
AcApDocManager.prototype.ensureSplitView = function (container) {
|
|
648
|
+
if (!this._splitView) {
|
|
649
|
+
this._splitView = new AcTrView2d({
|
|
650
|
+
container: container,
|
|
651
|
+
calculateSizeCallback: function () { return ({
|
|
652
|
+
width: Math.max(1, container.clientWidth),
|
|
653
|
+
height: Math.max(1, container.clientHeight)
|
|
654
|
+
}); }
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
else if (this._splitView.container !== container) {
|
|
658
|
+
container.appendChild(this._splitView.container);
|
|
659
|
+
}
|
|
660
|
+
return this._splitView;
|
|
661
|
+
};
|
|
662
|
+
/**
|
|
663
|
+
* @deprecated Use {@link ensureSplitView} and open each file into its own view.
|
|
664
|
+
*
|
|
665
|
+
* @param container - Host element for the second canvas.
|
|
666
|
+
*/
|
|
667
|
+
AcApDocManager.prototype.attachSatelliteView = function (container, _doc) {
|
|
668
|
+
this.ensureSplitView(container);
|
|
669
|
+
return true;
|
|
670
|
+
};
|
|
671
|
+
/**
|
|
672
|
+
* @deprecated Split canvases keep rendering; there is nothing to detach.
|
|
673
|
+
*/
|
|
674
|
+
AcApDocManager.prototype.detachSatelliteView = function () {
|
|
675
|
+
return;
|
|
676
|
+
};
|
|
677
|
+
Object.defineProperty(AcApDocManager.prototype, "satelliteDocument", {
|
|
678
|
+
/**
|
|
679
|
+
* Document currently shown on the split canvas, if a session is bound to it.
|
|
680
|
+
*/
|
|
681
|
+
get: function () {
|
|
682
|
+
var _this = this;
|
|
683
|
+
var _a;
|
|
684
|
+
if (!this._splitView) {
|
|
685
|
+
return undefined;
|
|
686
|
+
}
|
|
687
|
+
return (_a = this._sessions.find(function (session) { return session.context.view === _this._splitView; })) === null || _a === void 0 ? void 0 : _a.doc;
|
|
450
688
|
},
|
|
451
689
|
enumerable: false,
|
|
452
690
|
configurable: true
|
|
453
691
|
});
|
|
692
|
+
/**
|
|
693
|
+
* Closes `doc`, or the active document when omitted.
|
|
694
|
+
*
|
|
695
|
+
* Closing the last document replaces it with a new untitled drawing.
|
|
696
|
+
*
|
|
697
|
+
* @param doc - Document to close; defaults to {@link curDocument}.
|
|
698
|
+
* @returns `false` when `doc` is not an open session.
|
|
699
|
+
*/
|
|
700
|
+
AcApDocManager.prototype.closeDocument = function (doc) {
|
|
701
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
702
|
+
var target, session, wasActive, index, closedView, next;
|
|
703
|
+
return __generator(this, function (_a) {
|
|
704
|
+
switch (_a.label) {
|
|
705
|
+
case 0:
|
|
706
|
+
target = doc !== null && doc !== void 0 ? doc : this.curDocument;
|
|
707
|
+
session = this.sessionFor(target);
|
|
708
|
+
if (!session) {
|
|
709
|
+
return [2 /*return*/, false];
|
|
710
|
+
}
|
|
711
|
+
return [4 /*yield*/, this._commandManager.cancelActive()];
|
|
712
|
+
case 1:
|
|
713
|
+
_a.sent();
|
|
714
|
+
this.events.documentToBeDestroyed.dispatch({
|
|
715
|
+
doc: target,
|
|
716
|
+
mode: target.openMode
|
|
717
|
+
});
|
|
718
|
+
wasActive = session === this._activeSession;
|
|
719
|
+
index = this._sessions.indexOf(session);
|
|
720
|
+
if (this._sessions.length === 1) {
|
|
721
|
+
this.resetActiveSessionToUntitled(session);
|
|
722
|
+
this.events.documentDestroyed.dispatch({
|
|
723
|
+
doc: target,
|
|
724
|
+
mode: target.openMode
|
|
725
|
+
});
|
|
726
|
+
this.events.documentCreated.dispatch({
|
|
727
|
+
doc: this.curDocument,
|
|
728
|
+
mode: this.curDocument.openMode
|
|
729
|
+
});
|
|
730
|
+
this.events.documentActivated.dispatch({
|
|
731
|
+
doc: this.curDocument,
|
|
732
|
+
mode: this.curDocument.openMode
|
|
733
|
+
});
|
|
734
|
+
return [2 /*return*/, true];
|
|
735
|
+
}
|
|
736
|
+
if (wasActive) {
|
|
737
|
+
this.parkActiveSession();
|
|
738
|
+
}
|
|
739
|
+
session.context.dispose();
|
|
740
|
+
target.destroy();
|
|
741
|
+
this.clearSessionOverlays(session);
|
|
742
|
+
acapDisposeMarkupSession(session.id);
|
|
743
|
+
closedView = session.context.view;
|
|
744
|
+
if (session.viewState) {
|
|
745
|
+
closedView.disposeSessionState(session.viewState);
|
|
746
|
+
session.viewState = undefined;
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
closedView.clear();
|
|
750
|
+
}
|
|
751
|
+
this._sessions.splice(index, 1);
|
|
752
|
+
this.events.documentDestroyed.dispatch({
|
|
753
|
+
doc: target,
|
|
754
|
+
mode: target.openMode
|
|
755
|
+
});
|
|
756
|
+
if (!wasActive) return [3 /*break*/, 3];
|
|
757
|
+
next = this._sessions[Math.min(index, this._sessions.length - 1)];
|
|
758
|
+
return [4 /*yield*/, this.activateDocument(next.doc)];
|
|
759
|
+
case 2:
|
|
760
|
+
_a.sent();
|
|
761
|
+
_a.label = 3;
|
|
762
|
+
case 3: return [2 /*return*/, true];
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
});
|
|
766
|
+
};
|
|
454
767
|
Object.defineProperty(AcApDocManager.prototype, "curView", {
|
|
455
768
|
/**
|
|
456
769
|
* Gets the current 2D view used to display the drawing.
|
|
@@ -458,7 +771,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
458
771
|
* @returns The current 2D view instance
|
|
459
772
|
*/
|
|
460
773
|
get: function () {
|
|
461
|
-
return this.
|
|
774
|
+
return this.context.view;
|
|
462
775
|
},
|
|
463
776
|
enumerable: false,
|
|
464
777
|
configurable: true
|
|
@@ -470,7 +783,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
470
783
|
* @returns The current editor instance
|
|
471
784
|
*/
|
|
472
785
|
get: function () {
|
|
473
|
-
return this.
|
|
786
|
+
return this.context.view.editor;
|
|
474
787
|
},
|
|
475
788
|
enumerable: false,
|
|
476
789
|
configurable: true
|
|
@@ -499,13 +812,12 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
499
812
|
enumerable: false,
|
|
500
813
|
configurable: true
|
|
501
814
|
});
|
|
502
|
-
Object.defineProperty(AcApDocManager.prototype, "
|
|
815
|
+
Object.defineProperty(AcApDocManager.prototype, "drawStyleSessionAccessory", {
|
|
503
816
|
/**
|
|
504
|
-
*
|
|
505
|
-
* drawing command is active.
|
|
817
|
+
* Color / font-size session accessory for measurement and markup drawing.
|
|
506
818
|
*/
|
|
507
819
|
get: function () {
|
|
508
|
-
return this.
|
|
820
|
+
return acapGetDrawStyleSessionAccessory(this._mainView);
|
|
509
821
|
},
|
|
510
822
|
enumerable: false,
|
|
511
823
|
configurable: true
|
|
@@ -520,6 +832,17 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
520
832
|
enumerable: false,
|
|
521
833
|
configurable: true
|
|
522
834
|
});
|
|
835
|
+
Object.defineProperty(AcApDocManager.prototype, "disableExport", {
|
|
836
|
+
/**
|
|
837
|
+
* Whether drawing export commands (and host export UI) are disabled.
|
|
838
|
+
* Set via {@link AcApDocManagerOptions.disableExport}; defaults to false.
|
|
839
|
+
*/
|
|
840
|
+
get: function () {
|
|
841
|
+
return this._disableExport;
|
|
842
|
+
},
|
|
843
|
+
enumerable: false,
|
|
844
|
+
configurable: true
|
|
845
|
+
});
|
|
523
846
|
/**
|
|
524
847
|
* Resolves colors for creating new entities.
|
|
525
848
|
*
|
|
@@ -568,6 +891,8 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
568
891
|
* Gets the list of available fonts that can be loaded.
|
|
569
892
|
*
|
|
570
893
|
* Note: These fonts are available for loading but may not be loaded yet.
|
|
894
|
+
* Prefer {@link getAvaiableFonts} when the catalog may not have been fetched yet
|
|
895
|
+
* (lazy font loading no longer preloads metadata at viewer init).
|
|
571
896
|
*
|
|
572
897
|
* @returns Array of available font names
|
|
573
898
|
*/
|
|
@@ -577,6 +902,31 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
577
902
|
enumerable: false,
|
|
578
903
|
configurable: true
|
|
579
904
|
});
|
|
905
|
+
/**
|
|
906
|
+
* Fetches font repository metadata (`fonts.json`) if not already cached.
|
|
907
|
+
* Emits `failed-to-get-avaiable-fonts` and returns `[]` when the catalog cannot
|
|
908
|
+
* be retrieved.
|
|
909
|
+
*/
|
|
910
|
+
AcApDocManager.prototype.getAvaiableFonts = function () {
|
|
911
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
912
|
+
var _a;
|
|
913
|
+
return __generator(this, function (_b) {
|
|
914
|
+
switch (_b.label) {
|
|
915
|
+
case 0:
|
|
916
|
+
_b.trys.push([0, 2, , 3]);
|
|
917
|
+
return [4 /*yield*/, this._fontLoader.getAvaiableFonts()];
|
|
918
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
919
|
+
case 2:
|
|
920
|
+
_a = _b.sent();
|
|
921
|
+
eventBus.emit('failed-to-get-avaiable-fonts', {
|
|
922
|
+
url: this._fontLoader.baseUrl
|
|
923
|
+
});
|
|
924
|
+
return [2 /*return*/, []];
|
|
925
|
+
case 3: return [2 /*return*/];
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
});
|
|
929
|
+
};
|
|
580
930
|
/**
|
|
581
931
|
* Loads the specified fonts for text rendering.
|
|
582
932
|
*
|
|
@@ -605,7 +955,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
605
955
|
*
|
|
606
956
|
* This method loads either the specified fonts or the configured default font
|
|
607
957
|
* fallback chains ({@link DEFAULT_FONTS_PRESET}, currently `modern`: text
|
|
608
|
-
* `
|
|
958
|
+
* `simsun` → `hztxt`, symbol `amgdt`) if no fonts are provided. The loaded
|
|
609
959
|
* fonts are used for rendering CAD text entities like MText and Text in the viewer.
|
|
610
960
|
*
|
|
611
961
|
* It is better to load default fonts when viewer is initialized so that the viewer can
|
|
@@ -652,8 +1002,9 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
652
1002
|
/**
|
|
653
1003
|
* Opens a CAD document from a URL.
|
|
654
1004
|
*
|
|
655
|
-
* This method loads a document from the specified URL
|
|
656
|
-
*
|
|
1005
|
+
* This method loads a document from the specified URL. When the current
|
|
1006
|
+
* drawing is a reusable Untitled, it is replaced; otherwise a new document
|
|
1007
|
+
* session is created and activated.
|
|
657
1008
|
*
|
|
658
1009
|
* @param url - The URL of the CAD file to open
|
|
659
1010
|
* @param options - Optional database opening options. If not provided, default options with font loader will be used
|
|
@@ -669,30 +1020,42 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
669
1020
|
*/
|
|
670
1021
|
AcApDocManager.prototype.openUrl = function (url, options) {
|
|
671
1022
|
return __awaiter(this, void 0, void 0, function () {
|
|
672
|
-
var isSuccess, error_1;
|
|
1023
|
+
var created, isSuccess, error_1;
|
|
673
1024
|
return __generator(this, function (_a) {
|
|
674
1025
|
switch (_a.label) {
|
|
675
1026
|
case 0:
|
|
676
1027
|
options = this.setOptions(options);
|
|
677
|
-
this.
|
|
678
|
-
_a.label = 1;
|
|
1028
|
+
return [4 /*yield*/, this.ensureOpenSession()];
|
|
679
1029
|
case 1:
|
|
680
|
-
_a.
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
1030
|
+
created = _a.sent();
|
|
1031
|
+
this.beginOpenProgress();
|
|
1032
|
+
this.onBeforeOpenDocument(options, !created);
|
|
1033
|
+
_a.label = 2;
|
|
684
1034
|
case 2:
|
|
1035
|
+
_a.trys.push([2, 7, , 10]);
|
|
1036
|
+
return [4 /*yield*/, this._openFileProgress.beginOpen(this.context.doc.database)];
|
|
1037
|
+
case 3:
|
|
685
1038
|
_a.sent();
|
|
686
1039
|
return [4 /*yield*/, this.context.doc.openUri(url, options)];
|
|
687
|
-
case
|
|
1040
|
+
case 4:
|
|
688
1041
|
isSuccess = _a.sent();
|
|
689
1042
|
this.onAfterOpenDocument(isSuccess, options);
|
|
690
|
-
return [
|
|
691
|
-
|
|
1043
|
+
if (!(!isSuccess && created)) return [3 /*break*/, 6];
|
|
1044
|
+
return [4 /*yield*/, this.closeFailedOpenSession()];
|
|
1045
|
+
case 5:
|
|
1046
|
+
_a.sent();
|
|
1047
|
+
_a.label = 6;
|
|
1048
|
+
case 6: return [2 /*return*/, isSuccess];
|
|
1049
|
+
case 7:
|
|
692
1050
|
error_1 = _a.sent();
|
|
693
1051
|
this._openFileProfiler.cancel();
|
|
694
|
-
|
|
695
|
-
|
|
1052
|
+
if (!created) return [3 /*break*/, 9];
|
|
1053
|
+
return [4 /*yield*/, this.closeFailedOpenSession()];
|
|
1054
|
+
case 8:
|
|
1055
|
+
_a.sent();
|
|
1056
|
+
_a.label = 9;
|
|
1057
|
+
case 9: throw error_1;
|
|
1058
|
+
case 10: return [2 /*return*/];
|
|
696
1059
|
}
|
|
697
1060
|
});
|
|
698
1061
|
});
|
|
@@ -700,13 +1063,14 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
700
1063
|
/**
|
|
701
1064
|
* Opens a CAD document from file content.
|
|
702
1065
|
*
|
|
703
|
-
* This method loads a document from the provided file content (binary data)
|
|
704
|
-
*
|
|
705
|
-
*
|
|
1066
|
+
* This method loads a document from the provided file content (binary data).
|
|
1067
|
+
* When the current drawing is a reusable Untitled, it is replaced; otherwise
|
|
1068
|
+
* a new document session is created and activated.
|
|
706
1069
|
*
|
|
707
1070
|
* @param fileName - The name of the file being opened (used for format detection)
|
|
708
1071
|
* @param content - The file content
|
|
709
1072
|
* @param options - Database opening options including font loader settings
|
|
1073
|
+
* @param view - Optional canvas to convert into (split view). Defaults to the active view.
|
|
710
1074
|
* @returns Promise that resolves to true if the document was successfully opened, false otherwise
|
|
711
1075
|
*
|
|
712
1076
|
* @example
|
|
@@ -715,32 +1079,44 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
715
1079
|
* const success = await docManager.openDocument('drawing.dwg', fileContent, options);
|
|
716
1080
|
* ```
|
|
717
1081
|
*/
|
|
718
|
-
AcApDocManager.prototype.openDocument = function (fileName, content, options) {
|
|
1082
|
+
AcApDocManager.prototype.openDocument = function (fileName, content, options, view) {
|
|
719
1083
|
return __awaiter(this, void 0, void 0, function () {
|
|
720
|
-
var isSuccess, error_2;
|
|
1084
|
+
var created, isSuccess, error_2;
|
|
721
1085
|
return __generator(this, function (_a) {
|
|
722
1086
|
switch (_a.label) {
|
|
723
1087
|
case 0:
|
|
724
1088
|
options = this.setOptions(options);
|
|
725
|
-
this.
|
|
726
|
-
_a.label = 1;
|
|
1089
|
+
return [4 /*yield*/, this.ensureOpenSession(view)];
|
|
727
1090
|
case 1:
|
|
728
|
-
_a.
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
1091
|
+
created = _a.sent();
|
|
1092
|
+
this.beginOpenProgress();
|
|
1093
|
+
this.onBeforeOpenDocument(options, !created);
|
|
1094
|
+
_a.label = 2;
|
|
732
1095
|
case 2:
|
|
1096
|
+
_a.trys.push([2, 7, , 10]);
|
|
1097
|
+
return [4 /*yield*/, this._openFileProgress.beginOpen(this.context.doc.database)];
|
|
1098
|
+
case 3:
|
|
733
1099
|
_a.sent();
|
|
734
1100
|
return [4 /*yield*/, this.context.doc.openDocument(fileName, content, options)];
|
|
735
|
-
case
|
|
1101
|
+
case 4:
|
|
736
1102
|
isSuccess = _a.sent();
|
|
737
1103
|
this.onAfterOpenDocument(isSuccess, options);
|
|
738
|
-
return [
|
|
739
|
-
|
|
1104
|
+
if (!(!isSuccess && created)) return [3 /*break*/, 6];
|
|
1105
|
+
return [4 /*yield*/, this.closeFailedOpenSession()];
|
|
1106
|
+
case 5:
|
|
1107
|
+
_a.sent();
|
|
1108
|
+
_a.label = 6;
|
|
1109
|
+
case 6: return [2 /*return*/, isSuccess];
|
|
1110
|
+
case 7:
|
|
740
1111
|
error_2 = _a.sent();
|
|
741
1112
|
this._openFileProfiler.cancel();
|
|
742
|
-
|
|
743
|
-
|
|
1113
|
+
if (!created) return [3 /*break*/, 9];
|
|
1114
|
+
return [4 /*yield*/, this.closeFailedOpenSession()];
|
|
1115
|
+
case 8:
|
|
1116
|
+
_a.sent();
|
|
1117
|
+
_a.label = 9;
|
|
1118
|
+
case 9: throw error_2;
|
|
1119
|
+
case 10: return [2 /*return*/];
|
|
744
1120
|
}
|
|
745
1121
|
});
|
|
746
1122
|
});
|
|
@@ -773,19 +1149,20 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
773
1149
|
*/
|
|
774
1150
|
AcApDocManager.prototype.loadOverlay = function (fileName_1, content_1) {
|
|
775
1151
|
return __awaiter(this, arguments, void 0, function (fileName, content, options) {
|
|
776
|
-
var db, fileExtension;
|
|
1152
|
+
var targetView, dbOptions, db, fileExtension;
|
|
777
1153
|
var _this = this;
|
|
778
1154
|
var _a;
|
|
779
1155
|
if (options === void 0) { options = {}; }
|
|
780
1156
|
return __generator(this, function (_b) {
|
|
781
1157
|
switch (_b.label) {
|
|
782
1158
|
case 0:
|
|
1159
|
+
targetView = options.targetView, dbOptions = __rest(options, ["targetView"]);
|
|
783
1160
|
db = new AcDbDatabase();
|
|
784
1161
|
fileExtension = (_a = fileName.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase();
|
|
785
1162
|
return [4 /*yield*/, acapWithSecondaryDatabase(db, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
786
1163
|
return __generator(this, function (_a) {
|
|
787
1164
|
switch (_a.label) {
|
|
788
|
-
case 0: return [4 /*yield*/, db.read(content, __assign({ readOnly: true },
|
|
1165
|
+
case 0: return [4 /*yield*/, db.read(content, __assign({ readOnly: true }, dbOptions), fileExtension === 'dwg' ? AcDbFileType.DWG : AcDbFileType.DXF)];
|
|
789
1166
|
case 1:
|
|
790
1167
|
_a.sent();
|
|
791
1168
|
return [2 /*return*/];
|
|
@@ -794,7 +1171,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
794
1171
|
}); })];
|
|
795
1172
|
case 1:
|
|
796
1173
|
_b.sent();
|
|
797
|
-
return [2 /*return*/, this.registerOverlayDatabase(db)];
|
|
1174
|
+
return [2 /*return*/, this.registerOverlayDatabase(db, { targetView: targetView })];
|
|
798
1175
|
}
|
|
799
1176
|
});
|
|
800
1177
|
});
|
|
@@ -804,19 +1181,25 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
804
1181
|
*
|
|
805
1182
|
* Prefer this when the caller already loaded the secondary database (e.g.
|
|
806
1183
|
* XATTACH extents preview) to avoid reading the same file twice.
|
|
1184
|
+
*
|
|
1185
|
+
* @param db - Secondary database to draw into the target view.
|
|
1186
|
+
* @param options.targetView - Canvas that receives the overlay (defaults to
|
|
1187
|
+
* the active view). Used by side-by-side → overlay compare without moving scenes.
|
|
807
1188
|
*/
|
|
808
|
-
AcApDocManager.prototype.registerOverlayDatabase = function (db) {
|
|
1189
|
+
AcApDocManager.prototype.registerOverlayDatabase = function (db, options) {
|
|
809
1190
|
return __awaiter(this, void 0, void 0, function () {
|
|
810
|
-
var view, layout, overlayId;
|
|
811
|
-
|
|
812
|
-
|
|
1191
|
+
var view, layout, overlayId, session;
|
|
1192
|
+
var _a, _b;
|
|
1193
|
+
return __generator(this, function (_c) {
|
|
1194
|
+
switch (_c.label) {
|
|
813
1195
|
case 0:
|
|
814
|
-
view = this.curView;
|
|
1196
|
+
view = (_a = options === null || options === void 0 ? void 0 : options.targetView) !== null && _a !== void 0 ? _a : this.curView;
|
|
815
1197
|
return [4 /*yield*/, view.addOverlayEntities(db)];
|
|
816
1198
|
case 1:
|
|
817
|
-
layout =
|
|
1199
|
+
layout = _c.sent();
|
|
818
1200
|
overlayId = "overlay-".concat(this._nextOverlayId++);
|
|
819
|
-
this.
|
|
1201
|
+
session = (_b = this._sessions.find(function (s) { return s.context.view === view; })) !== null && _b !== void 0 ? _b : this._activeSession;
|
|
1202
|
+
session.overlays.set(overlayId, { db: db, layout: layout });
|
|
820
1203
|
view.isDirty = true;
|
|
821
1204
|
return [2 /*return*/, overlayId];
|
|
822
1205
|
}
|
|
@@ -830,15 +1213,32 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
830
1213
|
* @returns True when an overlay with the given id was found and removed.
|
|
831
1214
|
*/
|
|
832
1215
|
AcApDocManager.prototype.removeOverlay = function (overlayId) {
|
|
833
|
-
var
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
1216
|
+
var e_2, _a;
|
|
1217
|
+
try {
|
|
1218
|
+
for (var _b = __values(this._sessions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1219
|
+
var session = _c.value;
|
|
1220
|
+
var overlay = session.overlays.get(overlayId);
|
|
1221
|
+
if (!overlay)
|
|
1222
|
+
continue;
|
|
1223
|
+
var scene = this.sessionCadScene(session);
|
|
1224
|
+
scene.internalScene.remove(overlay.layout.internalObject);
|
|
1225
|
+
overlay.layout.clear();
|
|
1226
|
+
session.overlays.delete(overlayId);
|
|
1227
|
+
if (!session.viewState) {
|
|
1228
|
+
;
|
|
1229
|
+
session.context.view.isDirty = true;
|
|
1230
|
+
}
|
|
1231
|
+
return true;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1235
|
+
finally {
|
|
1236
|
+
try {
|
|
1237
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1238
|
+
}
|
|
1239
|
+
finally { if (e_2) throw e_2.error; }
|
|
1240
|
+
}
|
|
1241
|
+
return false;
|
|
842
1242
|
};
|
|
843
1243
|
/**
|
|
844
1244
|
* Shows or hides a previously loaded overlay without removing it.
|
|
@@ -848,42 +1248,159 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
848
1248
|
* @returns True when an overlay with the given id was found.
|
|
849
1249
|
*/
|
|
850
1250
|
AcApDocManager.prototype.setOverlayVisible = function (overlayId, visible) {
|
|
851
|
-
var
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1251
|
+
var e_3, _a;
|
|
1252
|
+
try {
|
|
1253
|
+
for (var _b = __values(this._sessions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1254
|
+
var session = _c.value;
|
|
1255
|
+
var overlay = session.overlays.get(overlayId);
|
|
1256
|
+
if (!overlay)
|
|
1257
|
+
continue;
|
|
1258
|
+
overlay.layout.visible = visible;
|
|
1259
|
+
session.context.view.isDirty = true;
|
|
1260
|
+
return true;
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1264
|
+
finally {
|
|
1265
|
+
try {
|
|
1266
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1267
|
+
}
|
|
1268
|
+
finally { if (e_3) throw e_3.error; }
|
|
1269
|
+
}
|
|
1270
|
+
return false;
|
|
857
1271
|
};
|
|
858
1272
|
/**
|
|
859
1273
|
* Removes all loaded overlays and disposes their geometry.
|
|
1274
|
+
*
|
|
1275
|
+
* @param view - When set, only overlays on sessions bound to this canvas are cleared.
|
|
860
1276
|
*/
|
|
861
|
-
AcApDocManager.prototype.clearOverlays = function () {
|
|
862
|
-
var
|
|
1277
|
+
AcApDocManager.prototype.clearOverlays = function (view) {
|
|
1278
|
+
var e_4, _a, e_5, _b;
|
|
1279
|
+
var sessions = view
|
|
1280
|
+
? this._sessions.filter(function (s) { return s.context.view === view; })
|
|
1281
|
+
: this._sessions;
|
|
863
1282
|
try {
|
|
864
|
-
for (var
|
|
865
|
-
var
|
|
866
|
-
|
|
1283
|
+
for (var sessions_1 = __values(sessions), sessions_1_1 = sessions_1.next(); !sessions_1_1.done; sessions_1_1 = sessions_1.next()) {
|
|
1284
|
+
var session = sessions_1_1.value;
|
|
1285
|
+
try {
|
|
1286
|
+
for (var _c = (e_5 = void 0, __values(__spreadArray([], __read(session.overlays.keys()), false))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1287
|
+
var overlayId = _d.value;
|
|
1288
|
+
this.removeOverlay(overlayId);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1292
|
+
finally {
|
|
1293
|
+
try {
|
|
1294
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
1295
|
+
}
|
|
1296
|
+
finally { if (e_5) throw e_5.error; }
|
|
1297
|
+
}
|
|
867
1298
|
}
|
|
868
1299
|
}
|
|
869
|
-
catch (
|
|
1300
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
870
1301
|
finally {
|
|
871
1302
|
try {
|
|
872
|
-
if (
|
|
1303
|
+
if (sessions_1_1 && !sessions_1_1.done && (_a = sessions_1.return)) _a.call(sessions_1);
|
|
873
1304
|
}
|
|
874
|
-
finally { if (
|
|
1305
|
+
finally { if (e_4) throw e_4.error; }
|
|
875
1306
|
}
|
|
876
1307
|
};
|
|
1308
|
+
/**
|
|
1309
|
+
* Ids of all currently loaded overlays on the active session (or a view).
|
|
1310
|
+
*
|
|
1311
|
+
* @param view - Optional canvas whose session overlays are listed.
|
|
1312
|
+
*/
|
|
1313
|
+
AcApDocManager.prototype.getOverlayIds = function (view) {
|
|
1314
|
+
if (!view) {
|
|
1315
|
+
return Array.from(this._activeSession.overlays.keys());
|
|
1316
|
+
}
|
|
1317
|
+
var session = this._sessions.find(function (s) { return s.context.view === view; });
|
|
1318
|
+
return session ? Array.from(session.overlays.keys()) : [];
|
|
1319
|
+
};
|
|
877
1320
|
Object.defineProperty(AcApDocManager.prototype, "overlayIds", {
|
|
878
|
-
/**
|
|
879
|
-
* Ids of all currently loaded overlays.
|
|
880
|
-
*/
|
|
1321
|
+
/** @deprecated Prefer {@link getOverlayIds}. */
|
|
881
1322
|
get: function () {
|
|
882
|
-
return
|
|
1323
|
+
return this.getOverlayIds();
|
|
883
1324
|
},
|
|
884
1325
|
enumerable: false,
|
|
885
1326
|
configurable: true
|
|
886
1327
|
});
|
|
1328
|
+
/**
|
|
1329
|
+
* Enables compare-display mode on a view (default: current view).
|
|
1330
|
+
* Does not automatically color overlay layouts — use
|
|
1331
|
+
* {@link setOverlayCompareDisplay} for those.
|
|
1332
|
+
*
|
|
1333
|
+
* @param options - Compare colors and per-entity role overrides.
|
|
1334
|
+
* @param view - Target canvas; defaults to {@link curView}.
|
|
1335
|
+
*/
|
|
1336
|
+
AcApDocManager.prototype.setCompareDisplay = function (options, view) {
|
|
1337
|
+
var target = view !== null && view !== void 0 ? view : this.curView;
|
|
1338
|
+
target.setCompareDisplay(options);
|
|
1339
|
+
};
|
|
1340
|
+
/**
|
|
1341
|
+
* Whether transient reading mode is active on a view (default: current view).
|
|
1342
|
+
*
|
|
1343
|
+
* @param view - Target canvas; defaults to {@link curView}.
|
|
1344
|
+
*/
|
|
1345
|
+
AcApDocManager.prototype.isReadingModeEnabled = function (view) {
|
|
1346
|
+
var target = view !== null && view !== void 0 ? view : this.curView;
|
|
1347
|
+
return target.readingModeEnabled;
|
|
1348
|
+
};
|
|
1349
|
+
/**
|
|
1350
|
+
* Enables or disables transient reading mode on a view (default: current view).
|
|
1351
|
+
*
|
|
1352
|
+
* Reading mode forces black linework on a white canvas without modifying the
|
|
1353
|
+
* drawing database. It shares the compare-display colour path, so it is
|
|
1354
|
+
* mutually exclusive with active compare display on that view.
|
|
1355
|
+
*
|
|
1356
|
+
* @param enabled - When true, enables reading mode; when false, restores the
|
|
1357
|
+
* previous canvas background and entity colours.
|
|
1358
|
+
* @param view - Target canvas; defaults to {@link curView}.
|
|
1359
|
+
*/
|
|
1360
|
+
AcApDocManager.prototype.setReadingMode = function (enabled, view) {
|
|
1361
|
+
var target = view !== null && view !== void 0 ? view : this.curView;
|
|
1362
|
+
target.setReadingMode(enabled);
|
|
1363
|
+
};
|
|
1364
|
+
/**
|
|
1365
|
+
* Toggles transient reading mode on a view (default: current view).
|
|
1366
|
+
*
|
|
1367
|
+
* @param view - Target canvas; defaults to {@link curView}.
|
|
1368
|
+
*/
|
|
1369
|
+
AcApDocManager.prototype.toggleReadingMode = function (view) {
|
|
1370
|
+
var target = view !== null && view !== void 0 ? view : this.curView;
|
|
1371
|
+
target.toggleReadingMode();
|
|
1372
|
+
};
|
|
1373
|
+
/**
|
|
1374
|
+
* Applies compare-display coloring to one overlay layout.
|
|
1375
|
+
*
|
|
1376
|
+
* @param overlayId - Id returned by {@link loadOverlay} / {@link registerOverlayDatabase}.
|
|
1377
|
+
* @param options - Compare colors and per-entity role overrides.
|
|
1378
|
+
* @param view - Canvas that owns the overlay; omitted to search all sessions.
|
|
1379
|
+
* @returns `true` when the overlay id was found.
|
|
1380
|
+
*/
|
|
1381
|
+
AcApDocManager.prototype.setOverlayCompareDisplay = function (overlayId, options, view) {
|
|
1382
|
+
var e_6, _a;
|
|
1383
|
+
var _b;
|
|
1384
|
+
try {
|
|
1385
|
+
for (var _c = __values(this._sessions), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1386
|
+
var session = _d.value;
|
|
1387
|
+
var overlay = session.overlays.get(overlayId);
|
|
1388
|
+
if (!overlay)
|
|
1389
|
+
continue;
|
|
1390
|
+
var target = (_b = view !== null && view !== void 0 ? view : session.context.view) !== null && _b !== void 0 ? _b : this.curView;
|
|
1391
|
+
target.setCompareDisplay(options, overlay.layout);
|
|
1392
|
+
return true;
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1396
|
+
finally {
|
|
1397
|
+
try {
|
|
1398
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1399
|
+
}
|
|
1400
|
+
finally { if (e_6) throw e_6.error; }
|
|
1401
|
+
}
|
|
1402
|
+
return false;
|
|
1403
|
+
};
|
|
887
1404
|
/**
|
|
888
1405
|
* Returns the rendered layout for a loaded overlay, if any.
|
|
889
1406
|
*
|
|
@@ -891,14 +1408,29 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
891
1408
|
* geometry without registering the layout in {@link AcTrScene}.
|
|
892
1409
|
*/
|
|
893
1410
|
AcApDocManager.prototype.getOverlayLayout = function (overlayId) {
|
|
894
|
-
var _a;
|
|
895
|
-
|
|
1411
|
+
var e_7, _a;
|
|
1412
|
+
try {
|
|
1413
|
+
for (var _b = __values(this._sessions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1414
|
+
var session = _c.value;
|
|
1415
|
+
var overlay = session.overlays.get(overlayId);
|
|
1416
|
+
if (overlay)
|
|
1417
|
+
return overlay.layout;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1421
|
+
finally {
|
|
1422
|
+
try {
|
|
1423
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1424
|
+
}
|
|
1425
|
+
finally { if (e_7) throw e_7.error; }
|
|
1426
|
+
}
|
|
1427
|
+
return undefined;
|
|
896
1428
|
};
|
|
897
1429
|
/**
|
|
898
1430
|
* Creates a new CAD document from the default ISO drawing template.
|
|
899
1431
|
*
|
|
900
|
-
*
|
|
901
|
-
*
|
|
1432
|
+
* Loads `acadiso.dxf` into a new document session (or reuses the current
|
|
1433
|
+
* unused Untitled). The new drawing is presented as unsaved.
|
|
902
1434
|
*
|
|
903
1435
|
* @param options - Optional database opening options merged with write mode
|
|
904
1436
|
* @returns Promise that resolves to true if the document was successfully created
|
|
@@ -910,7 +1442,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
910
1442
|
*/
|
|
911
1443
|
AcApDocManager.prototype.newDocument = function (options) {
|
|
912
1444
|
return __awaiter(this, void 0, void 0, function () {
|
|
913
|
-
var baseUrl, templateUrl, openOptions, isSuccess;
|
|
1445
|
+
var baseUrl, templateUrl, openOptions, created, isSuccess;
|
|
914
1446
|
return __generator(this, function (_a) {
|
|
915
1447
|
switch (_a.label) {
|
|
916
1448
|
case 0:
|
|
@@ -919,18 +1451,27 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
919
1451
|
: "".concat(this.baseUrl, "/");
|
|
920
1452
|
templateUrl = "".concat(baseUrl).concat(DEFAULT_NEW_DRAWING_TEMPLATE);
|
|
921
1453
|
openOptions = this.setOptions(__assign(__assign({}, options), { mode: AcEdOpenMode.Write }));
|
|
922
|
-
this.
|
|
923
|
-
return [4 /*yield*/, this._openFileProgress.beginOpen(this.context.doc.database)];
|
|
1454
|
+
return [4 /*yield*/, this.ensureOpenSession()];
|
|
924
1455
|
case 1:
|
|
1456
|
+
created = _a.sent();
|
|
1457
|
+
this.beginOpenProgress();
|
|
1458
|
+
this.onBeforeOpenDocument(openOptions, !created);
|
|
1459
|
+
return [4 /*yield*/, this._openFileProgress.beginOpen(this.context.doc.database)];
|
|
1460
|
+
case 2:
|
|
925
1461
|
_a.sent();
|
|
926
1462
|
return [4 /*yield*/, this.context.doc.openUri(templateUrl, openOptions)];
|
|
927
|
-
case
|
|
1463
|
+
case 3:
|
|
928
1464
|
isSuccess = _a.sent();
|
|
929
1465
|
if (isSuccess) {
|
|
930
1466
|
this.context.doc.resetNewDocumentIdentity();
|
|
931
1467
|
}
|
|
932
1468
|
this.onAfterOpenDocument(isSuccess, openOptions);
|
|
933
|
-
return [
|
|
1469
|
+
if (!(!isSuccess && created)) return [3 /*break*/, 5];
|
|
1470
|
+
return [4 /*yield*/, this.closeFailedOpenSession()];
|
|
1471
|
+
case 4:
|
|
1472
|
+
_a.sent();
|
|
1473
|
+
_a.label = 5;
|
|
1474
|
+
case 5: return [2 /*return*/, isSuccess];
|
|
934
1475
|
}
|
|
935
1476
|
});
|
|
936
1477
|
});
|
|
@@ -1027,8 +1568,8 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1027
1568
|
* Registers all default commands available in the CAD viewer.
|
|
1028
1569
|
*
|
|
1029
1570
|
* This method sets up the command system by registering built-in commands including:
|
|
1030
|
-
* - cdxf: Convert to DXF
|
|
1031
|
-
* - pngout: Export to PNG
|
|
1571
|
+
* - cdxf: Convert to DXF (when {@link AcApDocManagerOptions.disableExport} is false)
|
|
1572
|
+
* - pngout: Export to PNG (when {@link AcApDocManagerOptions.disableExport} is false)
|
|
1032
1573
|
* - log: Output debug information in console
|
|
1033
1574
|
* - open: Open document
|
|
1034
1575
|
* - qnew: Quick new document
|
|
@@ -1062,22 +1603,20 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1062
1603
|
addSystemCommand('arc', 'arc', new AcApArcCmd());
|
|
1063
1604
|
addSystemCommand('cachefont', 'cachefont', new AcApCacheFontCmd());
|
|
1064
1605
|
addSystemCommand('circle', 'circle', new AcApCircleCmd());
|
|
1065
|
-
addSystemCommand('
|
|
1066
|
-
|
|
1606
|
+
addSystemCommand('close', 'close', new AcApCloseCmd());
|
|
1607
|
+
if (!this._disableExport) {
|
|
1608
|
+
addSystemCommand('cdxf', 'cdxf', new AcApConvertToDxfCmd());
|
|
1609
|
+
addSystemCommand('pngout', 'pngout', new AcApConvertToPngCmd());
|
|
1610
|
+
}
|
|
1067
1611
|
addSystemCommand('entout', 'entout', new AcApEntityPreviewCmd());
|
|
1068
1612
|
addSystemCommand('ellipse', 'ellipse', new AcApEllipseCmd());
|
|
1069
1613
|
addSystemCommand('erase', 'erase', new AcApEraseCmd());
|
|
1070
1614
|
addSystemCommand('hideobjects', 'hideobjects', new AcApHideObjectsCmd());
|
|
1071
1615
|
addSystemCommand('dimlinear', 'dimlinear', new AcApDimLinearCmd());
|
|
1072
|
-
addSystemCommand
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
addSystemCommand('measurepoint', 'measurepoint', new AcApMeasurePointCmd());
|
|
1077
|
-
addSystemCommand('clearmeasurements', 'clearmeasurements', new AcApClearMeasurementsCmd());
|
|
1078
|
-
addSystemCommand('measurementvis', 'measurementvis', new AcApMeasurementVisibilityCmd());
|
|
1079
|
-
addSystemCommand('measurementexport', 'measurementexport', new AcApMeasurementExportCmd());
|
|
1080
|
-
addSystemCommand('measurementimport', 'measurementimport', new AcApMeasurementImportCmd());
|
|
1616
|
+
registerMeasureCommands(addSystemCommand, {
|
|
1617
|
+
view: this._mainView,
|
|
1618
|
+
commandManager: this._commandManager
|
|
1619
|
+
});
|
|
1081
1620
|
addSystemCommand('-hatch', '-hatch', new AcApHatchCmd());
|
|
1082
1621
|
addSystemCommand('imageattach', 'imageattach', new AcApImageAttachCmd());
|
|
1083
1622
|
addSystemCommand('-insert', '-insert', new AcApInsertCmd());
|
|
@@ -1113,23 +1652,15 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1113
1652
|
addSystemCommand('rectang', 'rectang', new AcApRectCmd());
|
|
1114
1653
|
addSystemCommand('regen', 'regen', new AcApRegenCmd());
|
|
1115
1654
|
addSystemCommand('revcloud', 'revcloud', new AcApRevCloudCmd());
|
|
1116
|
-
addSystemCommand
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
addSystemCommand('markuprect', 'markuprect', new AcApMarkupRectCmd());
|
|
1121
|
-
addSystemCommand('markupcircle', 'markupcircle', new AcApMarkupCircleCmd());
|
|
1122
|
-
addSystemCommand('markuphighlight', 'markuphighlight', new AcApMarkupHighlightCmd());
|
|
1123
|
-
addSystemCommand('markupcallout', 'markupcallout', new AcApMarkupCalloutCmd());
|
|
1124
|
-
addSystemCommand('markupstamp', 'markupstamp', new AcApMarkupStampCmd());
|
|
1125
|
-
addSystemCommand('markupvis', 'markupvis', new AcApMarkupVisibilityCmd());
|
|
1126
|
-
addSystemCommand('clearmarkups', 'clearmarkups', new AcApClearMarkupsCmd());
|
|
1127
|
-
addSystemCommand('markupexport', 'markupexport', new AcApMarkupExportCmd());
|
|
1128
|
-
addSystemCommand('markupimport', 'markupimport', new AcApMarkupImportCmd());
|
|
1655
|
+
registerMarkupCommands(addSystemCommand, {
|
|
1656
|
+
view: this._mainView,
|
|
1657
|
+
commandManager: this._commandManager
|
|
1658
|
+
});
|
|
1129
1659
|
addSystemCommand('select', 'select', new AcApSelectCmd());
|
|
1130
1660
|
addSystemCommand('sketch', 'sketch', new AcApSketchCmd());
|
|
1131
1661
|
addSystemCommand('spline', 'spline', new AcApSplineCmd());
|
|
1132
1662
|
addSystemCommand('switchbg', 'switchbg', new AcApSwitchBgCmd());
|
|
1663
|
+
addSystemCommand('readingmode', 'readingmode', new AcApReadingModeCmd());
|
|
1133
1664
|
addSystemCommand('unisolateobjects', 'unisolateobjects', new AcApUnisolateObjectsCmd());
|
|
1134
1665
|
addSystemCommand('xline', 'xline', new AcApXLineCmd());
|
|
1135
1666
|
addSystemCommand('undo', 'undo', new AcApUndoCmd());
|
|
@@ -1315,7 +1846,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1315
1846
|
*/
|
|
1316
1847
|
AcApDocManager.prototype.executeNamedCommand = function (cmdName, options) {
|
|
1317
1848
|
return __awaiter(this, void 0, void 0, function () {
|
|
1318
|
-
var documentMode, cmd, loaded
|
|
1849
|
+
var documentMode, cmd, loaded;
|
|
1319
1850
|
var _this = this;
|
|
1320
1851
|
var _a, _b;
|
|
1321
1852
|
return __generator(this, function (_c) {
|
|
@@ -1344,22 +1875,42 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1344
1875
|
// starting this one. The previous command's pending prompt is rejected
|
|
1345
1876
|
// with `AcEdPromptStatus.Cancel`, and we await its `trigger()` settlement
|
|
1346
1877
|
// so its `commandEnded` lifecycle finishes before the new one begins.
|
|
1347
|
-
return [4 /*yield*/, this._commandManager.cancelActive()
|
|
1878
|
+
return [4 /*yield*/, this._commandManager.cancelActive()
|
|
1879
|
+
// markActive must run before trigger(): the first getPoint prompt is
|
|
1880
|
+
// opened synchronously until the first await, and the mobile session
|
|
1881
|
+
// accessory reads commandManager.activeCommand.
|
|
1882
|
+
];
|
|
1348
1883
|
case 3:
|
|
1349
1884
|
// AutoCAD-style command exclusivity: cancel any in-flight command before
|
|
1350
1885
|
// starting this one. The previous command's pending prompt is rejected
|
|
1351
1886
|
// with `AcEdPromptStatus.Cancel`, and we await its `trigger()` settlement
|
|
1352
1887
|
// so its `commandEnded` lifecycle finishes before the new one begins.
|
|
1353
1888
|
_c.sent();
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1889
|
+
// markActive must run before trigger(): the first getPoint prompt is
|
|
1890
|
+
// opened synchronously until the first await, and the mobile session
|
|
1891
|
+
// accessory reads commandManager.activeCommand.
|
|
1892
|
+
return [4 /*yield*/, this._commandManager.runActive(cmd, this.curView, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1893
|
+
return __generator(this, function (_a) {
|
|
1894
|
+
switch (_a.label) {
|
|
1895
|
+
case 0:
|
|
1896
|
+
_a.trys.push([0, , 2, 3]);
|
|
1897
|
+
return [4 /*yield*/, cmd.trigger(this.context)];
|
|
1898
|
+
case 1:
|
|
1899
|
+
_a.sent();
|
|
1900
|
+
return [3 /*break*/, 3];
|
|
1901
|
+
case 2:
|
|
1902
|
+
if (!options.preserveScriptInputs) {
|
|
1903
|
+
this.editor.clearScriptInputs();
|
|
1904
|
+
}
|
|
1905
|
+
return [7 /*endfinally*/];
|
|
1906
|
+
case 3: return [2 /*return*/];
|
|
1907
|
+
}
|
|
1908
|
+
});
|
|
1909
|
+
}); })];
|
|
1362
1910
|
case 4:
|
|
1911
|
+
// markActive must run before trigger(): the first getPoint prompt is
|
|
1912
|
+
// opened synchronously until the first await, and the mobile session
|
|
1913
|
+
// accessory reads commandManager.activeCommand.
|
|
1363
1914
|
_c.sent();
|
|
1364
1915
|
return [2 /*return*/];
|
|
1365
1916
|
}
|
|
@@ -1407,9 +1958,9 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1407
1958
|
* Sets up the active layout block table record ID and model space block table
|
|
1408
1959
|
* record ID based on the current document's space configuration.
|
|
1409
1960
|
*/
|
|
1410
|
-
AcApDocManager.prototype.setActiveLayout = function () {
|
|
1411
|
-
var currentView = this.curView;
|
|
1412
|
-
var db = this.curDocument.database;
|
|
1961
|
+
AcApDocManager.prototype.setActiveLayout = function (view, database) {
|
|
1962
|
+
var currentView = view !== null && view !== void 0 ? view : this.curView;
|
|
1963
|
+
var db = database !== null && database !== void 0 ? database : this.curDocument.database;
|
|
1413
1964
|
currentView.activeLayoutBtrId = db.currentSpaceId;
|
|
1414
1965
|
currentView.modelSpaceBtrId = db.tables.blockTable.modelSpace.objectId;
|
|
1415
1966
|
};
|
|
@@ -1421,23 +1972,30 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1421
1972
|
*
|
|
1422
1973
|
* @protected
|
|
1423
1974
|
*/
|
|
1424
|
-
AcApDocManager.prototype.onBeforeOpenDocument = function (options) {
|
|
1975
|
+
AcApDocManager.prototype.onBeforeOpenDocument = function (options, replaceCurrent) {
|
|
1425
1976
|
var _a, _b;
|
|
1977
|
+
if (replaceCurrent === void 0) { replaceCurrent = true; }
|
|
1426
1978
|
this.events.documentToBeOpened.dispatch({
|
|
1427
1979
|
doc: this.context.doc,
|
|
1428
1980
|
mode: this.getDocumentEventMode(options)
|
|
1429
1981
|
});
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1982
|
+
if (replaceCurrent) {
|
|
1983
|
+
// Drop xref sessions first so their overlay ids are removed via unload.
|
|
1984
|
+
AcApXrefManager.instance.clearAll();
|
|
1985
|
+
this.clearOverlays();
|
|
1986
|
+
// Drop overlay / markup history before view.clear() disposes HTML.
|
|
1987
|
+
resetMeasurementSession();
|
|
1988
|
+
resetMarkupSession();
|
|
1989
|
+
AcApZoomCmd.clearOriginalViews();
|
|
1990
|
+
this.openProgressView.clear();
|
|
1991
|
+
}
|
|
1992
|
+
this.openProgressView.bindDrawDatabase(this.context.doc.database);
|
|
1993
|
+
// Progressive convert/paint is gated by this flag (time-sliced yields in
|
|
1994
|
+
// batchConvert). Camera auto-fit is started separately in onAfter when the
|
|
1995
|
+
// open view mode uses zoom-to-fit — not for restored VPORT/saved views.
|
|
1996
|
+
this.openProgressView.progressiveRendering =
|
|
1435
1997
|
(_a = options === null || options === void 0 ? void 0 : options.progressiveRendering) !== null && _a !== void 0 ? _a : false;
|
|
1436
1998
|
this._openFileProgress.setSeeThroughOverlay((_b = options === null || options === void 0 ? void 0 : options.progressiveRendering) !== null && _b !== void 0 ? _b : false);
|
|
1437
|
-
// Drop overlay / markup history before view.clear() disposes HTML.
|
|
1438
|
-
resetMeasurementSession();
|
|
1439
|
-
resetMarkupSession();
|
|
1440
|
-
this.curView.clear();
|
|
1441
1999
|
// OPENPROF: start stage timings before db.read / entity flush.
|
|
1442
2000
|
this._openFileProfiler.begin(this.context.doc.database);
|
|
1443
2001
|
};
|
|
@@ -1459,17 +2017,19 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1459
2017
|
* @protected
|
|
1460
2018
|
*/
|
|
1461
2019
|
AcApDocManager.prototype.onAfterOpenDocument = function (isSuccess, options) {
|
|
1462
|
-
var _a;
|
|
2020
|
+
var _a, _b;
|
|
1463
2021
|
var recoveredPartialContent = !isSuccess && this.hasRecoverablePartialContent();
|
|
1464
2022
|
if (isSuccess || recoveredPartialContent) {
|
|
1465
|
-
this.
|
|
1466
|
-
var
|
|
2023
|
+
var session = (_a = this._openingSession) !== null && _a !== void 0 ? _a : this._activeSession;
|
|
2024
|
+
var view = session.context.view;
|
|
2025
|
+
session.doc.destroy();
|
|
2026
|
+
var doc = session.doc;
|
|
1467
2027
|
this.events.documentActivated.dispatch({
|
|
1468
2028
|
doc: doc,
|
|
1469
2029
|
mode: this.getDocumentEventMode(options)
|
|
1470
2030
|
});
|
|
1471
|
-
this.setActiveLayout();
|
|
1472
|
-
|
|
2031
|
+
this.setActiveLayout(view, doc.database);
|
|
2032
|
+
view.syncDisplaySysVars(doc.database);
|
|
1473
2033
|
var db = doc.database;
|
|
1474
2034
|
// View framing at document open time (see `openViewMode`):
|
|
1475
2035
|
//
|
|
@@ -1502,10 +2062,11 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1502
2062
|
var activeLayout = acdbHostApplicationServices().layoutManager.getActiveLayout(db);
|
|
1503
2063
|
var layoutLimits = activeLayout === null || activeLayout === void 0 ? void 0 : activeLayout.limits;
|
|
1504
2064
|
var openViewMode = this.resolveOpenViewMode(options);
|
|
1505
|
-
var
|
|
1506
|
-
var
|
|
2065
|
+
var progressiveRendering = (_b = options === null || options === void 0 ? void 0 : options.progressiveRendering) !== null && _b !== void 0 ? _b : false;
|
|
2066
|
+
var framedSynchronously = false;
|
|
1507
2067
|
if (isPaperSpaceActive && layoutLimits && !layoutLimits.isEmpty()) {
|
|
1508
2068
|
view.zoomTo(layoutLimits);
|
|
2069
|
+
framedSynchronously = true;
|
|
1509
2070
|
}
|
|
1510
2071
|
else if (openViewMode === AcApOpenViewMode.Extents) {
|
|
1511
2072
|
if (progressiveRendering) {
|
|
@@ -1522,9 +2083,11 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1522
2083
|
var activeModelViewBox = vport === null || vport === void 0 ? void 0 : vport.modelViewBox(canvasAspect);
|
|
1523
2084
|
if (activeModelViewBox) {
|
|
1524
2085
|
view.zoomTo(activeModelViewBox);
|
|
2086
|
+
framedSynchronously = true;
|
|
1525
2087
|
}
|
|
1526
2088
|
else if (this.hasUsableDrawingExtents(db)) {
|
|
1527
2089
|
view.zoomTo(new AcGeBox2d(db.extmin, db.extmax));
|
|
2090
|
+
framedSynchronously = true;
|
|
1528
2091
|
}
|
|
1529
2092
|
else {
|
|
1530
2093
|
if (progressiveRendering) {
|
|
@@ -1545,14 +2108,18 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1545
2108
|
// state on this layout. Cast is intentional: `setActiveLayout`
|
|
1546
2109
|
// above relies on `curView` being an `AcTrView2d`, and the
|
|
1547
2110
|
// markLayoutAsInitialized method is part of that contract.
|
|
1548
|
-
;
|
|
1549
|
-
|
|
2111
|
+
view.markLayoutAsInitialized(db.currentSpaceId);
|
|
2112
|
+
// `zoomToFitDrawing` frames asynchronously; capture original view in
|
|
2113
|
+
// its completion callback instead of here (pre-fit camera is wrong).
|
|
2114
|
+
if (framedSynchronously) {
|
|
2115
|
+
AcApZoomCmd.rememberOriginalView(view, db.currentSpaceId);
|
|
2116
|
+
}
|
|
1550
2117
|
// OPENPROF: db.read is done; wait for batchConvert to drain, then print.
|
|
1551
2118
|
this._openFileProfiler.markReadCompleteAndScheduleReport(view);
|
|
1552
2119
|
}
|
|
1553
2120
|
else {
|
|
1554
2121
|
this._openFileProfiler.cancel();
|
|
1555
|
-
this.
|
|
2122
|
+
this.openProgressView.endProgressiveOpenFit();
|
|
1556
2123
|
this.regen();
|
|
1557
2124
|
}
|
|
1558
2125
|
};
|
|
@@ -1591,7 +2158,8 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1591
2158
|
* @protected
|
|
1592
2159
|
*/
|
|
1593
2160
|
AcApDocManager.prototype.hasRecoverablePartialContent = function () {
|
|
1594
|
-
var
|
|
2161
|
+
var _a;
|
|
2162
|
+
var db = ((_a = this._openingSession) !== null && _a !== void 0 ? _a : this._activeSession).doc.database;
|
|
1595
2163
|
// `db.extents` comes from the DWG/DXF header, and some DXF files omit it
|
|
1596
2164
|
// entirely, leaving it empty even when entities parsed successfully. Check
|
|
1597
2165
|
// for actual entities in model space first, and only fall back to the
|
|
@@ -1685,6 +2253,60 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1685
2253
|
AcApDocManager.prototype.showBusyIndicator = function (message) {
|
|
1686
2254
|
this._busyIndicator.show(message);
|
|
1687
2255
|
};
|
|
2256
|
+
/**
|
|
2257
|
+
* Moves busy/open-file overlays onto `host`.
|
|
2258
|
+
*
|
|
2259
|
+
* In split view the host is overridden to the canvas being opened or focused.
|
|
2260
|
+
*
|
|
2261
|
+
* @param host - Default overlay parent when not in split view.
|
|
2262
|
+
*/
|
|
2263
|
+
AcApDocManager.prototype.setBusyIndicatorHost = function (host) {
|
|
2264
|
+
this._busyIndicatorHost = host;
|
|
2265
|
+
this.syncProgressOverlayHost();
|
|
2266
|
+
};
|
|
2267
|
+
Object.defineProperty(AcApDocManager.prototype, "openProgressView", {
|
|
2268
|
+
/**
|
|
2269
|
+
* Pins progress overlays to the canvas being opened, or the active canvas
|
|
2270
|
+
* when a split view exists.
|
|
2271
|
+
*/
|
|
2272
|
+
get: function () {
|
|
2273
|
+
var _a, _b;
|
|
2274
|
+
return (_b = (_a = this._openingSession) === null || _a === void 0 ? void 0 : _a.context.view) !== null && _b !== void 0 ? _b : this.curView;
|
|
2275
|
+
},
|
|
2276
|
+
enumerable: false,
|
|
2277
|
+
configurable: true
|
|
2278
|
+
});
|
|
2279
|
+
/**
|
|
2280
|
+
* Pins the open-file overlay to the session that is currently reading a file.
|
|
2281
|
+
*/
|
|
2282
|
+
AcApDocManager.prototype.beginOpenProgress = function () {
|
|
2283
|
+
this._openingSession = this._activeSession;
|
|
2284
|
+
this.syncProgressOverlayHost();
|
|
2285
|
+
};
|
|
2286
|
+
/**
|
|
2287
|
+
* Releases the open-file overlay pin after the spinner hides.
|
|
2288
|
+
*/
|
|
2289
|
+
AcApDocManager.prototype.onOpenProgressHidden = function () {
|
|
2290
|
+
var opening = this._openingSession;
|
|
2291
|
+
this._openingSession = undefined;
|
|
2292
|
+
if (opening &&
|
|
2293
|
+
this._sessions.includes(opening) &&
|
|
2294
|
+
opening !== this._activeSession) {
|
|
2295
|
+
opening.context.suspend();
|
|
2296
|
+
}
|
|
2297
|
+
this.syncProgressOverlayHost();
|
|
2298
|
+
};
|
|
2299
|
+
/**
|
|
2300
|
+
* Pins progress overlays to the canvas being opened when a split view exists.
|
|
2301
|
+
*
|
|
2302
|
+
* @param view - Canvas whose container receives the overlay.
|
|
2303
|
+
*/
|
|
2304
|
+
AcApDocManager.prototype.syncProgressOverlayHost = function (view) {
|
|
2305
|
+
if (view === void 0) { view = this.openProgressView; }
|
|
2306
|
+
var host = this._splitView ? view.container : this._busyIndicatorHost;
|
|
2307
|
+
this._openFileProgress.setHost(host);
|
|
2308
|
+
this._busyIndicator.setHost(host);
|
|
2309
|
+
};
|
|
1688
2310
|
/**
|
|
1689
2311
|
* Hides the spinner overlay shown by {@link showBusyIndicator}.
|
|
1690
2312
|
*
|
|
@@ -1793,6 +2415,172 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1793
2415
|
});
|
|
1794
2416
|
});
|
|
1795
2417
|
};
|
|
2418
|
+
/**
|
|
2419
|
+
* Forwards database open-progress events to the overlay and header sysvars.
|
|
2420
|
+
*
|
|
2421
|
+
* @param doc - Document whose `openProgress` events should drive the overlay.
|
|
2422
|
+
*/
|
|
2423
|
+
AcApDocManager.prototype.bindOpenProgress = function (doc) {
|
|
2424
|
+
var _this = this;
|
|
2425
|
+
doc.database.events.openProgress.addEventListener(function (args) {
|
|
2426
|
+
var _a;
|
|
2427
|
+
_this._openFileProgress.handle({
|
|
2428
|
+
database: doc.database,
|
|
2429
|
+
percentage: args.percentage,
|
|
2430
|
+
stage: args.stage,
|
|
2431
|
+
subStage: args.subStage,
|
|
2432
|
+
subStageStatus: args.subStageStatus,
|
|
2433
|
+
data: args.data
|
|
2434
|
+
});
|
|
2435
|
+
if (args.subStage !== 'HEADER') {
|
|
2436
|
+
return;
|
|
2437
|
+
}
|
|
2438
|
+
var session = _this._sessions.find(function (item) { return item.doc === doc; });
|
|
2439
|
+
var view = (_a = session === null || session === void 0 ? void 0 : session.context.view) !== null && _a !== void 0 ? _a : _this.curView;
|
|
2440
|
+
view.ltscale = doc.database.ltscale;
|
|
2441
|
+
view.celtscale = doc.database.celtscale;
|
|
2442
|
+
view.renderer.showLineWeight = doc.database.lwdisplay;
|
|
2443
|
+
});
|
|
2444
|
+
};
|
|
2445
|
+
/**
|
|
2446
|
+
* Parks the live view onto the active session so another document can take the canvas.
|
|
2447
|
+
*/
|
|
2448
|
+
AcApDocManager.prototype.parkActiveSession = function () {
|
|
2449
|
+
this._activeSession.context.suspend();
|
|
2450
|
+
this._activeSession.viewState = this.curView.captureSessionState();
|
|
2451
|
+
};
|
|
2452
|
+
/**
|
|
2453
|
+
* Reuses an Untitled on `targetView` when it has no file identity and no
|
|
2454
|
+
* entities; otherwise creates a new session on that view.
|
|
2455
|
+
*
|
|
2456
|
+
* When `targetView` is a different canvas (split comparison), the current
|
|
2457
|
+
* view keeps rendering — GPU scenes are never moved between renderers.
|
|
2458
|
+
*
|
|
2459
|
+
* @param targetView - Canvas that will receive the open; defaults to {@link curView}.
|
|
2460
|
+
* @returns True when a new session was created.
|
|
2461
|
+
*/
|
|
2462
|
+
AcApDocManager.prototype.ensureOpenSession = function (targetView) {
|
|
2463
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2464
|
+
var view, occupant, doc, context, session;
|
|
2465
|
+
return __generator(this, function (_a) {
|
|
2466
|
+
switch (_a.label) {
|
|
2467
|
+
case 0:
|
|
2468
|
+
view = targetView !== null && targetView !== void 0 ? targetView : this.curView;
|
|
2469
|
+
if (view === this.curView && this.curDocument.isReusableUntitled) {
|
|
2470
|
+
return [2 /*return*/, false];
|
|
2471
|
+
}
|
|
2472
|
+
occupant = this._sessions.find(function (session) { return session.context.view === view; });
|
|
2473
|
+
if (!(occupant === null || occupant === void 0 ? void 0 : occupant.doc.isReusableUntitled)) return [3 /*break*/, 3];
|
|
2474
|
+
if (!(occupant !== this._activeSession)) return [3 /*break*/, 2];
|
|
2475
|
+
return [4 /*yield*/, this.activateDocument(occupant.doc)];
|
|
2476
|
+
case 1:
|
|
2477
|
+
_a.sent();
|
|
2478
|
+
_a.label = 2;
|
|
2479
|
+
case 2: return [2 /*return*/, false];
|
|
2480
|
+
case 3: return [4 /*yield*/, this._commandManager.cancelActive()];
|
|
2481
|
+
case 4:
|
|
2482
|
+
_a.sent();
|
|
2483
|
+
this._activeSession.context.suspend();
|
|
2484
|
+
if (view === this.curView) {
|
|
2485
|
+
this._activeSession.viewState = this.curView.beginNewSession();
|
|
2486
|
+
}
|
|
2487
|
+
doc = new AcApDocument();
|
|
2488
|
+
context = new AcApContext(view, doc);
|
|
2489
|
+
session = new AcApDocSession("doc-".concat(this._nextSessionId++), context);
|
|
2490
|
+
this._sessions.push(session);
|
|
2491
|
+
this._activeSession = session;
|
|
2492
|
+
acapBindMarkupSession(session.id);
|
|
2493
|
+
acdbHostApplicationServices().workingDatabase = doc.database;
|
|
2494
|
+
this._pluginManager.setContext(context);
|
|
2495
|
+
this.bindOpenProgress(doc);
|
|
2496
|
+
this.events.documentCreated.dispatch({
|
|
2497
|
+
doc: doc,
|
|
2498
|
+
mode: doc.openMode
|
|
2499
|
+
});
|
|
2500
|
+
return [2 /*return*/, true];
|
|
2501
|
+
}
|
|
2502
|
+
});
|
|
2503
|
+
});
|
|
2504
|
+
};
|
|
2505
|
+
/**
|
|
2506
|
+
* Drops a session created for an open that failed before activation completed.
|
|
2507
|
+
*/
|
|
2508
|
+
AcApDocManager.prototype.closeFailedOpenSession = function () {
|
|
2509
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2510
|
+
return __generator(this, function (_a) {
|
|
2511
|
+
switch (_a.label) {
|
|
2512
|
+
case 0:
|
|
2513
|
+
if (this._sessions.length <= 1) {
|
|
2514
|
+
return [2 /*return*/];
|
|
2515
|
+
}
|
|
2516
|
+
return [4 /*yield*/, this.closeDocument(this.curDocument)];
|
|
2517
|
+
case 1:
|
|
2518
|
+
_a.sent();
|
|
2519
|
+
return [2 /*return*/];
|
|
2520
|
+
}
|
|
2521
|
+
});
|
|
2522
|
+
});
|
|
2523
|
+
};
|
|
2524
|
+
/**
|
|
2525
|
+
* Replaces the last remaining session with a fresh Untitled drawing.
|
|
2526
|
+
*
|
|
2527
|
+
* @param session - The only remaining session to recycle.
|
|
2528
|
+
*/
|
|
2529
|
+
AcApDocManager.prototype.resetActiveSessionToUntitled = function (session) {
|
|
2530
|
+
var oldDoc = session.doc;
|
|
2531
|
+
var oldId = session.id;
|
|
2532
|
+
AcApXrefManager.instance.clearAll();
|
|
2533
|
+
this.clearOverlays();
|
|
2534
|
+
resetMeasurementSession();
|
|
2535
|
+
resetMarkupSession();
|
|
2536
|
+
this.curView.clear();
|
|
2537
|
+
session.context.dispose();
|
|
2538
|
+
oldDoc.destroy();
|
|
2539
|
+
acapDisposeMarkupSession(oldId);
|
|
2540
|
+
var doc = new AcApDocument();
|
|
2541
|
+
var context = new AcApContext(this.curView, doc);
|
|
2542
|
+
var replacement = new AcApDocSession("doc-".concat(this._nextSessionId++), context);
|
|
2543
|
+
this._sessions = [replacement];
|
|
2544
|
+
this._activeSession = replacement;
|
|
2545
|
+
acapBindMarkupSession(replacement.id);
|
|
2546
|
+
acdbHostApplicationServices().workingDatabase = doc.database;
|
|
2547
|
+
this._pluginManager.setContext(context);
|
|
2548
|
+
this.bindOpenProgress(doc);
|
|
2549
|
+
this.curView.bindDrawDatabase(doc.database);
|
|
2550
|
+
};
|
|
2551
|
+
/**
|
|
2552
|
+
* Removes overlay layouts belonging to a session being closed.
|
|
2553
|
+
*
|
|
2554
|
+
* @param session - Session whose overlays should be disposed.
|
|
2555
|
+
*/
|
|
2556
|
+
AcApDocManager.prototype.clearSessionOverlays = function (session) {
|
|
2557
|
+
var e_8, _a;
|
|
2558
|
+
var scene = this.sessionCadScene(session);
|
|
2559
|
+
try {
|
|
2560
|
+
for (var _b = __values(session.overlays.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2561
|
+
var overlay = _c.value;
|
|
2562
|
+
scene.internalScene.remove(overlay.layout.internalObject);
|
|
2563
|
+
overlay.layout.clear();
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
2567
|
+
finally {
|
|
2568
|
+
try {
|
|
2569
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2570
|
+
}
|
|
2571
|
+
finally { if (e_8) throw e_8.error; }
|
|
2572
|
+
}
|
|
2573
|
+
session.overlays.clear();
|
|
2574
|
+
};
|
|
2575
|
+
/**
|
|
2576
|
+
* Scene that currently owns `session`'s overlay layouts.
|
|
2577
|
+
* Parked sessions keep overlays on {@link AcApDocSession.viewState}; live
|
|
2578
|
+
* split-view sessions keep them on their own canvas, not {@link curView}.
|
|
2579
|
+
*/
|
|
2580
|
+
AcApDocManager.prototype.sessionCadScene = function (session) {
|
|
2581
|
+
var _a, _b;
|
|
2582
|
+
return ((_b = (_a = session.viewState) === null || _a === void 0 ? void 0 : _a.scene) !== null && _b !== void 0 ? _b : session.context.view.cadScene);
|
|
2583
|
+
};
|
|
1796
2584
|
return AcApDocManager;
|
|
1797
2585
|
}());
|
|
1798
2586
|
export { AcApDocManager };
|