@mlightcad/cad-simple-viewer 1.4.13 → 1.5.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/index.js +16972 -11328
- package/dist/index.umd.cjs +158 -34
- package/dist/libredwg-parser-worker.js +4828 -4464
- package/dist/mtext-renderer-worker.js +3587 -3534
- package/lib/app/AcApDocManager.d.ts +14 -5
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +62 -19
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/command/AcApLogCmd.d.ts +1 -1
- package/lib/command/AcApLogCmd.d.ts.map +1 -1
- package/lib/command/AcApLogCmd.js +1 -1
- package/lib/command/AcApLogCmd.js.map +1 -1
- package/lib/command/AcApOpenCmd.d.ts +1 -1
- package/lib/command/AcApOpenCmd.d.ts.map +1 -1
- package/lib/command/AcApOpenCmd.js +1 -2
- package/lib/command/AcApOpenCmd.js.map +1 -1
- package/lib/command/AcApPanCmd.d.ts +1 -1
- package/lib/command/AcApPanCmd.d.ts.map +1 -1
- package/lib/command/AcApPanCmd.js +1 -2
- package/lib/command/AcApPanCmd.js.map +1 -1
- package/lib/command/AcApQNewCmd.d.ts +1 -1
- package/lib/command/AcApQNewCmd.d.ts.map +1 -1
- package/lib/command/AcApQNewCmd.js +1 -1
- package/lib/command/AcApQNewCmd.js.map +1 -1
- package/lib/command/AcApRegenCmd.d.ts +1 -1
- package/lib/command/AcApRegenCmd.d.ts.map +1 -1
- package/lib/command/AcApRegenCmd.js +1 -1
- package/lib/command/AcApRegenCmd.js.map +1 -1
- package/lib/command/AcApSelectCmd.d.ts +1 -1
- package/lib/command/AcApSelectCmd.d.ts.map +1 -1
- package/lib/command/AcApSelectCmd.js +1 -2
- package/lib/command/AcApSelectCmd.js.map +1 -1
- package/lib/command/{AcApConvertToDxfCmd.d.ts → convert/AcApConvertToDxfCmd.d.ts} +2 -2
- package/lib/command/convert/AcApConvertToDxfCmd.d.ts.map +1 -0
- package/lib/command/{AcApConvertToDxfCmd.js → convert/AcApConvertToDxfCmd.js} +1 -1
- package/lib/command/convert/AcApConvertToDxfCmd.js.map +1 -0
- package/lib/command/{AcApConvertToPngCmd.d.ts → convert/AcApConvertToPngCmd.d.ts} +23 -5
- package/lib/command/convert/AcApConvertToPngCmd.d.ts.map +1 -0
- package/lib/command/{AcApConvertToPngCmd.js → convert/AcApConvertToPngCmd.js} +88 -15
- package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -0
- package/lib/command/{AcApConvertToSvgCmd.d.ts → convert/AcApConvertToSvgCmd.d.ts} +2 -2
- package/lib/command/convert/AcApConvertToSvgCmd.d.ts.map +1 -0
- package/lib/command/{AcApConvertToSvgCmd.js → convert/AcApConvertToSvgCmd.js} +1 -1
- package/lib/command/convert/AcApConvertToSvgCmd.js.map +1 -0
- package/lib/command/convert/AcApDxfConvertor.d.ts.map +1 -0
- package/lib/command/{AcApDxfConvertor.js → convert/AcApDxfConvertor.js} +1 -1
- package/lib/command/convert/AcApDxfConvertor.js.map +1 -0
- package/lib/command/{AcApPngConvertor.d.ts → convert/AcApPngConvertor.d.ts} +20 -35
- package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -0
- package/lib/command/{AcApPngConvertor.js → convert/AcApPngConvertor.js} +99 -71
- package/lib/command/convert/AcApPngConvertor.js.map +1 -0
- package/lib/command/convert/AcApSvgConvertor.d.ts.map +1 -0
- package/lib/command/{AcApSvgConvertor.js → convert/AcApSvgConvertor.js} +1 -1
- package/lib/command/convert/AcApSvgConvertor.js.map +1 -0
- package/lib/command/convert/index.d.ts +6 -0
- package/lib/command/convert/index.d.ts.map +1 -0
- package/lib/command/convert/index.js +6 -0
- package/lib/command/convert/index.js.map +1 -0
- package/lib/command/draw/AcApArcCmd.d.ts +297 -0
- package/lib/command/draw/AcApArcCmd.d.ts.map +1 -0
- package/lib/command/{AcApArcCmd.js → draw/AcApArcCmd.js} +793 -12
- package/lib/command/draw/AcApArcCmd.js.map +1 -0
- package/lib/command/{AcApCircleCmd.d.ts → draw/AcApCircleCmd.d.ts} +2 -2
- package/lib/command/draw/AcApCircleCmd.d.ts.map +1 -0
- package/lib/command/{AcApCircleCmd.js → draw/AcApCircleCmd.js} +3 -3
- package/lib/command/draw/AcApCircleCmd.js.map +1 -0
- package/lib/command/{AcApDimLinearCmd.d.ts → draw/AcApDimLinearCmd.d.ts} +2 -2
- package/lib/command/draw/AcApDimLinearCmd.d.ts.map +1 -0
- package/lib/command/{AcApDimLinearCmd.js → draw/AcApDimLinearCmd.js} +3 -3
- package/lib/command/draw/AcApDimLinearCmd.js.map +1 -0
- package/lib/command/{AcApEllipseCmd.d.ts → draw/AcApEllipseCmd.d.ts} +2 -2
- package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -0
- package/lib/command/{AcApEllipseCmd.js → draw/AcApEllipseCmd.js} +3 -3
- package/lib/command/draw/AcApEllipseCmd.js.map +1 -0
- package/lib/command/{AcApHatchCmd.d.ts → draw/AcApHatchCmd.d.ts} +54 -17
- package/lib/command/draw/AcApHatchCmd.d.ts.map +1 -0
- package/lib/command/{AcApHatchCmd.js → draw/AcApHatchCmd.js} +122 -30
- package/lib/command/draw/AcApHatchCmd.js.map +1 -0
- package/lib/command/{AcApLineCmd.d.ts → draw/AcApLineCmd.d.ts} +2 -2
- package/lib/command/draw/AcApLineCmd.d.ts.map +1 -0
- package/lib/command/{AcApLineCmd.js → draw/AcApLineCmd.js} +3 -3
- package/lib/command/draw/AcApLineCmd.js.map +1 -0
- package/lib/command/draw/AcApMLineCmd.d.ts +31 -0
- package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApMLineCmd.js +531 -0
- package/lib/command/draw/AcApMLineCmd.js.map +1 -0
- package/lib/command/{AcApMTextCmd.d.ts → draw/AcApMTextCmd.d.ts} +2 -2
- package/lib/command/draw/AcApMTextCmd.d.ts.map +1 -0
- package/lib/command/{AcApMTextCmd.js → draw/AcApMTextCmd.js} +3 -3
- package/lib/command/draw/AcApMTextCmd.js.map +1 -0
- package/lib/command/draw/AcApPointCmd.d.ts +16 -0
- package/lib/command/draw/AcApPointCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApPointCmd.js +98 -0
- package/lib/command/draw/AcApPointCmd.js.map +1 -0
- package/lib/command/{AcApPolygonCmd.d.ts → draw/AcApPolygonCmd.d.ts} +2 -2
- package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -0
- package/lib/command/{AcApPolygonCmd.js → draw/AcApPolygonCmd.js} +3 -3
- package/lib/command/draw/AcApPolygonCmd.js.map +1 -0
- package/lib/command/{AcApPolylineCmd.d.ts → draw/AcApPolylineCmd.d.ts} +2 -2
- package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -0
- package/lib/command/{AcApPolylineCmd.js → draw/AcApPolylineCmd.js} +3 -3
- package/lib/command/draw/AcApPolylineCmd.js.map +1 -0
- package/lib/command/draw/AcApRayCmd.d.ts +10 -0
- package/lib/command/draw/AcApRayCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApRayCmd.js +145 -0
- package/lib/command/draw/AcApRayCmd.js.map +1 -0
- package/lib/command/{AcApRectCmd.d.ts → draw/AcApRectCmd.d.ts} +2 -2
- package/lib/command/draw/AcApRectCmd.d.ts.map +1 -0
- package/lib/command/{AcApRectCmd.js → draw/AcApRectCmd.js} +3 -3
- package/lib/command/draw/AcApRectCmd.js.map +1 -0
- package/lib/command/{AcApSplineCmd.d.ts → draw/AcApSplineCmd.d.ts} +2 -2
- package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -0
- package/lib/command/{AcApSplineCmd.js → draw/AcApSplineCmd.js} +3 -3
- package/lib/command/draw/AcApSplineCmd.js.map +1 -0
- package/lib/command/draw/AcApXLineCmd.d.ts +25 -0
- package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApXLineCmd.js +210 -0
- package/lib/command/draw/AcApXLineCmd.js.map +1 -0
- package/lib/command/draw/index.d.ts +16 -0
- package/lib/command/draw/index.d.ts.map +1 -0
- package/lib/command/draw/index.js +16 -0
- package/lib/command/draw/index.js.map +1 -0
- package/lib/command/index.d.ts +6 -32
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +6 -32
- package/lib/command/index.js.map +1 -1
- package/lib/command/layer/AcApLayerCloseCmd.d.ts +23 -0
- package/lib/command/layer/AcApLayerCloseCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerCloseCmd.js +86 -0
- package/lib/command/layer/AcApLayerCloseCmd.js.map +1 -0
- package/lib/command/{AcApLayerCmd.d.ts → layer/AcApLayerCmd.d.ts} +3 -5
- package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -0
- package/lib/command/{AcApLayerCmd.js → layer/AcApLayerCmd.js} +5 -8
- package/lib/command/layer/AcApLayerCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerCurCmd.d.ts +43 -0
- package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerCurCmd.js +183 -0
- package/lib/command/layer/AcApLayerCurCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerDelCmd.d.ts +112 -0
- package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerDelCmd.js +446 -0
- package/lib/command/layer/AcApLayerDelCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts +103 -0
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerFreezeCmd.js +398 -0
- package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerIsoCmd.d.ts +99 -0
- package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerIsoCmd.js +485 -0
- package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerIsoState.d.ts +68 -0
- package/lib/command/layer/AcApLayerIsoState.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerIsoState.js +53 -0
- package/lib/command/layer/AcApLayerIsoState.js.map +1 -0
- package/lib/command/layer/AcApLayerLockCmd.d.ts +50 -0
- package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerLockCmd.js +175 -0
- package/lib/command/layer/AcApLayerLockCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerOffCmd.d.ts +95 -0
- package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerOffCmd.js +384 -0
- package/lib/command/layer/AcApLayerOffCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerOnCmd.d.ts +30 -0
- package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerOnCmd.js +138 -0
- package/lib/command/layer/AcApLayerOnCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerPCmd.d.ts +83 -0
- package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerPCmd.js +241 -0
- package/lib/command/layer/AcApLayerPCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerThawCmd.d.ts +37 -0
- package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerThawCmd.js +150 -0
- package/lib/command/layer/AcApLayerThawCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts +52 -0
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerUnisoCmd.js +199 -0
- package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts +50 -0
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerUnlockCmd.js +175 -0
- package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -0
- package/lib/command/layer/index.d.ts +14 -0
- package/lib/command/layer/index.d.ts.map +1 -0
- package/lib/command/layer/index.js +14 -0
- package/lib/command/layer/index.js.map +1 -0
- package/lib/command/{AcApClearMeasurementsCmd.d.ts → measure/AcApClearMeasurementsCmd.d.ts} +2 -2
- package/lib/command/measure/AcApClearMeasurementsCmd.d.ts.map +1 -0
- package/lib/command/{AcApClearMeasurementsCmd.js → measure/AcApClearMeasurementsCmd.js} +1 -1
- package/lib/command/measure/AcApClearMeasurementsCmd.js.map +1 -0
- package/lib/command/{AcApMeasureAngleCmd.d.ts → measure/AcApMeasureAngleCmd.d.ts} +2 -2
- package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -0
- package/lib/command/{AcApMeasureAngleCmd.js → measure/AcApMeasureAngleCmd.js} +3 -3
- package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -0
- package/lib/command/{AcApMeasureArcCmd.d.ts → measure/AcApMeasureArcCmd.d.ts} +2 -2
- package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -0
- package/lib/command/{AcApMeasureArcCmd.js → measure/AcApMeasureArcCmd.js} +3 -3
- package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -0
- package/lib/command/{AcApMeasureAreaCmd.d.ts → measure/AcApMeasureAreaCmd.d.ts} +2 -2
- package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -0
- package/lib/command/{AcApMeasureAreaCmd.js → measure/AcApMeasureAreaCmd.js} +3 -3
- package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -0
- package/lib/command/{AcApMeasureDistanceCmd.d.ts → measure/AcApMeasureDistanceCmd.d.ts} +2 -2
- package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -0
- package/lib/command/{AcApMeasureDistanceCmd.js → measure/AcApMeasureDistanceCmd.js} +3 -3
- package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -0
- package/lib/command/measure/index.d.ts +6 -0
- package/lib/command/measure/index.d.ts.map +1 -0
- package/lib/command/measure/index.js +6 -0
- package/lib/command/measure/index.js.map +1 -0
- package/lib/command/modify/AcApCopyCmd.d.ts +94 -0
- package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -0
- package/lib/command/modify/AcApCopyCmd.js +549 -0
- package/lib/command/modify/AcApCopyCmd.js.map +1 -0
- package/lib/command/{AcApEraseCmd.d.ts → modify/AcApEraseCmd.d.ts} +2 -2
- package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -0
- package/lib/command/{AcApEraseCmd.js → modify/AcApEraseCmd.js} +3 -5
- package/lib/command/modify/AcApEraseCmd.js.map +1 -0
- package/lib/command/{AcApMoveCmd.d.ts → modify/AcApMoveCmd.d.ts} +2 -2
- package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -0
- package/lib/command/{AcApMoveCmd.js → modify/AcApMoveCmd.js} +3 -4
- package/lib/command/modify/AcApMoveCmd.js.map +1 -0
- package/lib/command/modify/AcApRotateCmd.d.ts +81 -0
- package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -0
- package/lib/command/modify/AcApRotateCmd.js +487 -0
- package/lib/command/modify/AcApRotateCmd.js.map +1 -0
- package/lib/command/modify/index.d.ts +5 -0
- package/lib/command/modify/index.d.ts.map +1 -0
- package/lib/command/modify/index.js +5 -0
- package/lib/command/modify/index.js.map +1 -0
- package/lib/command/{AcApBaseRevCmd.d.ts → review/AcApBaseRevCmd.d.ts} +2 -2
- package/lib/command/review/AcApBaseRevCmd.d.ts.map +1 -0
- package/lib/command/{AcApBaseRevCmd.js → review/AcApBaseRevCmd.js} +2 -2
- package/lib/command/review/AcApBaseRevCmd.js.map +1 -0
- package/lib/command/{AcApRevCircleCmd.d.ts → review/AcApRevCircleCmd.d.ts} +1 -1
- package/lib/command/review/AcApRevCircleCmd.d.ts.map +1 -0
- package/lib/command/{AcApRevCircleCmd.js → review/AcApRevCircleCmd.js} +4 -4
- package/lib/command/review/AcApRevCircleCmd.js.map +1 -0
- package/lib/command/{AcApRevCloudCmd.d.ts → review/AcApRevCloudCmd.d.ts} +2 -2
- package/lib/command/review/AcApRevCloudCmd.d.ts.map +1 -0
- package/lib/command/{AcApRevCloudCmd.js → review/AcApRevCloudCmd.js} +3 -3
- package/lib/command/review/AcApRevCloudCmd.js.map +1 -0
- package/lib/command/{AcApRevRectCmd.d.ts → review/AcApRevRectCmd.d.ts} +1 -1
- package/lib/command/review/AcApRevRectCmd.d.ts.map +1 -0
- package/lib/command/{AcApRevRectCmd.js → review/AcApRevRectCmd.js} +3 -3
- package/lib/command/review/AcApRevRectCmd.js.map +1 -0
- package/lib/command/{AcApRevVisibilityCmd.d.ts → review/AcApRevVisibilityCmd.d.ts} +1 -1
- package/lib/command/review/AcApRevVisibilityCmd.d.ts.map +1 -0
- package/lib/command/{AcApRevVisibilityCmd.js → review/AcApRevVisibilityCmd.js} +2 -2
- package/lib/command/review/AcApRevVisibilityCmd.js.map +1 -0
- package/lib/command/{AcApSketchCmd.d.ts → review/AcApSketchCmd.d.ts} +2 -2
- package/lib/command/review/AcApSketchCmd.d.ts.map +1 -0
- package/lib/command/{AcApSketchCmd.js → review/AcApSketchCmd.js} +3 -3
- package/lib/command/review/AcApSketchCmd.js.map +1 -0
- package/lib/command/review/index.d.ts +7 -0
- package/lib/command/review/index.d.ts.map +1 -0
- package/lib/command/review/index.js +7 -0
- package/lib/command/review/index.js.map +1 -0
- package/lib/editor/global/eventBus.d.ts +4 -6
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js.map +1 -1
- package/lib/editor/input/AcEditor.d.ts +17 -0
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +23 -0
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts +6 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.js +16 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +6 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +16 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +25 -23
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +101 -43
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +4 -2
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +21 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +34 -4
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdMessageType.d.ts +10 -0
- package/lib/editor/input/ui/AcEdMessageType.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdMessageType.js +2 -0
- package/lib/editor/input/ui/AcEdMessageType.js.map +1 -0
- package/lib/editor/input/ui/index.d.ts +1 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -1
- package/lib/editor/input/ui/index.js +1 -0
- package/lib/editor/input/ui/index.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +3 -8
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +3 -5
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdHoverController.d.ts +2 -3
- package/lib/editor/view/AcEdHoverController.d.ts.map +1 -1
- package/lib/editor/view/AcEdHoverController.js +7 -0
- package/lib/editor/view/AcEdHoverController.js.map +1 -1
- package/lib/editor/view/AcEdSelectionAction.d.ts +108 -0
- package/lib/editor/view/AcEdSelectionAction.d.ts.map +1 -0
- package/lib/editor/view/AcEdSelectionAction.js +74 -0
- package/lib/editor/view/AcEdSelectionAction.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/en/command.d.ts +135 -15
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +144 -24
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +571 -212
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +661 -302
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +135 -15
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +145 -25
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +571 -212
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +660 -301
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +136 -2
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +154 -16
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +17 -0
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +34 -2
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrPickResultUtil.d.ts +4 -0
- package/lib/view/AcTrPickResultUtil.d.ts.map +1 -0
- package/lib/view/AcTrPickResultUtil.js +54 -0
- package/lib/view/AcTrPickResultUtil.js.map +1 -0
- package/lib/view/AcTrView2d.d.ts +25 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +225 -100
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +6 -6
- package/lib/command/AcApArcCmd.d.ts +0 -140
- package/lib/command/AcApArcCmd.d.ts.map +0 -1
- package/lib/command/AcApArcCmd.js.map +0 -1
- package/lib/command/AcApBaseRevCmd.d.ts.map +0 -1
- package/lib/command/AcApBaseRevCmd.js.map +0 -1
- package/lib/command/AcApCircleCmd.d.ts.map +0 -1
- package/lib/command/AcApCircleCmd.js.map +0 -1
- package/lib/command/AcApClearMeasurementsCmd.d.ts.map +0 -1
- package/lib/command/AcApClearMeasurementsCmd.js.map +0 -1
- package/lib/command/AcApConvertToDxfCmd.d.ts.map +0 -1
- package/lib/command/AcApConvertToDxfCmd.js.map +0 -1
- package/lib/command/AcApConvertToPngCmd.d.ts.map +0 -1
- package/lib/command/AcApConvertToPngCmd.js.map +0 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +0 -1
- package/lib/command/AcApConvertToSvgCmd.js.map +0 -1
- package/lib/command/AcApDimLinearCmd.d.ts.map +0 -1
- package/lib/command/AcApDimLinearCmd.js.map +0 -1
- package/lib/command/AcApDxfConvertor.d.ts.map +0 -1
- package/lib/command/AcApDxfConvertor.js.map +0 -1
- package/lib/command/AcApEllipseCmd.d.ts.map +0 -1
- package/lib/command/AcApEllipseCmd.js.map +0 -1
- package/lib/command/AcApEraseCmd.d.ts.map +0 -1
- package/lib/command/AcApEraseCmd.js.map +0 -1
- package/lib/command/AcApHatchCmd.d.ts.map +0 -1
- package/lib/command/AcApHatchCmd.js.map +0 -1
- package/lib/command/AcApLayerCmd.d.ts.map +0 -1
- package/lib/command/AcApLayerCmd.js.map +0 -1
- package/lib/command/AcApLineCmd.d.ts.map +0 -1
- package/lib/command/AcApLineCmd.js.map +0 -1
- package/lib/command/AcApMTextCmd.d.ts.map +0 -1
- package/lib/command/AcApMTextCmd.js.map +0 -1
- package/lib/command/AcApMeasureAngleCmd.d.ts.map +0 -1
- package/lib/command/AcApMeasureAngleCmd.js.map +0 -1
- package/lib/command/AcApMeasureArcCmd.d.ts.map +0 -1
- package/lib/command/AcApMeasureArcCmd.js.map +0 -1
- package/lib/command/AcApMeasureAreaCmd.d.ts.map +0 -1
- package/lib/command/AcApMeasureAreaCmd.js.map +0 -1
- package/lib/command/AcApMeasureDistanceCmd.d.ts.map +0 -1
- package/lib/command/AcApMeasureDistanceCmd.js.map +0 -1
- package/lib/command/AcApMoveCmd.d.ts.map +0 -1
- package/lib/command/AcApMoveCmd.js.map +0 -1
- package/lib/command/AcApPngConvertor.d.ts.map +0 -1
- package/lib/command/AcApPngConvertor.js.map +0 -1
- package/lib/command/AcApPolygonCmd.d.ts.map +0 -1
- package/lib/command/AcApPolygonCmd.js.map +0 -1
- package/lib/command/AcApPolylineCmd.d.ts.map +0 -1
- package/lib/command/AcApPolylineCmd.js.map +0 -1
- package/lib/command/AcApRectCmd.d.ts.map +0 -1
- package/lib/command/AcApRectCmd.js.map +0 -1
- package/lib/command/AcApRevCircleCmd.d.ts.map +0 -1
- package/lib/command/AcApRevCircleCmd.js.map +0 -1
- package/lib/command/AcApRevCloudCmd.d.ts.map +0 -1
- package/lib/command/AcApRevCloudCmd.js.map +0 -1
- package/lib/command/AcApRevRectCmd.d.ts.map +0 -1
- package/lib/command/AcApRevRectCmd.js.map +0 -1
- package/lib/command/AcApRevVisibilityCmd.d.ts.map +0 -1
- package/lib/command/AcApRevVisibilityCmd.js.map +0 -1
- package/lib/command/AcApSketchCmd.d.ts.map +0 -1
- package/lib/command/AcApSketchCmd.js.map +0 -1
- package/lib/command/AcApSplineCmd.d.ts.map +0 -1
- package/lib/command/AcApSplineCmd.js.map +0 -1
- package/lib/command/AcApSvgConvertor.d.ts.map +0 -1
- package/lib/command/AcApSvgConvertor.js.map +0 -1
- /package/lib/command/{AcApDxfConvertor.d.ts → convert/AcApDxfConvertor.d.ts} +0 -0
- /package/lib/command/{AcApSvgConvertor.d.ts → convert/AcApSvgConvertor.d.ts} +0 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
37
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
38
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
39
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
|
+
function step(op) {
|
|
41
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
43
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
44
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
|
+
switch (op[0]) {
|
|
46
|
+
case 0: case 1: t = op; break;
|
|
47
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
48
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
49
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
50
|
+
default:
|
|
51
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
52
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
53
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
54
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
55
|
+
if (t[2]) _.ops.pop();
|
|
56
|
+
_.trys.pop(); continue;
|
|
57
|
+
}
|
|
58
|
+
op = body.call(thisArg, _);
|
|
59
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
import { AcApDocManager } from '../../app';
|
|
64
|
+
import { AcEdCommand, AcEdOpenMode, AcEdPromptEntityOptions, AcEdPromptKeywordOptions, AcEdPromptStatus } from '../../editor';
|
|
65
|
+
import { AcApI18n } from '../../i18n';
|
|
66
|
+
var DEFAULT_SETTINGS = {
|
|
67
|
+
viewportMode: 'Off',
|
|
68
|
+
blockSelectionMode: 'None'
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* AutoCAD-like `LAYOFF` command.
|
|
72
|
+
*
|
|
73
|
+
* The command repeatedly asks the user to pick an entity and turns off the
|
|
74
|
+
* corresponding layer. It also supports AutoCAD-style `Settings` and `Undo`
|
|
75
|
+
* branches during the same command session.
|
|
76
|
+
*
|
|
77
|
+
* Current viewer limitations:
|
|
78
|
+
* - Only one global viewport is available, so `Vpfreeze` behaves like `Off`.
|
|
79
|
+
* - Nested block/xref sub-entity picking is not exposed yet, so the block
|
|
80
|
+
* selection setting is stored for future use but does not currently change
|
|
81
|
+
* the resolved target layer.
|
|
82
|
+
*/
|
|
83
|
+
var AcApLayoffCmd = /** @class */ (function (_super) {
|
|
84
|
+
__extends(AcApLayoffCmd, _super);
|
|
85
|
+
/**
|
|
86
|
+
* Creates a write-enabled `LAYOFF` command instance.
|
|
87
|
+
*/
|
|
88
|
+
function AcApLayoffCmd() {
|
|
89
|
+
var _this = _super.call(this) || this;
|
|
90
|
+
_this._history = [];
|
|
91
|
+
_this._vpfreezeHintShown = false;
|
|
92
|
+
_this.mode = AcEdOpenMode.Write;
|
|
93
|
+
return _this;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Runs the interactive turn-layer-off workflow until the user cancels.
|
|
97
|
+
*
|
|
98
|
+
* The command keeps an in-memory undo stack for the current invocation and
|
|
99
|
+
* reuses the static settings chosen in previous `LAYOFF` runs.
|
|
100
|
+
*
|
|
101
|
+
* @param context - Active application context used to read and update the current drawing.
|
|
102
|
+
* @returns Resolves when the command loop ends.
|
|
103
|
+
*/
|
|
104
|
+
AcApLayoffCmd.prototype.execute = function (context) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
var action;
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
switch (_a.label) {
|
|
109
|
+
case 0:
|
|
110
|
+
this._history = [];
|
|
111
|
+
this._vpfreezeHintShown =
|
|
112
|
+
AcApLayoffCmd._settings.viewportMode !== 'Vpfreeze';
|
|
113
|
+
_a.label = 1;
|
|
114
|
+
case 1:
|
|
115
|
+
if (!true) return [3 /*break*/, 7];
|
|
116
|
+
return [4 /*yield*/, this.promptSelection()];
|
|
117
|
+
case 2:
|
|
118
|
+
action = _a.sent();
|
|
119
|
+
if (!action)
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
if (!(action.type === 'keyword')) return [3 /*break*/, 6];
|
|
122
|
+
if (!(action.keyword === 'Settings')) return [3 /*break*/, 4];
|
|
123
|
+
return [4 /*yield*/, this.runSettings()];
|
|
124
|
+
case 3:
|
|
125
|
+
_a.sent();
|
|
126
|
+
return [3 /*break*/, 5];
|
|
127
|
+
case 4:
|
|
128
|
+
this.runUndo(context);
|
|
129
|
+
_a.label = 5;
|
|
130
|
+
case 5: return [3 /*break*/, 1];
|
|
131
|
+
case 6:
|
|
132
|
+
this.turnOffEntityLayer(context, action.objectId);
|
|
133
|
+
return [3 /*break*/, 1];
|
|
134
|
+
case 7: return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Sends a localized status message through the command-line output.
|
|
141
|
+
*
|
|
142
|
+
* @param message - Text to display to the user.
|
|
143
|
+
* @param type - Visual severity mapped to command-line message styles.
|
|
144
|
+
*/
|
|
145
|
+
AcApLayoffCmd.prototype.notify = function (message, type) {
|
|
146
|
+
if (type === void 0) { type = 'info'; }
|
|
147
|
+
AcApDocManager.instance.editor.showMessage(message, type);
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Registers a localized keyword on an entity or keyword prompt.
|
|
151
|
+
*
|
|
152
|
+
* @param prompt - Prompt instance that should expose the keyword to the user.
|
|
153
|
+
* @param key - I18n keyword identifier under `jig.layoff.keywords`.
|
|
154
|
+
*/
|
|
155
|
+
AcApLayoffCmd.prototype.addKeyword = function (prompt, key) {
|
|
156
|
+
prompt.keywords.add(AcApI18n.t("jig.layoff.keywords.".concat(key, ".display")), AcApI18n.t("jig.layoff.keywords.".concat(key, ".global")), AcApI18n.t("jig.layoff.keywords.".concat(key, ".local")));
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Prompts for either a picked entity or one of the top-level command keywords.
|
|
160
|
+
*
|
|
161
|
+
* @returns Resolved selection or keyword action, or `undefined` when the user cancels.
|
|
162
|
+
*/
|
|
163
|
+
AcApLayoffCmd.prototype.promptSelection = function () {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
165
|
+
var prompt, result;
|
|
166
|
+
return __generator(this, function (_a) {
|
|
167
|
+
switch (_a.label) {
|
|
168
|
+
case 0:
|
|
169
|
+
prompt = new AcEdPromptEntityOptions(AcApI18n.t('jig.layoff.prompt'));
|
|
170
|
+
prompt.allowNone = true;
|
|
171
|
+
prompt.allowObjectOnLockedLayer = true;
|
|
172
|
+
prompt.setRejectMessage(AcApI18n.t('jig.layoff.invalidSelection'));
|
|
173
|
+
this.addKeyword(prompt, 'settings');
|
|
174
|
+
this.addKeyword(prompt, 'undo');
|
|
175
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getEntity(prompt)];
|
|
176
|
+
case 1:
|
|
177
|
+
result = _a.sent();
|
|
178
|
+
if (result.status === AcEdPromptStatus.OK && result.objectId) {
|
|
179
|
+
return [2 /*return*/, {
|
|
180
|
+
type: 'entity',
|
|
181
|
+
objectId: result.objectId
|
|
182
|
+
}];
|
|
183
|
+
}
|
|
184
|
+
if (result.status === AcEdPromptStatus.Keyword &&
|
|
185
|
+
(result.stringResult === 'Settings' || result.stringResult === 'Undo')) {
|
|
186
|
+
return [2 /*return*/, {
|
|
187
|
+
type: 'keyword',
|
|
188
|
+
keyword: result.stringResult
|
|
189
|
+
}];
|
|
190
|
+
}
|
|
191
|
+
return [2 /*return*/, undefined];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Opens the `Settings` branch and keeps prompting until the user exits it.
|
|
198
|
+
*
|
|
199
|
+
* @returns Resolves when the settings submenu is closed.
|
|
200
|
+
*/
|
|
201
|
+
AcApLayoffCmd.prototype.runSettings = function () {
|
|
202
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
203
|
+
var prompt_1, result, keyword;
|
|
204
|
+
return __generator(this, function (_a) {
|
|
205
|
+
switch (_a.label) {
|
|
206
|
+
case 0:
|
|
207
|
+
if (!true) return [3 /*break*/, 6];
|
|
208
|
+
prompt_1 = new AcEdPromptKeywordOptions(AcApI18n.t('jig.layoff.settingsPrompt'));
|
|
209
|
+
prompt_1.allowNone = true;
|
|
210
|
+
this.addKeyword(prompt_1, 'viewports');
|
|
211
|
+
this.addKeyword(prompt_1, 'blockSelection');
|
|
212
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getKeywords(prompt_1)];
|
|
213
|
+
case 1:
|
|
214
|
+
result = _a.sent();
|
|
215
|
+
if (result.status !== AcEdPromptStatus.OK)
|
|
216
|
+
return [2 /*return*/];
|
|
217
|
+
keyword = result.stringResult;
|
|
218
|
+
if (!keyword)
|
|
219
|
+
return [2 /*return*/];
|
|
220
|
+
if (!(keyword === 'Viewports')) return [3 /*break*/, 3];
|
|
221
|
+
return [4 /*yield*/, this.promptViewportMode()];
|
|
222
|
+
case 2:
|
|
223
|
+
_a.sent();
|
|
224
|
+
return [3 /*break*/, 5];
|
|
225
|
+
case 3: return [4 /*yield*/, this.promptBlockSelectionMode()];
|
|
226
|
+
case 4:
|
|
227
|
+
_a.sent();
|
|
228
|
+
_a.label = 5;
|
|
229
|
+
case 5: return [3 /*break*/, 0];
|
|
230
|
+
case 6: return [2 /*return*/];
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Prompts for the viewport-specific off mode to persist for later selections.
|
|
237
|
+
*
|
|
238
|
+
* `Vpfreeze` currently falls back to a global off state because the viewer
|
|
239
|
+
* does not expose per-viewport layer visibility.
|
|
240
|
+
*
|
|
241
|
+
* @returns Resolves when the prompt is dismissed or the setting is updated.
|
|
242
|
+
*/
|
|
243
|
+
AcApLayoffCmd.prototype.promptViewportMode = function () {
|
|
244
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
245
|
+
var prompt, off, vpfreeze, result, keyword;
|
|
246
|
+
return __generator(this, function (_a) {
|
|
247
|
+
switch (_a.label) {
|
|
248
|
+
case 0:
|
|
249
|
+
prompt = new AcEdPromptKeywordOptions(AcApI18n.t('jig.layoff.viewportPrompt'));
|
|
250
|
+
prompt.allowNone = true;
|
|
251
|
+
off = prompt.keywords.add(AcApI18n.t('jig.layoff.keywords.off.display'), AcApI18n.t('jig.layoff.keywords.off.global'), AcApI18n.t('jig.layoff.keywords.off.local'));
|
|
252
|
+
vpfreeze = prompt.keywords.add(AcApI18n.t('jig.layoff.keywords.vpfreeze.display'), AcApI18n.t('jig.layoff.keywords.vpfreeze.global'), AcApI18n.t('jig.layoff.keywords.vpfreeze.local'));
|
|
253
|
+
prompt.keywords.default =
|
|
254
|
+
AcApLayoffCmd._settings.viewportMode === 'Vpfreeze' ? vpfreeze : off;
|
|
255
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getKeywords(prompt)];
|
|
256
|
+
case 1:
|
|
257
|
+
result = _a.sent();
|
|
258
|
+
if (result.status !== AcEdPromptStatus.OK)
|
|
259
|
+
return [2 /*return*/];
|
|
260
|
+
keyword = result.stringResult;
|
|
261
|
+
if (!keyword)
|
|
262
|
+
return [2 /*return*/];
|
|
263
|
+
AcApLayoffCmd._settings.viewportMode = keyword;
|
|
264
|
+
if (keyword === 'Vpfreeze') {
|
|
265
|
+
this._vpfreezeHintShown = true;
|
|
266
|
+
this.notify(AcApI18n.t('jig.layoff.vpfreezeFallback'));
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
this._vpfreezeHintShown = false;
|
|
270
|
+
}
|
|
271
|
+
return [2 /*return*/];
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Prompts for how nested block selections should resolve their target layer.
|
|
278
|
+
*
|
|
279
|
+
* The chosen value is persisted for future parity with AutoCAD even though
|
|
280
|
+
* nested selection handling is not implemented yet.
|
|
281
|
+
*
|
|
282
|
+
* @returns Resolves when the prompt is dismissed or the setting is updated.
|
|
283
|
+
*/
|
|
284
|
+
AcApLayoffCmd.prototype.promptBlockSelectionMode = function () {
|
|
285
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
286
|
+
var prompt, block, entity, none, result, keyword;
|
|
287
|
+
return __generator(this, function (_a) {
|
|
288
|
+
switch (_a.label) {
|
|
289
|
+
case 0:
|
|
290
|
+
prompt = new AcEdPromptKeywordOptions(AcApI18n.t('jig.layoff.blockSelectionPrompt'));
|
|
291
|
+
prompt.allowNone = true;
|
|
292
|
+
block = prompt.keywords.add(AcApI18n.t('jig.layoff.keywords.block.display'), AcApI18n.t('jig.layoff.keywords.block.global'), AcApI18n.t('jig.layoff.keywords.block.local'));
|
|
293
|
+
entity = prompt.keywords.add(AcApI18n.t('jig.layoff.keywords.entity.display'), AcApI18n.t('jig.layoff.keywords.entity.global'), AcApI18n.t('jig.layoff.keywords.entity.local'));
|
|
294
|
+
none = prompt.keywords.add(AcApI18n.t('jig.layoff.keywords.none.display'), AcApI18n.t('jig.layoff.keywords.none.global'), AcApI18n.t('jig.layoff.keywords.none.local'));
|
|
295
|
+
prompt.keywords.default =
|
|
296
|
+
AcApLayoffCmd._settings.blockSelectionMode === 'Block'
|
|
297
|
+
? block
|
|
298
|
+
: AcApLayoffCmd._settings.blockSelectionMode === 'Entity'
|
|
299
|
+
? entity
|
|
300
|
+
: none;
|
|
301
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getKeywords(prompt)];
|
|
302
|
+
case 1:
|
|
303
|
+
result = _a.sent();
|
|
304
|
+
if (result.status !== AcEdPromptStatus.OK)
|
|
305
|
+
return [2 /*return*/];
|
|
306
|
+
keyword = result.stringResult;
|
|
307
|
+
if (!keyword)
|
|
308
|
+
return [2 /*return*/];
|
|
309
|
+
AcApLayoffCmd._settings.blockSelectionMode = keyword;
|
|
310
|
+
this.notify(AcApI18n.t('jig.layoff.nestedSelectionLimited'));
|
|
311
|
+
return [2 /*return*/];
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Resolves the picked entity's layer and turns it off when allowed.
|
|
318
|
+
*
|
|
319
|
+
* The method validates the selection, prevents turning off the current layer,
|
|
320
|
+
* records undo history, and clears the selection set after a successful edit.
|
|
321
|
+
*
|
|
322
|
+
* @param context - Active application context containing the current database and view.
|
|
323
|
+
* @param objectId - Identifier of the entity selected by the user.
|
|
324
|
+
*/
|
|
325
|
+
AcApLayoffCmd.prototype.turnOffEntityLayer = function (context, objectId) {
|
|
326
|
+
var _a;
|
|
327
|
+
var db = context.doc.database;
|
|
328
|
+
var entity = db.tables.blockTable.getEntityById(objectId);
|
|
329
|
+
var layerName = (_a = entity === null || entity === void 0 ? void 0 : entity.layer) === null || _a === void 0 ? void 0 : _a.trim();
|
|
330
|
+
if (!layerName) {
|
|
331
|
+
this.notify(AcApI18n.t('jig.layoff.invalidSelection'), 'warning');
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
var layer = db.tables.layerTable.getAt(layerName);
|
|
335
|
+
if (!layer) {
|
|
336
|
+
this.notify("".concat(AcApI18n.t('jig.layoff.layerNotFound'), ": ").concat(layerName), 'warning');
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
if (layer.name === db.clayer) {
|
|
340
|
+
this.notify(AcApI18n.t('jig.layoff.cannotTurnOffCurrent'), 'warning');
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (layer.isOff) {
|
|
344
|
+
this.notify("".concat(AcApI18n.t('jig.layoff.alreadyOff'), ": ").concat(layer.name), 'info');
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
if (AcApLayoffCmd._settings.viewportMode === 'Vpfreeze' &&
|
|
348
|
+
!this._vpfreezeHintShown) {
|
|
349
|
+
this.notify(AcApI18n.t('jig.layoff.vpfreezeFallback'));
|
|
350
|
+
this._vpfreezeHintShown = true;
|
|
351
|
+
}
|
|
352
|
+
this._history.push({
|
|
353
|
+
layerName: layer.name,
|
|
354
|
+
wasOff: layer.isOff
|
|
355
|
+
});
|
|
356
|
+
layer.isOff = true;
|
|
357
|
+
context.view.selectionSet.clear();
|
|
358
|
+
this.notify("".concat(AcApI18n.t('jig.layoff.turnedOff'), ": ").concat(layer.name), 'success');
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Restores the most recently changed layer-off state captured during this run.
|
|
362
|
+
*
|
|
363
|
+
* @param context - Active application context containing the current database and view.
|
|
364
|
+
*/
|
|
365
|
+
AcApLayoffCmd.prototype.runUndo = function (context) {
|
|
366
|
+
var history = this._history.pop();
|
|
367
|
+
if (!history) {
|
|
368
|
+
this.notify(AcApI18n.t('jig.layoff.nothingToUndo'), 'warning');
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
var layer = context.doc.database.tables.layerTable.getAt(history.layerName);
|
|
372
|
+
if (!layer) {
|
|
373
|
+
this.notify("".concat(AcApI18n.t('jig.layoff.layerNotFound'), ": ").concat(history.layerName), 'warning');
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
layer.isOff = history.wasOff;
|
|
377
|
+
context.view.selectionSet.clear();
|
|
378
|
+
this.notify("".concat(AcApI18n.t('jig.layoff.restored'), ": ").concat(layer.name), 'success');
|
|
379
|
+
};
|
|
380
|
+
AcApLayoffCmd._settings = __assign({}, DEFAULT_SETTINGS);
|
|
381
|
+
return AcApLayoffCmd;
|
|
382
|
+
}(AcEdCommand));
|
|
383
|
+
export { AcApLayoffCmd };
|
|
384
|
+
//# sourceMappingURL=AcApLayerOffCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApLayerOffCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOffCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,WAAW,EAEX,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAsErC,IAAM,gBAAgB,GAAmB;IACvC,YAAY,EAAE,KAAK;IACnB,kBAAkB,EAAE,MAAM;CAC3B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH;IAAmC,iCAAW;IAM5C;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QAPD,cAAQ,GAAyB,EAAE,CAAA;QACnC,wBAAkB,GAAG,KAAK,CAAA;QAOhC,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;IAChC,CAAC;IAED;;;;;;;;OAQG;IACG,+BAAO,GAAb,UAAc,OAAoB;;;;;;wBAChC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;wBAClB,IAAI,CAAC,kBAAkB;4BACrB,aAAa,CAAC,SAAS,CAAC,YAAY,KAAK,UAAU,CAAA;;;6BAE9C,IAAI;wBACM,qBAAM,IAAI,C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CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,EAAE,SAAS,CAAC,CAAA;YAC9D,OAAM;QACR,CAAC;QAED,IAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CACxD,OAAO,CAAC,SAAS,CAClB,CAAA;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CACT,UAAG,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,eAAK,OAAO,CAAC,SAAS,CAAE,EACjE,SAAS,CACV,CAAA;YACD,OAAM;QACR,CAAC;QAED,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAA;QAC5B,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;QACjC,IAAI,CAAC,MAAM,CACT,UAAG,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,eAAK,KAAK,CAAC,IAAI,CAAE,EACrD,SAAS,CACV,CAAA;IACH,CAAC;IArUc,uBAAS,gBAAwB,gBAAgB,CAAxC,CAA0C;IAsUpE,oBAAC;CAAA,AAvUD,CAAmC,WAAW,GAuU7C;SAvUY,aAAa"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AcApContext } from '../../app';
|
|
2
|
+
import { AcEdCommand } from '../../editor';
|
|
3
|
+
/**
|
|
4
|
+
* AutoCAD-like `LAYON` command.
|
|
5
|
+
*
|
|
6
|
+
* The command turns on every layer in the current drawing by clearing the
|
|
7
|
+
* layer-off flag. Frozen layers remain frozen, which matches the AutoCAD
|
|
8
|
+
* command's responsibility of restoring only off layers.
|
|
9
|
+
*/
|
|
10
|
+
export declare class AcApLayerOnCmd extends AcEdCommand {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a write-enabled `LAYON` command instance.
|
|
13
|
+
*/
|
|
14
|
+
constructor();
|
|
15
|
+
/**
|
|
16
|
+
* Runs the turn-on-all-layers workflow.
|
|
17
|
+
*
|
|
18
|
+
* @param context - Active application context used to update the current drawing.
|
|
19
|
+
* @returns Resolves when all layer states have been processed.
|
|
20
|
+
*/
|
|
21
|
+
execute(context: AcApContext): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Sends a localized status message through the command-line output.
|
|
24
|
+
*
|
|
25
|
+
* @param message - Text to display to the user.
|
|
26
|
+
* @param type - Visual severity mapped to command-line message styles.
|
|
27
|
+
*/
|
|
28
|
+
private notify;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=AcApLayerOnCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApLayerOnCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOnCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,WAAW,EAAiC,MAAM,cAAc,CAAA;AAGzE;;;;;;GAMG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;OAEG;;IAMH;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;IAoBlC;;;;;OAKG;IACH,OAAO,CAAC,MAAM;CAGf"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
53
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
54
|
+
if (!m) return o;
|
|
55
|
+
var i = m.call(o), r, ar = [], e;
|
|
56
|
+
try {
|
|
57
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
58
|
+
}
|
|
59
|
+
catch (error) { e = { error: error }; }
|
|
60
|
+
finally {
|
|
61
|
+
try {
|
|
62
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
63
|
+
}
|
|
64
|
+
finally { if (e) throw e.error; }
|
|
65
|
+
}
|
|
66
|
+
return ar;
|
|
67
|
+
};
|
|
68
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
69
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
70
|
+
if (ar || !(i in from)) {
|
|
71
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
72
|
+
ar[i] = from[i];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
76
|
+
};
|
|
77
|
+
import { AcApDocManager } from '../../app';
|
|
78
|
+
import { AcEdCommand, AcEdOpenMode } from '../../editor';
|
|
79
|
+
import { AcApI18n } from '../../i18n';
|
|
80
|
+
/**
|
|
81
|
+
* AutoCAD-like `LAYON` command.
|
|
82
|
+
*
|
|
83
|
+
* The command turns on every layer in the current drawing by clearing the
|
|
84
|
+
* layer-off flag. Frozen layers remain frozen, which matches the AutoCAD
|
|
85
|
+
* command's responsibility of restoring only off layers.
|
|
86
|
+
*/
|
|
87
|
+
var AcApLayerOnCmd = /** @class */ (function (_super) {
|
|
88
|
+
__extends(AcApLayerOnCmd, _super);
|
|
89
|
+
/**
|
|
90
|
+
* Creates a write-enabled `LAYON` command instance.
|
|
91
|
+
*/
|
|
92
|
+
function AcApLayerOnCmd() {
|
|
93
|
+
var _this = _super.call(this) || this;
|
|
94
|
+
_this.mode = AcEdOpenMode.Write;
|
|
95
|
+
return _this;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Runs the turn-on-all-layers workflow.
|
|
99
|
+
*
|
|
100
|
+
* @param context - Active application context used to update the current drawing.
|
|
101
|
+
* @returns Resolves when all layer states have been processed.
|
|
102
|
+
*/
|
|
103
|
+
AcApLayerOnCmd.prototype.execute = function (context) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
105
|
+
var layers, turnedOn;
|
|
106
|
+
return __generator(this, function (_a) {
|
|
107
|
+
layers = __spreadArray([], __read(context.doc.database.tables.layerTable.newIterator()), false);
|
|
108
|
+
turnedOn = 0;
|
|
109
|
+
layers.forEach(function (layer) {
|
|
110
|
+
if (!layer.isOff)
|
|
111
|
+
return;
|
|
112
|
+
layer.isOff = false;
|
|
113
|
+
turnedOn++;
|
|
114
|
+
});
|
|
115
|
+
context.view.selectionSet.clear();
|
|
116
|
+
if (turnedOn === 0) {
|
|
117
|
+
this.notify(AcApI18n.t('jig.layon.alreadyOn'));
|
|
118
|
+
return [2 /*return*/];
|
|
119
|
+
}
|
|
120
|
+
this.notify("".concat(AcApI18n.t('jig.layon.turnedOn'), ": ").concat(turnedOn), 'success');
|
|
121
|
+
return [2 /*return*/];
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Sends a localized status message through the command-line output.
|
|
127
|
+
*
|
|
128
|
+
* @param message - Text to display to the user.
|
|
129
|
+
* @param type - Visual severity mapped to command-line message styles.
|
|
130
|
+
*/
|
|
131
|
+
AcApLayerOnCmd.prototype.notify = function (message, type) {
|
|
132
|
+
if (type === void 0) { type = 'info'; }
|
|
133
|
+
AcApDocManager.instance.editor.showMessage(message, type);
|
|
134
|
+
};
|
|
135
|
+
return AcApLayerOnCmd;
|
|
136
|
+
}(AcEdCommand));
|
|
137
|
+
export { AcApLayerOnCmd };
|
|
138
|
+
//# sourceMappingURL=AcApLayerOnCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApLayerOnCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOnCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,WAAW,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC;;;;;;GAMG;AACH;IAAoC,kCAAW;IAC7C;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;IAChC,CAAC;IAED;;;;;OAKG;IACG,gCAAO,GAAb,UAAc,OAAoB;;;;gBAC1B,MAAM,4BAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,SAAC,CAAA;gBACpE,QAAQ,GAAG,CAAC,CAAA;gBAEhB,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;oBAClB,IAAI,CAAC,KAAK,CAAC,KAAK;wBAAE,OAAM;oBACxB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;oBACnB,QAAQ,EAAE,CAAA;gBACZ,CAAC,CAAC,CAAA;gBAEF,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;gBAEjC,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;oBACnB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAA;oBAC9C,sBAAM;gBACR,CAAC;gBAED,IAAI,CAAC,MAAM,CAAC,UAAG,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,eAAK,QAAQ,CAAE,EAAE,SAAS,CAAC,CAAA;;;;KAC3E;IAED;;;;;OAKG;IACK,+BAAM,GAAd,UAAe,OAAe,EAAE,IAA8B;QAA9B,qBAAA,EAAA,aAA8B;QAC5D,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC3D,CAAC;IACH,qBAAC;AAAD,CAAC,AA5CD,CAAoC,WAAW,GA4C9C"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { AcApContext } from '../../app';
|
|
2
|
+
import { AcEdCommand } from '../../editor';
|
|
3
|
+
/**
|
|
4
|
+
* Global store for layer state snapshots to support LAYERP command.
|
|
5
|
+
*/
|
|
6
|
+
declare class AcApLayerPreviousStateManager {
|
|
7
|
+
private previousSnapshot;
|
|
8
|
+
/**
|
|
9
|
+
* Captures the current layer state.
|
|
10
|
+
* @param context - Active application context
|
|
11
|
+
*/
|
|
12
|
+
captureState(context: AcApContext): void;
|
|
13
|
+
/**
|
|
14
|
+
* Restores the previous layer state.
|
|
15
|
+
* @param context - Active application context
|
|
16
|
+
* @returns true if restoration was successful
|
|
17
|
+
*/
|
|
18
|
+
restorePreviousState(context: AcApContext): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Clears the previous state snapshot.
|
|
21
|
+
*/
|
|
22
|
+
clearPreviousState(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if a layer is locked.
|
|
25
|
+
* @param layer - Layer table record
|
|
26
|
+
*/
|
|
27
|
+
private isLayerLocked;
|
|
28
|
+
/**
|
|
29
|
+
* Sets or clears the locked bit in layer flags.
|
|
30
|
+
* @param layer - Layer table record
|
|
31
|
+
* @param locked - Whether the layer should be locked
|
|
32
|
+
*/
|
|
33
|
+
private setLayerLocked;
|
|
34
|
+
/**
|
|
35
|
+
* Sets or clears the frozen bit in layer flags.
|
|
36
|
+
* @param layer - Layer table record
|
|
37
|
+
* @param frozen - Whether the layer should be frozen
|
|
38
|
+
*/
|
|
39
|
+
private setLayerFrozen;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Exposes layer previous state manager for external use.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getLayerPreviousStateManager(): AcApLayerPreviousStateManager;
|
|
45
|
+
/**
|
|
46
|
+
* AutoCAD-like `LAYERP` command.
|
|
47
|
+
*
|
|
48
|
+
* The command restores the layer state to what it was before the last
|
|
49
|
+
* layer-modifying operation. This includes changes to layer on/off,
|
|
50
|
+
* freeze/thaw, and lock/unlock states.
|
|
51
|
+
*
|
|
52
|
+
* Note: This is a simplified implementation that tracks one previous state.
|
|
53
|
+
* A full implementation would maintain a stack of states.
|
|
54
|
+
*/
|
|
55
|
+
export declare class AcApLayerPCmd extends AcEdCommand {
|
|
56
|
+
/**
|
|
57
|
+
* Creates a write-enabled `LAYERP` command instance.
|
|
58
|
+
*/
|
|
59
|
+
constructor();
|
|
60
|
+
/**
|
|
61
|
+
* Runs the restore-previous-layer-state workflow.
|
|
62
|
+
*
|
|
63
|
+
* @param context - Active application context used to update the current drawing.
|
|
64
|
+
* @returns Resolves when the restoration is complete or if there is nothing to restore.
|
|
65
|
+
*/
|
|
66
|
+
execute(context: AcApContext): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Sends a localized status message through the command-line output.
|
|
69
|
+
*
|
|
70
|
+
* @param message - Text to display to the user.
|
|
71
|
+
* @param type - Visual severity mapped to command-line message styles.
|
|
72
|
+
*/
|
|
73
|
+
private notify;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Captures layer state before executing a layer-modifying command.
|
|
77
|
+
* Should be called before executing commands like LAYOFF, LAYFRZ, LAYLCK, etc.
|
|
78
|
+
*
|
|
79
|
+
* @param context - Active application context
|
|
80
|
+
*/
|
|
81
|
+
export declare function captureLayerStateBeforeOperation(context: AcApContext): void;
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=AcApLayerPCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApLayerPCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerPCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,WAAW,EAAiC,MAAM,cAAc,CAAA;AAkBzE;;GAEG;AACH,cAAM,6BAA6B;IACjC,OAAO,CAAC,gBAAgB,CAAsC;IAE9D;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAaxC;;;;OAIG;IACH,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IA8BnD;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAI1B;;;OAGG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAKtB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAIvB;AAKD;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,6BAA6B,CAE5E;AAED;;;;;;;;;GASG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;OAEG;;IAMH;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;IAUlC;;;;;OAKG;IACH,OAAO,CAAC,MAAM;CAGf;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAE3E"}
|